lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject lucene-solr:branch_6_0: SOLR-8874: Make Solr tests work with Java 9 Jigsaw
Date Sat, 19 Mar 2016 13:56:15 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/branch_6_0 bcc577325 -> 7a2bd4318


SOLR-8874: Make Solr tests work with Java 9 Jigsaw


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

Branch: refs/heads/branch_6_0
Commit: 7a2bd4318cc98fe612ab97cb37634e44bff8080c
Parents: bcc5773
Author: Uwe Schindler <uschindler@apache.org>
Authored: Sat Mar 19 14:53:59 2016 +0100
Committer: Uwe Schindler <uschindler@apache.org>
Committed: Sat Mar 19 14:55:59 2016 +0100

----------------------------------------------------------------------
 .../src/java/org/apache/lucene/util/LuceneTestCase.java     | 9 ++++++---
 solr/common-build.xml                                       | 7 +++++--
 .../apache/solr/morphlines/cell/SolrCellMorphlineTest.java  | 3 ++-
 .../solr/morphlines/solr/AbstractSolrMorphlineTestBase.java | 3 +++
 .../morphlines/solr/AbstractSolrMorphlineZkTestBase.java    | 3 +++
 .../test/org/apache/solr/cloud/SaslZkACLProviderTest.java   | 2 ++
 .../test/org/apache/solr/cloud/TestCloudDeleteByQuery.java  | 6 ++++--
 .../org/apache/solr/core/TestImplicitCoreProperties.java    | 4 +++-
 .../solr/handler/admin/CoreAdminCreateDiscoverTest.java     | 1 +
 .../src/java/org/apache/solr/SolrTestCaseJ4.java            | 1 +
 .../src/java/org/apache/solr/cloud/SolrCloudTestCase.java   | 4 +++-
 11 files changed, 33 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/7a2bd431/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
----------------------------------------------------------------------
diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
index e5aa7a2..5e50e58 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
@@ -568,11 +568,14 @@ public abstract class LuceneTestCase extends Assert {
   private final static long STATIC_LEAK_THRESHOLD = 10 * 1024 * 1024;
 
   /** By-name list of ignored types like loggers etc. */
-  private final static Set<String> STATIC_LEAK_IGNORED_TYPES = 
-      Collections.unmodifiableSet(new HashSet<>(Arrays.asList(
+  private final static Set<String> STATIC_LEAK_IGNORED_TYPES = Collections.unmodifiableSet(new
HashSet<>(Arrays.asList(
       "org.slf4j.Logger",
       "org.apache.solr.SolrLogFormatter",
-      EnumSet.class.getName())));
+      "java.io.File", // Solr sometimes refers to this in a static way, but it has a "java.nio.fs.Path"
inside 
+      Path.class.getName(), // causes problems because interface is implemented by hidden
classes
+      Class.class.getName(),
+      EnumSet.class.getName()
+  )));
 
   /**
    * This controls how suite-level rules are nested. It is important that _all_ rules declared

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/7a2bd431/solr/common-build.xml
----------------------------------------------------------------------
diff --git a/solr/common-build.xml b/solr/common-build.xml
index 6a06928..ddce161 100644
--- a/solr/common-build.xml
+++ b/solr/common-build.xml
@@ -151,10 +151,13 @@
 
   <!-- 
     We don't want to run HDFS tests on Windows, because they require Cygwin.
-    If you have Cygwin or manually raised permgen, you can override this property on command
line:
+    We don't want to run HDFS tests on Java 9 Jigsaw, because Hadoop/HDFS is completely broken
with Java's module system.
   -->
   <condition property="tests.disableHdfs" value="true">
-    <os family="windows"/>
+    <or>
+      <os family="windows"/>
+      <available classname="java.lang.reflect.Module"/>
+    </or>
   </condition>
 
   <target name="validate" depends="compile-tools">

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/7a2bd431/solr/contrib/morphlines-cell/src/test/org/apache/solr/morphlines/cell/SolrCellMorphlineTest.java
----------------------------------------------------------------------
diff --git a/solr/contrib/morphlines-cell/src/test/org/apache/solr/morphlines/cell/SolrCellMorphlineTest.java
b/solr/contrib/morphlines-cell/src/test/org/apache/solr/morphlines/cell/SolrCellMorphlineTest.java
index 6c9487a..9a43b42 100644
--- a/solr/contrib/morphlines-cell/src/test/org/apache/solr/morphlines/cell/SolrCellMorphlineTest.java
+++ b/solr/contrib/morphlines-cell/src/test/org/apache/solr/morphlines/cell/SolrCellMorphlineTest.java
@@ -42,7 +42,8 @@ public class SolrCellMorphlineTest extends AbstractSolrMorphlineTestBase
{
   @BeforeClass
   public static void beforeClass2() {
     assumeFalse("FIXME: Morphlines currently has issues with Windows paths", Constants.WINDOWS);
-    assumeFalse("This test fails with Java 9 (https://issues.apache.org/jira/browse/PDFBOX-3155)",
Constants.JRE_IS_MINIMUM_JAVA9);
+    assumeFalse("This test fails with Java 9 (https://issues.apache.org/jira/browse/PDFBOX-3155,
https://issues.apache.org/jira/browse/SOLR-8876)",
+        Constants.JRE_IS_MINIMUM_JAVA9);
   }
 
   @Before

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/7a2bd431/solr/contrib/morphlines-core/src/test/org/apache/solr/morphlines/solr/AbstractSolrMorphlineTestBase.java
----------------------------------------------------------------------
diff --git a/solr/contrib/morphlines-core/src/test/org/apache/solr/morphlines/solr/AbstractSolrMorphlineTestBase.java
b/solr/contrib/morphlines-core/src/test/org/apache/solr/morphlines/solr/AbstractSolrMorphlineTestBase.java
index cf03128..9c79c07 100644
--- a/solr/contrib/morphlines-core/src/test/org/apache/solr/morphlines/solr/AbstractSolrMorphlineTestBase.java
+++ b/solr/contrib/morphlines-core/src/test/org/apache/solr/morphlines/solr/AbstractSolrMorphlineTestBase.java
@@ -21,6 +21,7 @@ import com.google.common.base.Joiner;
 import com.google.common.io.Files;
 import com.typesafe.config.Config;
 import org.apache.commons.io.FileUtils;
+import org.apache.lucene.util.Constants;
 import org.apache.solr.SolrTestCaseJ4;
 import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.SolrQuery;
@@ -85,6 +86,8 @@ public class AbstractSolrMorphlineTestBase extends SolrTestCaseJ4 {
 
   @BeforeClass
   public static void beforeClass() throws Exception {
+    assumeFalse("This test fails on Java 9 (https://issues.apache.org/jira/browse/SOLR-8876)",
Constants.JRE_IS_MINIMUM_JAVA9);
+    
     // TODO: test doesn't work with some Locales, see SOLR-6458
     savedLocale = Locale.getDefault();
     Locale.setDefault(Locale.ENGLISH);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/7a2bd431/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 6c76ecb..4d95a4f 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
@@ -25,6 +25,7 @@ import com.codahale.metrics.MetricRegistry;
 import com.google.common.collect.ListMultimap;
 import com.typesafe.config.Config;
 import org.apache.commons.io.FileUtils;
+import org.apache.lucene.util.Constants;
 import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.cloud.AbstractFullDistribZkTestBase;
 import org.apache.solr.cloud.AbstractZkTestCase;
@@ -63,6 +64,8 @@ public abstract class AbstractSolrMorphlineZkTestBase extends AbstractFullDistri
   
   @BeforeClass
   public static void setupClass() throws Exception {
+    assumeFalse("This test fails on Java 9 (https://issues.apache.org/jira/browse/SOLR-8876)",
Constants.JRE_IS_MINIMUM_JAVA9);
+    
     assumeFalse("This test fails on UNIX with Turkish default locale (https://issues.apache.org/jira/browse/SOLR-6387)",
         new Locale("tr").getLanguage().equals(Locale.getDefault().getLanguage()));
     solrHomeDirectory = createTempDir().toFile();

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/7a2bd431/solr/core/src/test/org/apache/solr/cloud/SaslZkACLProviderTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/SaslZkACLProviderTest.java b/solr/core/src/test/org/apache/solr/cloud/SaslZkACLProviderTest.java
index 9d45746..9381c03 100644
--- a/solr/core/src/test/org/apache/solr/cloud/SaslZkACLProviderTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/SaslZkACLProviderTest.java
@@ -56,6 +56,8 @@ public class SaslZkACLProviderTest extends SolrTestCaseJ4 {
 
   @BeforeClass
   public static void beforeClass() {
+    assumeFalse("FIXME: This test fails on Java 9 (https://issues.apache.org/jira/browse/SOLR-8052)",
Constants.JRE_IS_MINIMUM_JAVA9);
+    
     assumeFalse("FIXME: SOLR-7040: This test fails under IBM J9",
                 Constants.JAVA_VENDOR.startsWith("IBM"));
     System.setProperty("solrcloud.skip.autorecovery", "true");

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/7a2bd431/solr/core/src/test/org/apache/solr/cloud/TestCloudDeleteByQuery.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestCloudDeleteByQuery.java b/solr/core/src/test/org/apache/solr/cloud/TestCloudDeleteByQuery.java
index a0bb42a..a7b242c 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestCloudDeleteByQuery.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestCloudDeleteByQuery.java
@@ -19,6 +19,8 @@ package org.apache.solr.cloud;
 import java.io.File;
 import java.lang.invoke.MethodHandles;
 import java.net.URL;
+import java.nio.file.Path;
+import java.nio.file.Paths;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
@@ -91,10 +93,10 @@ public class TestCloudDeleteByQuery extends SolrCloudTestCase {
   private static void createMiniSolrCloudCluster() throws Exception {
     
     final String configName = "solrCloudCollectionConfig";
-    File configDir = new File(TEST_HOME() + File.separator + "collection1" + File.separator
+ "conf");
+    final Path configDir = Paths.get(TEST_HOME(), "collection1", "conf");
     
     configureCluster(NUM_SERVERS)
-      .addConfig(configName, configDir.toPath())
+      .addConfig(configName, configDir)
       .configure();
     
     Map<String, String> collectionProperties = new HashMap<>();

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/7a2bd431/solr/core/src/test/org/apache/solr/core/TestImplicitCoreProperties.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/core/TestImplicitCoreProperties.java b/solr/core/src/test/org/apache/solr/core/TestImplicitCoreProperties.java
index 149d287..885ad71 100644
--- a/solr/core/src/test/org/apache/solr/core/TestImplicitCoreProperties.java
+++ b/solr/core/src/test/org/apache/solr/core/TestImplicitCoreProperties.java
@@ -34,8 +34,10 @@ public class TestImplicitCoreProperties extends SolrTestCaseJ4 {
 
   @AfterClass
   public static void teardownContainer() {
-    if (cc != null)
+    if (cc != null) {
       cc.shutdown();
+    }
+    cc = null;
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/7a2bd431/solr/core/src/test/org/apache/solr/handler/admin/CoreAdminCreateDiscoverTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/admin/CoreAdminCreateDiscoverTest.java
b/solr/core/src/test/org/apache/solr/handler/admin/CoreAdminCreateDiscoverTest.java
index cf41dc5..41807c7 100644
--- a/solr/core/src/test/org/apache/solr/handler/admin/CoreAdminCreateDiscoverTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/admin/CoreAdminCreateDiscoverTest.java
@@ -58,6 +58,7 @@ public class CoreAdminCreateDiscoverTest extends SolrTestCaseJ4 {
   @AfterClass
   public static void afterClass() throws Exception {
     admin = null; // Release it or the test harness complains.
+    solrHomeDirectory = null;
   }
 
   private static void setupCore(String coreName, boolean blivet) throws IOException {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/7a2bd431/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
----------------------------------------------------------------------
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 c3ce47d..6e511d7 100644
--- a/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
+++ b/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
@@ -265,6 +265,7 @@ public abstract class SolrTestCaseJ4 extends LuceneTestCase {
 
       // clean up static
       sslConfig = null;
+      testSolrHome = null;
     }
     
     IpTables.unblockAllPorts();

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/7a2bd431/solr/test-framework/src/java/org/apache/solr/cloud/SolrCloudTestCase.java
----------------------------------------------------------------------
diff --git a/solr/test-framework/src/java/org/apache/solr/cloud/SolrCloudTestCase.java b/solr/test-framework/src/java/org/apache/solr/cloud/SolrCloudTestCase.java
index 615365e..386419f 100644
--- a/solr/test-framework/src/java/org/apache/solr/cloud/SolrCloudTestCase.java
+++ b/solr/test-framework/src/java/org/apache/solr/cloud/SolrCloudTestCase.java
@@ -150,8 +150,10 @@ public class SolrCloudTestCase extends SolrTestCaseJ4 {
 
   @AfterClass
   public static void shutdownCluster() throws Exception {
-    if (cluster != null)
+    if (cluster != null) {
       cluster.shutdown();
+    }
+    cluster = null;
   }
 
   @Before


Mime
View raw message