You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by rh...@apache.org on 2018/09/14 19:23:58 UTC

svn commit: r1840949 - in /db/derby/code/trunk/java: org.apache.derby.commons/org/apache/derby/shared/common/info/ProductVersionHolder.java org.apache.derby.tests/org/apache/derbyTesting/functionTests/tests/compatibility/_Suite.java

Author: rhillegas
Date: Fri Sep 14 19:23:58 2018
New Revision: 1840949

URL: http://svn.apache.org/viewvc?rev=1840949&view=rev
Log:
DERBY-6945: Disable the compatibility tests when running with the module path; commit derby-6945-58-aa-disableCompatibilityTestsWithModulePath.diff.

Modified:
    db/derby/code/trunk/java/org.apache.derby.commons/org/apache/derby/shared/common/info/ProductVersionHolder.java
    db/derby/code/trunk/java/org.apache.derby.tests/org/apache/derbyTesting/functionTests/tests/compatibility/_Suite.java

Modified: db/derby/code/trunk/java/org.apache.derby.commons/org/apache/derby/shared/common/info/ProductVersionHolder.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/org.apache.derby.commons/org/apache/derby/shared/common/info/ProductVersionHolder.java?rev=1840949&r1=1840948&r2=1840949&view=diff
==============================================================================
--- db/derby/code/trunk/java/org.apache.derby.commons/org/apache/derby/shared/common/info/ProductVersionHolder.java (original)
+++ db/derby/code/trunk/java/org.apache.derby.commons/org/apache/derby/shared/common/info/ProductVersionHolder.java Fri Sep 14 19:23:58 2018
@@ -25,6 +25,9 @@ import java.io.InputStream;
 import java.io.IOException;
 import java.util.Properties;
 
+import org.apache.derby.shared.common.error.StandardException;
+import org.apache.derby.shared.common.info.JVMInfo;
+import org.apache.derby.shared.common.reference.ModuleUtil;
 
 /**
   Class to hold a Derby Product version.
@@ -574,7 +577,22 @@ public final class ProductVersionHolder
 	private Properties loadProperties(String productGenus) {
 		String resourceName = "/org/apache/derby/info/" + productGenus+"/info.properties";
 			
-		InputStream is = getClass().getResourceAsStream(resourceName);
+		InputStream is = null;
+
+        if (JVMInfo.isModuleAware())
+        {
+            try
+            {
+                is = ModuleUtil.getResourceAsStream(resourceName);
+            }
+            catch (StandardException ex)
+            {
+              // report some error if you can
+              System.out.println(ex.getMessage());
+            }
+        }
+        else { is = getClass().getResourceAsStream(resourceName); }
+        
 		if (is==null) {
 			return null;
 		}

Modified: db/derby/code/trunk/java/org.apache.derby.tests/org/apache/derbyTesting/functionTests/tests/compatibility/_Suite.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/org.apache.derby.tests/org/apache/derbyTesting/functionTests/tests/compatibility/_Suite.java?rev=1840949&r1=1840948&r2=1840949&view=diff
==============================================================================
--- db/derby/code/trunk/java/org.apache.derby.tests/org/apache/derbyTesting/functionTests/tests/compatibility/_Suite.java (original)
+++ db/derby/code/trunk/java/org.apache.derby.tests/org/apache/derbyTesting/functionTests/tests/compatibility/_Suite.java Fri Sep 14 19:23:58 2018
@@ -24,6 +24,7 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 import junit.framework.Test;
+import org.apache.derby.shared.common.info.JVMInfo;
 import org.apache.derbyTesting.junit.BaseJDBCTestCase;
 import org.apache.derbyTesting.junit.BaseTestSuite;
 import org.apache.derbyTesting.junit.Derby;
@@ -117,6 +118,13 @@ public class _Suite
      * @return A default suite of compatibility tests.
      */
     public static Test suite() {
+
+        // Don't run from the module path. Old clients and servers
+        // should always be run from the classpath.
+        if (JVMInfo.isModuleAware())
+        {
+            return new BaseTestSuite("tests.compatibility disabled when using a module path");
+        }
         // DERBY-5889: Disabling tests on Windows where the old releases are
         // run off of UNC paths (network drives).
         if (suffersFromDerby5889()) {