lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject svn commit: r1364439 - /lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/ZkCLITest.java
Date Sun, 22 Jul 2012 21:47:07 GMT
Author: markrmiller
Date: Sun Jul 22 21:47:07 2012
New Revision: 1364439

URL: http://svn.apache.org/viewvc?rev=1364439&view=rev
Log:
speed up ZkCLITest

Modified:
    lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/ZkCLITest.java

Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/ZkCLITest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/ZkCLITest.java?rev=1364439&r1=1364438&r2=1364439&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/ZkCLITest.java (original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/ZkCLITest.java Sun Jul 22 21:47:07
2012
@@ -25,13 +25,13 @@ import org.apache.solr.SolrTestCaseJ4;
 import org.apache.solr.common.cloud.SolrZkClient;
 import org.apache.solr.common.cloud.ZkNodeProps;
 import org.apache.solr.common.cloud.ZkStateReader;
+import org.apache.solr.util.ExternalPaths;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-@Slow
 // TODO: This test would be a lot faster if it used a solrhome with fewer config
 // files - there are a lot of them to upload
 public class ZkCLITest extends SolrTestCaseJ4 {
@@ -65,32 +65,38 @@ public class ZkCLITest extends SolrTestC
     
     zkDir = dataDir.getAbsolutePath() + File.separator
         + "zookeeper/server1/data";
+    log.info("ZooKeeper dataDir:" + zkDir);
     zkServer = new ZkTestServer(zkDir);
     zkServer.run();
     System.setProperty("zkHost", zkServer.getZkAddress());
-    AbstractZkTestCase.buildZooKeeper(zkServer.getZkHost(),
-        zkServer.getZkAddress(), "solrconfig.xml", "schema.xml");
+    SolrZkClient zkClient = new SolrZkClient(zkServer.getZkHost(), AbstractZkTestCase.TIMEOUT);
+    zkClient.makePath("/solr", false, true);
+    zkClient.close();
 
     
-    zkClient = new SolrZkClient(zkServer.getZkAddress(),
+    this.zkClient = new SolrZkClient(zkServer.getZkAddress(),
         AbstractZkTestCase.TIMEOUT);
     
     log.info("####SETUP_END " + getTestName());
-    
   }
   
   @Test
   public void testBootstrap() throws Exception {
     // test bootstrap_conf
     String[] args = new String[] {"-zkhost", zkServer.getZkAddress(), "-cmd",
-        "bootstrap", "-solrhome", TEST_HOME()};
+        "bootstrap", "-solrhome", ExternalPaths.EXAMPLE_HOME};
     ZkCLI.main(args);
-
-
-    assertTrue(zkClient.exists(ZkStateReader.COLLECTIONS_ZKNODE + "/collection1", true));
     
     assertTrue(zkClient.exists(ZkController.CONFIGS_ZKNODE + "/collection1", true));
     
+    args = new String[] {"-zkhost", zkServer.getZkAddress(), "-cmd",
+        "bootstrap", "-solrhome", ExternalPaths.EXAMPLE_MULTICORE_HOME};
+    ZkCLI.main(args);
+    
+    assertTrue(zkClient.exists(ZkController.CONFIGS_ZKNODE + "/core0", true));
+    assertTrue(zkClient.exists(ZkController.CONFIGS_ZKNODE + "/core1", true));
+    
+
   }
   
   @Test
@@ -114,14 +120,14 @@ public class ZkCLITest extends SolrTestC
         "-cmd",
         "upconfig",
         "-confdir",
-        TEST_HOME() + File.separator + "collection1"
+        ExternalPaths.EXAMPLE_HOME + File.separator + "collection1"
             + File.separator + "conf", "-confname", confsetname};
     ZkCLI.main(args);
     
     assertTrue(zkClient.exists(ZkController.CONFIGS_ZKNODE + "/" + confsetname, true));
 
     // print help
-    ZkCLI.main(new String[0]);
+    // ZkCLI.main(new String[0]);
     
     // test linkconfig
     args = new String[] {"-zkhost", zkServer.getZkAddress(), "-cmd",



Mime
View raw message