Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

moved ping? into rsolr-ext

  • Loading branch information...
commit bb7c88a4e9ea52550cf960f6b2e203ad9e535d78 1 parent bd3ef0c
@mwmitchell mwmitchell authored
View
18 lib/rsolr/client.rb
@@ -95,24 +95,6 @@ def delete_by_id(id)
def delete_by_query(query)
update message.delete_by_query(query)
end
-
- # Ping the server and make sure it is alright
- # solr.ping?
- #
- # It returns true if the server pings and the status is OK
- # It returns false otherwise -- which probably cannot happen
- # Or raises an exception if there is a failure to connect or
- # the ping service is not activated in the solr server
- #
- # The default configuration point of the PingRequestHandler
- # in the solr server of '/admin/ping' is assumed. If it is
- # some other location, pass that in as the path
- #
- def ping?( path = '/admin/ping', params = {} )
- response = request( path, params )
- return response['status'] == "OK"
- end
-
# shortcut to RSolr::Message::Generator
def message
View
20 spec/api/client_spec.rb
@@ -94,26 +94,6 @@
end
- context :ping do
- it 'should forwad #ping? calls to the connection' do
- client.connection.should_receive(:request).
- with('/admin/ping', :wt => :ruby ).
- and_return( :params => { :wt => :ruby },
- :status_code => 200,
- :body => "{'responseHeader'=>{'status'=>0,'QTime'=>44,'params'=>{'echoParams'=>'all','echoParams'=>'all','q'=>'solrpingquery','qt'=>'standard','wt'=>'ruby'}},'status'=>'OK'}" )
- client.ping?
- end
-
- it 'should raise an error if the ping service is not available' do
- client.connection.should_receive(:request).
- with('/admin/ping', :wt => :ruby ).
- # the first part of the what the message would really be
- and_raise( RSolr::RequestError.new("Solr Response: pingQuery_not_configured_consider_registering_PingRequestHandler_with_the_name_adminping_instead__") )
- lambda { client.ping? }.should raise_error( RSolr::RequestError )
- end
-
- end
-
context :adapt_response do
it 'should not try to evaluate ruby when the :qt is not :ruby' do
View
2  spec/api/connection/requestable_spec.rb
@@ -161,7 +161,7 @@ def self.included base
response[:query].should == "q=testing"
response[:url].should == "http://127.0.0.1:8983/solr/blah?q=testing"
end
-
+
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.