Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-9107: Make SolrTestCaseJ4.beforeClass() / .afterClass() public

Alan Woodwardaed3fc11b18c
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index d96b1e604fc..fa84d5646b9 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -351,6 +351,9 @@ Other Changes
* SOLR-9107: new @RandomizeSSL annotation for more fine grained control of SSL testing (hossman, sarowe)
+* SOLR-9081: Make SolrTestCaseJ4.beforeClass() / .afterClass() public so it
+ works with Mockito (Georg Sorst, Alan Woodward)
+
================== 6.0.1 ==================
(No Changes)
diff --git a/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java b/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
index 41554c60508..db127846247 100644
--- a/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
+++ b/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
@@ -218,9 +218,8 @@ public abstract class SolrTestCaseJ4 extends LuceneTestCase {
public TestRule solrTestRules =
RuleChain.outerRule(new SystemPropertiesRestoreRule());
- @BeforeClass
- @SuppressWarnings("unused")
- private static void beforeClass() {
+ @BeforeClass
+ public static void setupTestCases() {
initCoreDataDir = createTempDir("init-core-data").toFile();
System.err.println("Creating dataDir: " + initCoreDataDir.getAbsolutePath());
@@ -244,8 +243,7 @@ public abstract class SolrTestCaseJ4 extends LuceneTestCase {
}
@AfterClass
- @SuppressWarnings("unused")
- private static void afterClass() throws Exception {
+ public static void teardownTestCases() throws Exception {
try {
deleteCore();
resetExceptionIgnores();