lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yo...@apache.org
Subject svn commit: r898525 - in /lucene/solr/branches/cloud/src/test/org/apache/solr: BaseDistributedSearchTestCase.java client/solrj/TestLBHttpSolrServer.java
Date Tue, 12 Jan 2010 21:32:16 GMT
Author: yonik
Date: Tue Jan 12 21:32:16 2010
New Revision: 898525

URL: http://svn.apache.org/viewvc?rev=898525&view=rev
Log:
SOLR-1698: use a .com address to try and avoid ISPs returning a fake response to a bad host

Modified:
    lucene/solr/branches/cloud/src/test/org/apache/solr/BaseDistributedSearchTestCase.java
    lucene/solr/branches/cloud/src/test/org/apache/solr/client/solrj/TestLBHttpSolrServer.java

Modified: lucene/solr/branches/cloud/src/test/org/apache/solr/BaseDistributedSearchTestCase.java
URL: http://svn.apache.org/viewvc/lucene/solr/branches/cloud/src/test/org/apache/solr/BaseDistributedSearchTestCase.java?rev=898525&r1=898524&r2=898525&view=diff
==============================================================================
--- lucene/solr/branches/cloud/src/test/org/apache/solr/BaseDistributedSearchTestCase.java
(original)
+++ lucene/solr/branches/cloud/src/test/org/apache/solr/BaseDistributedSearchTestCase.java
Tue Jan 12 21:32:16 2010
@@ -43,7 +43,7 @@
   protected String context = "/solr";
   protected String shards;
   protected String[] shardsArr;
-  protected String[] deadServers = {"does_not_exist_54321:33331/solr","localhost:33332/solr"};
+  protected String[] deadServers = {"does_not_exist_54321.com:33331/solr","localhost:33332/solr"};
   protected File testDir;
   protected SolrServer controlClient;
   protected int portSeed;

Modified: lucene/solr/branches/cloud/src/test/org/apache/solr/client/solrj/TestLBHttpSolrServer.java
URL: http://svn.apache.org/viewvc/lucene/solr/branches/cloud/src/test/org/apache/solr/client/solrj/TestLBHttpSolrServer.java?rev=898525&r1=898524&r2=898525&view=diff
==============================================================================
--- lucene/solr/branches/cloud/src/test/org/apache/solr/client/solrj/TestLBHttpSolrServer.java
(original)
+++ lucene/solr/branches/cloud/src/test/org/apache/solr/client/solrj/TestLBHttpSolrServer.java
Tue Jan 12 21:32:16 2010
@@ -174,6 +174,26 @@
     }
     assertEquals(3, names.size());
 
+
+    String noexist = "http://does_not_exist_54321.com:33331/solr";
+    LinkedList<String> serverList2 = new LinkedList<String>(serverList);
+    serverList2.addFirst(noexist);
+
+    // Make sure the non-existant server is skipped
+    names.clear();
+    for (int i=0; i<servers.length+1; i++) {
+      LBHttpSolrServer.Req req = new LBHttpSolrServer.Req(solrRequest, serverList2);
+      LBHttpSolrServer.Rsp rsp = lb2.request(req);
+      resp = new QueryResponse(rsp.getResponse(), lb);
+      assertEquals(10, resp.getResults().getNumFound());
+      names.add(resp.getResults().get(0).getFieldValue("name").toString());
+
+      // rotate the server list
+      serverList2.addLast(serverList2.removeFirst());
+    }
+    assertEquals(3, names.size());
+
+
     
     // slow LB for Simple API
     LBHttpSolrServer slowLB = new LBHttpSolrServer(servers);
@@ -236,6 +256,7 @@
       LBHttpSolrServer.Rsp rsp = slowLB2.request(req);
     }
 
+
   }
 
   // this test is a subset of testSimple and is no longer needed



Mime
View raw message