lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject svn commit: r902219 - in /lucene/solr/branches/cloud/src: java/org/apache/solr/cloud/ZkController.java test/org/apache/solr/cloud/ZkControllerTest.java
Date Fri, 22 Jan 2010 19:01:29 GMT
Author: markrmiller
Date: Fri Jan 22 19:01:29 2010
New Revision: 902219

URL: http://svn.apache.org/viewvc?rev=902219&view=rev
Log:
fix ZkControllerTest

Modified:
    lucene/solr/branches/cloud/src/java/org/apache/solr/cloud/ZkController.java
    lucene/solr/branches/cloud/src/test/org/apache/solr/cloud/ZkControllerTest.java

Modified: lucene/solr/branches/cloud/src/java/org/apache/solr/cloud/ZkController.java
URL: http://svn.apache.org/viewvc/lucene/solr/branches/cloud/src/java/org/apache/solr/cloud/ZkController.java?rev=902219&r1=902218&r2=902219&view=diff
==============================================================================
--- lucene/solr/branches/cloud/src/java/org/apache/solr/cloud/ZkController.java (original)
+++ lucene/solr/branches/cloud/src/java/org/apache/solr/cloud/ZkController.java Fri Jan 22
19:01:29 2010
@@ -103,15 +103,15 @@
    * @param localHost
    * @param locaHostPort
    * @param localHostContext
-   * @param coreConatiner
+   * @param coreContainer
    * @throws InterruptedException
    * @throws TimeoutException
    * @throws IOException
    */
   public ZkController(String zkServerAddress, int zkClientTimeout, String localHost, String
locaHostPort,
-      String localHostContext, final CoreContainer coreConatiner) throws InterruptedException,
+      String localHostContext, final CoreContainer coreContainer) throws InterruptedException,
       TimeoutException, IOException {
-    this.coreContainer = coreConatiner;
+    this.coreContainer = coreContainer;
     this.zkServerAddress = zkServerAddress;
     this.localHostPort = locaHostPort;
     this.localHostContext = localHostContext;
@@ -126,9 +126,13 @@
               // for others to do the same, then load
               createEphemeralNode();
               // register cores in case any new cores came online will zk was down
-              Collection<SolrCore> cores = coreConatiner.getCores();
-              for(SolrCore core : cores) {
-                register(core, false);
+              
+              // coreContainer may currently be null in tests, so don't reregister
+              if(coreContainer != null) {
+                Collection<SolrCore> cores = coreContainer.getCores();
+                for(SolrCore core : cores) {
+                  register(core, false);
+                }
               }
               updateCloudState();
             } catch (KeeperException e) {

Modified: lucene/solr/branches/cloud/src/test/org/apache/solr/cloud/ZkControllerTest.java
URL: http://svn.apache.org/viewvc/lucene/solr/branches/cloud/src/test/org/apache/solr/cloud/ZkControllerTest.java?rev=902219&r1=902218&r2=902219&view=diff
==============================================================================
--- lucene/solr/branches/cloud/src/test/org/apache/solr/cloud/ZkControllerTest.java (original)
+++ lucene/solr/branches/cloud/src/test/org/apache/solr/cloud/ZkControllerTest.java Fri Jan
22 19:01:29 2010
@@ -79,7 +79,7 @@
       }
 
       zkController = new ZkController(AbstractZkTestCase.ZOO_KEEPER_ADDRESS, TIMEOUT, "localhost",
-          "8983", "/solr");
+          "8983", "/solr", null);
       zkController.updateCloudState();
       CloudState cloudInfo = zkController.getCloudState();
       Map<String,Slice> slices = cloudInfo.getSlices("collection1");
@@ -152,7 +152,7 @@
       }
       zkClient.close();
       ZkController zkController = new ZkController(AbstractZkTestCase.ZOO_KEEPER_ADDRESS,
TIMEOUT,
-          "localhost", "8983", "/solr");
+          "localhost", "8983", "/solr", null);
       try {
         String configName = zkController.readConfigName(COLLECTION_NAME);
         assertEquals(configName, actualConfigName);
@@ -178,7 +178,7 @@
       AbstractZkTestCase.makeSolrZkNode();
 
       zkController = new ZkController(AbstractZkTestCase.ZOO_KEEPER_ADDRESS, TIMEOUT, "localhost",
-          "8983", "/solr");
+          "8983", "/solr", null);
 
       zkController.uploadDirToCloud(new File("solr/conf"),
           ZkController.CONFIGS_ZKNODE + "/config1");



Mime
View raw message