You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by sh...@apache.org on 2015/05/28 10:49:55 UTC

svn commit: r1682174 - in /lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud: CollectionStateFormat2Test.java ExternalCollectionsTest.java

Author: shalin
Date: Thu May 28 08:49:54 2015
New Revision: 1682174

URL: http://svn.apache.org/r1682174
Log:
SOLR-7599: Rename ExternalCollectionsTest to CollectionStateFormat2Test

Added:
    lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/CollectionStateFormat2Test.java
      - copied, changed from r1682167, lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/ExternalCollectionsTest.java
Removed:
    lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/ExternalCollectionsTest.java

Copied: lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/CollectionStateFormat2Test.java (from r1682167, lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/ExternalCollectionsTest.java)
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/CollectionStateFormat2Test.java?p2=lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/CollectionStateFormat2Test.java&p1=lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/ExternalCollectionsTest.java&r1=1682167&r2=1682174&rev=1682174&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/ExternalCollectionsTest.java (original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/CollectionStateFormat2Test.java Thu May 28 08:49:54 2015
@@ -27,53 +27,34 @@ import org.apache.solr.common.params.Mod
 import org.apache.zookeeper.data.Stat;
 import org.junit.Test;
 
-public class ExternalCollectionsTest extends AbstractFullDistribZkTestBase {
-  private CloudSolrClient client;
-
-  @Override
-  public void distribSetUp() throws Exception {
-    super.distribSetUp();
-    System.setProperty("numShards", Integer.toString(sliceCount));
-    System.setProperty("solr.xml.persist", "true");
-    client = createCloudClient(null);
-  }
-
-  @Override
-  public void distribTearDown() throws Exception {
-    super.distribTearDown();
-    client.close();
-  }
+public class CollectionStateFormat2Test extends AbstractFullDistribZkTestBase {
 
   protected String getSolrXml() {
     return "solr-no-core.xml";
   }
 
-  public ExternalCollectionsTest() {
-  }
-
-
   @Test
   @ShardsFixed(num = 4)
   public void test() throws Exception {
-    testZkNodeLocation();
-    testConfNameAndCollectionNameSame();
+    try (CloudSolrClient client = createCloudClient(null))  {
+      testZkNodeLocation(client);
+      testConfNameAndCollectionNameSame(client);
+    }
   }
 
-
-
   @Override
   protected String getStateFormat() {
     return "2";
   }
 
-  private void testConfNameAndCollectionNameSame() throws Exception{
+  private void testConfNameAndCollectionNameSame(CloudSolrClient client) throws Exception{
     // .system collection precreates the configset
 
     createCollection(".system", client, 2, 1);
     waitForRecoveriesToFinish(".system", false);
   }
 
-  private void testZkNodeLocation() throws Exception{
+  private void testZkNodeLocation(CloudSolrClient client) throws Exception{
 
     String collectionName = "myExternColl";