lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ehatc...@apache.org
Subject svn commit: r502465 - in /lucene/solr/trunk/client/ruby/solrb/test: functional/server_test.rb unit/delete_test.rb unit/field_test.rb
Date Fri, 02 Feb 2007 03:20:09 GMT
Author: ehatcher
Date: Thu Feb  1 19:20:08 2007
New Revision: 502465

URL: http://svn.apache.org/viewvc?view=rev&rev=502465
Log:
SOLR-132: Add tests to verify roundtripping of accented characters from solrb API to Solr
(contributed by Antonio Eggberg)

Modified:
    lucene/solr/trunk/client/ruby/solrb/test/functional/server_test.rb
    lucene/solr/trunk/client/ruby/solrb/test/unit/delete_test.rb
    lucene/solr/trunk/client/ruby/solrb/test/unit/field_test.rb

Modified: lucene/solr/trunk/client/ruby/solrb/test/functional/server_test.rb
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/client/ruby/solrb/test/functional/server_test.rb?view=diff&rev=502465&r1=502464&r2=502465
==============================================================================
--- lucene/solr/trunk/client/ruby/solrb/test/functional/server_test.rb (original)
+++ lucene/solr/trunk/client/ruby/solrb/test/functional/server_test.rb Thu Feb  1 19:20:08
2007
@@ -50,6 +50,29 @@
     assert_equal 0, response.total_hits
   end 
 
+  def test_i18n_full_lifecycle
+    # make sure autocommit is on
+    assert @connection.autocommit
+
+    # make sure this doc isn't there to begin with
+    @connection.delete(123456)
+
+    # add it
+    @connection.add(:id => 123456, :text => 'Åäöêâîôû')
+
+    # look for it
+    response = @connection.query('Åäöêâîôû')
+    assert_equal 1, response.total_hits
+    assert_equal '123456', response.hits[0]['id']
+
+    # delete it
+    @connection.delete(123456)
+
+    # make sure it's gone
+    response = @connection.query('Åäöêâîôû Öëäïöü')
+    assert_equal 0, response.total_hits
+  end
+
   def test_bad_connection
     conn = Solr::Connection.new 'http://127.0.0.1:9999/invalid'
     assert_raise(Errno::ECONNREFUSED) do

Modified: lucene/solr/trunk/client/ruby/solrb/test/unit/delete_test.rb
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/client/ruby/solrb/test/unit/delete_test.rb?view=diff&rev=502465&r1=502464&r2=502465
==============================================================================
--- lucene/solr/trunk/client/ruby/solrb/test/unit/delete_test.rb (original)
+++ lucene/solr/trunk/client/ruby/solrb/test/unit/delete_test.rb Thu Feb  1 19:20:08 2007
@@ -48,4 +48,9 @@
     assert_equal false, response.ok? 
   end
 
+  def test_delete_by_i18n_query_request
+    request = Solr::Request::Delete.new(:query => 'ëäïöü')
+    assert_equal "<delete><query>ëäïöü</query></delete>",
request.to_s
+  end
+
 end

Modified: lucene/solr/trunk/client/ruby/solrb/test/unit/field_test.rb
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/client/ruby/solrb/test/unit/field_test.rb?view=diff&rev=502465&r1=502464&r2=502465
==============================================================================
--- lucene/solr/trunk/client/ruby/solrb/test/unit/field_test.rb (original)
+++ lucene/solr/trunk/client/ruby/solrb/test/unit/field_test.rb Thu Feb  1 19:20:08 2007
@@ -20,5 +20,11 @@
     assert_kind_of REXML::Element, field.to_xml
     assert_equal "<field name='creator'>Erik Hatcher</field>", field.to_xml.to_s
   end
-
+  
+  def test_i18n_xml
+    field = Solr::Field.new :i18nstring => 'Äêâîôû Öëäïöü'
+    assert_kind_of REXML::Element, field.to_xml
+    assert_equal "<field name='i18nstring'>Äêâîôû Öëäïöü</field>",
field.to_xml.to_s
+  end
+  
 end



Mime
View raw message