You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2021/02/21 15:20:13 UTC

[lucene-solr] branch reference_impl_dev updated: @1364 Test hardening.

This is an automated email from the ASF dual-hosted git repository.

markrmiller pushed a commit to branch reference_impl_dev
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/reference_impl_dev by this push:
     new cbcad70  @1364 Test hardening.
cbcad70 is described below

commit cbcad70a6985d8f96677ae1c45a6961202ab5876
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Sun Feb 21 09:19:51 2021 -0600

    @1364 Test hardening.
    
    Took 6 minutes
---
 .../org/apache/solr/handler/component/ShardsWhitelistTest.java     | 7 ++++---
 .../test/org/apache/solr/highlight/FastVectorHighlighterTest.java  | 6 ++++--
 .../src/java/org/apache/solr/cloud/MultiSolrCloudTestCase.java     | 6 ++++--
 3 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/solr/core/src/test/org/apache/solr/handler/component/ShardsWhitelistTest.java b/solr/core/src/test/org/apache/solr/handler/component/ShardsWhitelistTest.java
index 1aebebc8..e210011 100644
--- a/solr/core/src/test/org/apache/solr/handler/component/ShardsWhitelistTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/component/ShardsWhitelistTest.java
@@ -63,8 +63,8 @@ public class ShardsWhitelistTest extends MultiSolrCloudTestCase {
   }
 
   @Before
-  public void setupClusters() throws Exception {
-
+  public void setUp() throws Exception {
+    super.setUp();
     final String[] clusterIds = new String[] {IMPLICIT_CLUSTER_KEY, EXPLICIT_CLUSTER_KEY};
 
     numShards = 2; // +random().nextInt(2);
@@ -117,7 +117,8 @@ public class ShardsWhitelistTest extends MultiSolrCloudTestCase {
   }
 
   @After
-  public void afterTests() {
+  public void tearDown() throws Exception {
+    super.tearDown();
     System.clearProperty(EXPLICIT_WHITELIST_PROPERTY + EXPLICIT_CLUSTER_KEY);
   }
 
diff --git a/solr/core/src/test/org/apache/solr/highlight/FastVectorHighlighterTest.java b/solr/core/src/test/org/apache/solr/highlight/FastVectorHighlighterTest.java
index e7f2ef0..1d72a0e 100644
--- a/solr/core/src/test/org/apache/solr/highlight/FastVectorHighlighterTest.java
+++ b/solr/core/src/test/org/apache/solr/highlight/FastVectorHighlighterTest.java
@@ -29,13 +29,15 @@ import org.junit.Test;
 public class FastVectorHighlighterTest extends SolrTestCaseJ4 {
 
   @Before
-  public void beforeTest() throws Exception {
+  public void setUp() throws Exception {
+    super.setUp();
     initCore("solrconfig.xml","schema.xml");
   }
 
   @After
-  public void afterTest() throws Exception {
+  public void tearDown() throws Exception {
     deleteCore();
+    super.tearDown();
   }
 
   @Test
diff --git a/solr/test-framework/src/java/org/apache/solr/cloud/MultiSolrCloudTestCase.java b/solr/test-framework/src/java/org/apache/solr/cloud/MultiSolrCloudTestCase.java
index e4ab6a0..c2566b5 100644
--- a/solr/test-framework/src/java/org/apache/solr/cloud/MultiSolrCloudTestCase.java
+++ b/solr/test-framework/src/java/org/apache/solr/cloud/MultiSolrCloudTestCase.java
@@ -106,12 +106,13 @@ public abstract class MultiSolrCloudTestCase extends SolrTestCaseJ4 {
   }
 
   @Before
-  public void beforeMultiSolrCloudTestCase() throws Exception {
+  public void setUp() throws Exception {
     clusterId2cluster = new ConcurrentHashMap<>();
+    super.setUp();
   }
 
   @After
-  public void shutdownCluster() throws Exception {
+  public void tearDown() throws Exception {
     clusterId2cluster.forEach((s, miniSolrCloudCluster) -> {
       try {
         miniSolrCloudCluster.shutdown();
@@ -120,6 +121,7 @@ public abstract class MultiSolrCloudTestCase extends SolrTestCaseJ4 {
       }
     });
     clusterId2cluster = null;
+    super.tearDown();
   }
 
 }