lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cpoersc...@apache.org
Subject [13/50] [abbrv] lucene-solr:jira/solr-9045: SOLR-10195: Harden AbstractSolrMorphlineZkTestBase based tests.
Date Tue, 28 Feb 2017 17:26:40 GMT
SOLR-10195: Harden AbstractSolrMorphlineZkTestBase based tests.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/c53b7c33
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/c53b7c33
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/c53b7c33

Branch: refs/heads/jira/solr-9045
Commit: c53b7c33b03aad3880b57a85d4402a31f3e0ea36
Parents: 1e206d8
Author: markrmiller <markrmiller@apache.org>
Authored: Wed Feb 22 19:50:19 2017 -0500
Committer: markrmiller <markrmiller@apache.org>
Committed: Wed Feb 22 19:50:19 2017 -0500

----------------------------------------------------------------------
 .../solr/AbstractSolrMorphlineZkTestBase.java           | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c53b7c33/solr/contrib/morphlines-core/src/test/org/apache/solr/morphlines/solr/AbstractSolrMorphlineZkTestBase.java
----------------------------------------------------------------------
diff --git a/solr/contrib/morphlines-core/src/test/org/apache/solr/morphlines/solr/AbstractSolrMorphlineZkTestBase.java
b/solr/contrib/morphlines-core/src/test/org/apache/solr/morphlines/solr/AbstractSolrMorphlineZkTestBase.java
index 535fe9d..9aa27c4 100644
--- a/solr/contrib/morphlines-core/src/test/org/apache/solr/morphlines/solr/AbstractSolrMorphlineZkTestBase.java
+++ b/solr/contrib/morphlines-core/src/test/org/apache/solr/morphlines/solr/AbstractSolrMorphlineZkTestBase.java
@@ -30,6 +30,7 @@ import org.apache.solr.client.solrj.request.CollectionAdminRequest;
 import org.apache.solr.cloud.AbstractDistribZkTestBase;
 import org.apache.solr.cloud.SolrCloudTestCase;
 import org.apache.solr.common.SolrDocument;
+import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.kitesdk.morphline.api.Collector;
@@ -49,6 +50,10 @@ public abstract class AbstractSolrMorphlineZkTestBase extends SolrCloudTestCase
 
   @BeforeClass
   public static void setupCluster() throws Exception {
+    // set some system properties for use by tests
+    System.setProperty("solr.test.sys.prop1", "propone");
+    System.setProperty("solr.test.sys.prop2", "proptwo");
+    
     configureCluster(2)
         .addConfig("conf", SOLR_CONF_DIR.toPath())
         .configure();
@@ -58,6 +63,12 @@ public abstract class AbstractSolrMorphlineZkTestBase extends SolrCloudTestCase
     AbstractDistribZkTestBase.waitForRecoveriesToFinish(COLLECTION, cluster.getSolrClient().getZkStateReader(),
         false, true, TIMEOUT);
   }
+  
+  @AfterClass
+  public static void afterClass() {
+    System.clearProperty("solr.test.sys.prop1");
+    System.clearProperty("solr.test.sys.prop2");
+  }
 
   protected static final String RESOURCES_DIR = getFile("morphlines-core.marker").getParent();
   private static final File SOLR_CONF_DIR = new File(RESOURCES_DIR + "/solr/collection1/conf");
@@ -79,6 +90,7 @@ public abstract class AbstractSolrMorphlineZkTestBase extends SolrCloudTestCase
   @Before
   public void setup() throws Exception {
     collector = new Collector();
+    cluster.waitForAllNodes(DEFAULT_TIMEOUT);
   }
 
   protected void commit() throws Exception {


Mime
View raw message