db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1741311 - in /db/derby/code/branches/10.12: ./ java/testing/org/apache/derbyTesting/functionTests/harness/ java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/ java/testing/org/apache/derbyTesting/junit/
Date Wed, 27 Apr 2016 18:42:32 GMT
Author: kahatlen
Date: Wed Apr 27 18:42:31 2016
New Revision: 1741311

URL: http://svn.apache.org/viewvc?rev=1741311&view=rev
Log:
DERBY-6854: Make it possible to run Derby tests on early access versions of JDK 9

Merged revision 1725139 from trunk.

DERBY-6881: Test failures with JDK 9-ea b111

Merged revisions 1737188 and 1737189 from trunk.

Modified:
    db/derby/code/branches/10.12/   (props changed)
    db/derby/code/branches/10.12/java/testing/org/apache/derbyTesting/functionTests/harness/JavaVersionHolder.java
    db/derby/code/branches/10.12/java/testing/org/apache/derbyTesting/functionTests/harness/Sed.java
    db/derby/code/branches/10.12/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java
    db/derby/code/branches/10.12/java/testing/org/apache/derbyTesting/junit/ClassLoaderTestSetup.java

Propchange: db/derby/code/branches/10.12/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Apr 27 18:42:31 2016
@@ -1,4 +1,4 @@
 /db/derby/code/branches/10.7:1061570,1061578,1082235
 /db/derby/code/branches/10.8:1177474,1234973,1464951
 /db/derby/code/branches/10.9:1373148
-/db/derby/code/trunk:1063809,1702820-1702830,1702836,1727680,1738368
+/db/derby/code/trunk:1063809,1702820-1702830,1702836,1725139,1727680,1737188-1737189,1738368

Modified: db/derby/code/branches/10.12/java/testing/org/apache/derbyTesting/functionTests/harness/JavaVersionHolder.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.12/java/testing/org/apache/derbyTesting/functionTests/harness/JavaVersionHolder.java?rev=1741311&r1=1741310&r2=1741311&view=diff
==============================================================================
--- db/derby/code/branches/10.12/java/testing/org/apache/derbyTesting/functionTests/harness/JavaVersionHolder.java
(original)
+++ db/derby/code/branches/10.12/java/testing/org/apache/derbyTesting/functionTests/harness/JavaVersionHolder.java
Wed Apr 27 18:42:31 2016
@@ -38,11 +38,17 @@ public class JavaVersionHolder
     public JavaVersionHolder(String javaVersion)
         throws java.lang.NumberFormatException
     {
-		// check for jdk12 or higher
-		int i = javaVersion.indexOf('.');
-		int j = javaVersion.indexOf('.', i+1);
-		majorVersion = javaVersion.substring(0, i);
-		try
+	// handle early access versions of JDK 9
+	if (javaVersion.startsWith( "9" ))
+	{
+	    javaVersion = "1.9.0";
+	}
+
+	// check for jdk12 or higher
+	int i = javaVersion.indexOf('.');
+	int j = javaVersion.indexOf('.', i+1);
+	majorVersion = javaVersion.substring(0, i);
+	try
 	    {
 		    Integer imajor = new Integer(majorVersion);
 		    major = imajor.intValue();

Modified: db/derby/code/branches/10.12/java/testing/org/apache/derbyTesting/functionTests/harness/Sed.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.12/java/testing/org/apache/derbyTesting/functionTests/harness/Sed.java?rev=1741311&r1=1741310&r2=1741311&view=diff
==============================================================================
--- db/derby/code/branches/10.12/java/testing/org/apache/derbyTesting/functionTests/harness/Sed.java
(original)
+++ db/derby/code/branches/10.12/java/testing/org/apache/derbyTesting/functionTests/harness/Sed.java
Wed Apr 27 18:42:31 2016
@@ -86,7 +86,7 @@ public class Sed
         deleteLines.addElement("^.*at java.*\\<init\\>\\(.*\\(Compiled Code\\)\\)$");
         deleteLines.addElement("^(.*at .*)\\(Interpreted Code\\)$");
         deleteLines.addElement("^(.*at .*)\\(Unknown Source\\)$");
-        deleteLines.addElement("^(.*at .*)\\(Native Method\\)$");
+        deleteLines.addElement("^(.*at .*)\\(.*Native Method\\)$");
         deleteLines.addElement("^\\tat $"); // rare case of incomplete stack trace line
         deleteLines.addElement("optimizer estimated cost");
         deleteLines.addElement("optimizer estimated row count");

Modified: db/derby/code/branches/10.12/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.12/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java?rev=1741311&r1=1741310&r2=1741311&view=diff
==============================================================================
--- db/derby/code/branches/10.12/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java
(original)
+++ db/derby/code/branches/10.12/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java
Wed Apr 27 18:42:31 2016
@@ -355,9 +355,12 @@ public class UnsupportedVetter	extends B
 	public	void	testSupportedMethods()
 		throws Exception
 	{
-        getTestConfiguration().setVerbosity( true );
+    getTestConfiguration().setVerbosity( true );
 
-        if ( savedVerbosity ) { println( "Supports JDBC 4.2 = " + JDBC. vmSupportsJDBC42()
); }
+    // do not run on java 9. it introduces classes and methods not found in java 8.
+    if (vmAtLeast(1, 9)) { return; }
+
+    if ( savedVerbosity ) { println( "Supports JDBC 4.2 = " + JDBC. vmSupportsJDBC42() );
}
 
 		HashSet<String>	vanishedMethodList = new HashSet<String>();
 		HashSet<String>	unsupportedList = new HashSet<String>();
@@ -377,9 +380,9 @@ public class UnsupportedVetter	extends B
 		printUnsupportedList( unsupportedList );
 		printNotUnderstoodList( notUnderstoodList );
 
-        assertEquals( "vanishedMethodList", 0, vanishedMethodList.size() );
-        assertEquals( "unsupportedList", 0, unsupportedList.size() );
-        assertEquals( "notUnderstoodList", 0, notUnderstoodList.size() );
+    assertEquals( "vanishedMethodList", 0, vanishedMethodList.size() );
+    assertEquals( "unsupportedList", 0, unsupportedList.size() );
+    assertEquals( "notUnderstoodList", 0, notUnderstoodList.size() );
 	}
 
 	//

Modified: db/derby/code/branches/10.12/java/testing/org/apache/derbyTesting/junit/ClassLoaderTestSetup.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.12/java/testing/org/apache/derbyTesting/junit/ClassLoaderTestSetup.java?rev=1741311&r1=1741310&r2=1741311&view=diff
==============================================================================
--- db/derby/code/branches/10.12/java/testing/org/apache/derbyTesting/junit/ClassLoaderTestSetup.java
(original)
+++ db/derby/code/branches/10.12/java/testing/org/apache/derbyTesting/junit/ClassLoaderTestSetup.java
Wed Apr 27 18:42:31 2016
@@ -24,7 +24,6 @@ import java.net.URLClassLoader;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import junit.framework.Test;
-import org.apache.derbyTesting.functionTests.tests.upgradeTests.UpgradeClassLoader;
 
 /**
  * A decorator that changes the context class loader for the current
@@ -45,13 +44,12 @@ public class ClassLoaderTestSetup extend
         super(test);
     }
 
-    private static ClassLoader makeClassLoader(final ClassLoader old) {
+    private static ClassLoader makeClassLoader() {
         return AccessController.doPrivileged(
             new PrivilegedAction<URLClassLoader>() {
                 @Override
                 public URLClassLoader run() {
-                        URL[] jars = ((URLClassLoader)old).getURLs();
-                        return new URLClassLoader(jars, null);
+                    return new URLClassLoader(new URL[0]);
                 }
             });
     }
@@ -61,7 +59,7 @@ public class ClassLoaderTestSetup extend
         super.setUp();
         TestConfiguration.getCurrent().shutdownEngine();
         oldLoader = getThreadLoader();
-        setThreadLoader(makeClassLoader(oldLoader));
+        setThreadLoader(makeClassLoader());
     }
 
     @Override



Mime
View raw message