rsolr 0.9.6 → 0.9.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGES.txt +15 -0
- data/README.rdoc +7 -33
- data/Rakefile +7 -69
- data/examples/http.rb +2 -3
- data/lib/rsolr/connection/{adapter/direct.rb → direct.rb} +2 -2
- data/lib/rsolr/connection/net_http.rb +79 -0
- data/lib/rsolr/connection.rb +57 -109
- data/lib/rsolr/message.rb +25 -24
- data/lib/rsolr.rb +9 -7
- data/lib/xout.rb +65 -0
- data/test/connection/direct_test.rb +2 -2
- data/test/connection/{http_test.rb → net_http_test.rb} +2 -2
- data/test/{http_client/util_test.rb → connection/utils_test.rb} +1 -1
- data/test/message_test.rb +2 -29
- metadata +12 -29
- data/lib/rsolr/connection/adapter/http.rb +0 -42
- data/lib/rsolr/http_client/adapter/curb.rb +0 -51
- data/lib/rsolr/http_client/adapter/net_http.rb +0 -48
- data/lib/rsolr/http_client.rb +0 -149
- data/lib/rsolr/message/adapter/builder.rb +0 -85
- data/lib/rsolr/message/adapter/libxml.rb +0 -59
- data/rsolr.gemspec +0 -46
- data/test/http_client/curb_test.rb +0 -18
- data/test/http_client/net_http_test.rb +0 -12
- data/test/http_client/test_methods.rb +0 -40
@@ -1,40 +0,0 @@
|
|
1
|
-
module HTTPClientTestMethods
|
2
|
-
|
3
|
-
URL = 'http://localhost:8983/solr/'
|
4
|
-
|
5
|
-
def test_raise_unknown_adapter
|
6
|
-
assert_raise RSolr::HTTPClient::UnkownAdapterError do
|
7
|
-
c = RSolr::HTTPClient.connect(:blah, URL)
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
# the responses from the HTTPClient adapter should return the same hash structure
|
12
|
-
def test_get_response
|
13
|
-
headers = {}
|
14
|
-
data = nil
|
15
|
-
response = @c.get('select', :q=>'*:*')
|
16
|
-
assert_equal data, response[:data]
|
17
|
-
assert_equal 200, response[:status_code]
|
18
|
-
expected_params = {:q=>'*:*'}
|
19
|
-
assert_equal expected_params, response[:params]
|
20
|
-
assert_equal 'select', response[:path]
|
21
|
-
assert response[:body] =~ /name="responseHeader"/
|
22
|
-
assert_equal 'http://localhost:8983/solr/select?q=%2A%3A%2A', response[:url]
|
23
|
-
assert_equal headers, response[:headers]
|
24
|
-
end
|
25
|
-
|
26
|
-
def test_post_response
|
27
|
-
headers = {"Content-Type" => 'text/xml; charset=utf-8'}
|
28
|
-
data = '<add><doc><field name="id">1</field></doc></add>'
|
29
|
-
response = @c.post('update', data, {}, headers)
|
30
|
-
assert_equal data, response[:data]
|
31
|
-
assert_equal 200, response[:status_code]
|
32
|
-
expected_params = {}
|
33
|
-
assert_equal expected_params, response[:params]
|
34
|
-
assert_equal 'update', response[:path]
|
35
|
-
assert response[:body] =~ /name="responseHeader"/
|
36
|
-
assert_equal 'http://localhost:8983/solr/update', response[:url]
|
37
|
-
assert_equal headers, response[:headers]
|
38
|
-
end
|
39
|
-
|
40
|
-
end
|