db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1741324 - in /db/derby/code/branches/10.11: ./ 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 20:02:44 GMT
Author: kahatlen
Date: Wed Apr 27 20:02:44 2016
New Revision: 1741324

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

Merged revision 1741311 from the 10.12 branch.

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

Propchange: db/derby/code/branches/10.11/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Apr 27 20:02:44 2016
@@ -1,4 +1,5 @@
+/db/derby/code/branches/10.12:1741311
 /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,1614963,1615140,1615565,1615821,1615982,1616111-1616112,1616163,1616299,1616332,1616334-1616335,1616365,1616523,1617641,1617737,1618088,1618114,1618544,1618821,1618859,1618881,1618930,1618955,1619154,1619456,1620378-1620379,1620385,1620539,1620608,1620961,1620964,1621215,1622631,1625904,1626094,1626825,1627671,1627851,1628008,1628960,1629099,1629192,1629251,1630598,1636509,1636668,1636798,1639804
+/db/derby/code/trunk:1614963,1615140,1615565,1615821,1615982,1616111-1616112,1616163,1616299,1616332,1616334-1616335,1616365,1616523,1617641,1617737,1618088,1618114,1618544,1618821,1618859,1618881,1618930,1618955,1619154,1619456,1620378-1620379,1620385,1620539,1620608,1620961,1620964,1621215,1622631,1625904,1626094,1626825,1627671,1627851,1628008,1628960,1629099,1629192,1629251,1630598,1636509,1636668,1636798,1639804,1725139,1737188-1737189

Modified: db/derby/code/branches/10.11/java/testing/org/apache/derbyTesting/functionTests/harness/JavaVersionHolder.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.11/java/testing/org/apache/derbyTesting/functionTests/harness/JavaVersionHolder.java?rev=1741324&r1=1741323&r2=1741324&view=diff
==============================================================================
--- db/derby/code/branches/10.11/java/testing/org/apache/derbyTesting/functionTests/harness/JavaVersionHolder.java
(original)
+++ db/derby/code/branches/10.11/java/testing/org/apache/derbyTesting/functionTests/harness/JavaVersionHolder.java
Wed Apr 27 20:02:44 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.11/java/testing/org/apache/derbyTesting/functionTests/harness/Sed.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.11/java/testing/org/apache/derbyTesting/functionTests/harness/Sed.java?rev=1741324&r1=1741323&r2=1741324&view=diff
==============================================================================
--- db/derby/code/branches/10.11/java/testing/org/apache/derbyTesting/functionTests/harness/Sed.java
(original)
+++ db/derby/code/branches/10.11/java/testing/org/apache/derbyTesting/functionTests/harness/Sed.java
Wed Apr 27 20:02:44 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.11/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.11/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java?rev=1741324&r1=1741323&r2=1741324&view=diff
==============================================================================
--- db/derby/code/branches/10.11/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java
(original)
+++ db/derby/code/branches/10.11/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java
Wed Apr 27 20:02:44 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.11/java/testing/org/apache/derbyTesting/junit/ClassLoaderTestSetup.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.11/java/testing/org/apache/derbyTesting/junit/ClassLoaderTestSetup.java?rev=1741324&r1=1741323&r2=1741324&view=diff
==============================================================================
--- db/derby/code/branches/10.11/java/testing/org/apache/derbyTesting/junit/ClassLoaderTestSetup.java
(original)
+++ db/derby/code/branches/10.11/java/testing/org/apache/derbyTesting/junit/ClassLoaderTestSetup.java
Wed Apr 27 20:02:44 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