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 km...@apache.org on 2011/03/24 15:30:47 UTC

svn commit: r1084967 - in /db/derby/code/branches/10.6: ./ java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/ java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ java/testing/org/apache/derbyTesting/junit/

Author: kmarsden
Date: Thu Mar 24 14:30:47 2011
New Revision: 1084967

URL: http://svn.apache.org/viewvc?rev=1084967&view=rev
Log:
DERBY-5150 Make test changes required to run Derby regression tests with JDK 1.7 and branches before 10.8

merge 1035164 from trunk to disable signature checking with JDK 1.7 because 
the methods are not implemented.

Contrubuted by Knut Anders Hatlen


Modified:
    db/derby/code/branches/10.6/   (props changed)
    db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java
    db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/VerifySignatures.java
    db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ClosedObjectTest.java
    db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/junit/JDBC.java

Propchange: db/derby/code/branches/10.6/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Mar 24 14:30:47 2011
@@ -1,2 +1,2 @@
-/db/derby/code/trunk:938547,938796,938959,939231,940462,940469,941627,942031,942286,942476,942480,942587,944152,946794,948045,948069,951346,951366,952138,952237,952581,954344,954421,954544,954748,955001,955540,955634,956075,956234,956445,956569,956659,957260,957902,958163,958257,958264,958508,958522,958555,958618,958939,959550,961892,962716,963206,963705,964039,964115,964402,965647,966393,967201,967304,980089,980684,986689,986834,987539,989099,990292,997325,998170,999119,999479,999485,1002291,1002682,1002853,1021426,1024511,1024528,1025615,1025795,1028716,1030043,1033485,1033864,1038514,1040658,1053724,1055169,1062096,1063809,1065061,1067250,1069661,1071886,1078461,1081455
+/db/derby/code/trunk:938547,938796,938959,939231,940462,940469,941627,942031,942286,942476,942480,942587,944152,946794,948045,948069,951346,951366,952138,952237,952581,954344,954421,954544,954748,955001,955540,955634,956075,956234,956445,956569,956659,957260,957902,958163,958257,958264,958508,958522,958555,958618,958939,959550,961892,962716,963206,963705,964039,964115,964402,965647,966393,967201,967304,980089,980684,986689,986834,987539,989099,990292,997325,998170,999119,999479,999485,1002291,1002682,1002853,1021426,1024511,1024528,1025615,1025795,1028716,1030043,1033485,1033864,1035164,1038514,1040658,1053724,1055169,1062096,1063809,1065061,1067250,1069661,1071886,1078461,1081455
 /db/derby/docs/trunk:954344

Modified: db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java?rev=1084967&r1=1084966&r2=1084967&view=diff
==============================================================================
--- db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java (original)
+++ db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java Thu Mar 24 14:30:47 2011
@@ -33,6 +33,7 @@ import java.net.URL;
 import org.apache.derbyTesting.functionTests.util.TestUtil;
 import org.apache.derbyTesting.junit.BaseJDBCTestCase;
 import org.apache.derbyTesting.junit.J2EEDataSource;
+import org.apache.derbyTesting.junit.JDBC;
 import org.apache.derbyTesting.junit.JDBCDataSource;
 import org.apache.derbyTesting.junit.TestConfiguration;
 
@@ -1047,6 +1048,12 @@ public class UnsupportedVetter	extends B
     }
 
     public static Test suite() {
+        if (JDBC.vmSupportsJDBC41()) {
+            // DERBY-4869: The runtime environment supports JDBC 4.1, but
+            // our database drivers don't yet. Disable this test until the
+            // drivers have been updated.
+            return new TestSuite("UnsupportedVetter - Disabled");
+        }
         return TestConfiguration.defaultSuite(UnsupportedVetter.class);
     }
 }

Modified: db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/VerifySignatures.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/VerifySignatures.java?rev=1084967&r1=1084966&r2=1084967&view=diff
==============================================================================
--- db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/VerifySignatures.java (original)
+++ db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/VerifySignatures.java Thu Mar 24 14:30:47 2011
@@ -29,11 +29,11 @@ import java.util.Arrays;
 import java.util.HashSet;
 import java.util.Set;
 import junit.framework.Test;
-import junit.framework.TestCase;
 import junit.framework.TestSuite;
 import org.apache.derbyTesting.functionTests.util.TestUtil;
 import org.apache.derbyTesting.junit.BaseTestCase;
 import org.apache.derbyTesting.junit.J2EEDataSource;
+import org.apache.derbyTesting.junit.JDBC;
 import org.apache.derbyTesting.junit.JDBCDataSource;
 import org.apache.derbyTesting.junit.TestConfiguration;
 
@@ -103,7 +103,12 @@ public class VerifySignatures extends Ba
      * @return a test suite
      */
     public static Test suite()  {
-        
+        if (JDBC.vmSupportsJDBC41()) {
+            // DERBY-4869: The runtime environment supports JDBC 4.1, but
+            // our database drivers don't yet. Disable this test until the
+            // drivers have been updated.
+            return new TestSuite("VerifySignatures - Disabled");
+        }
         return TestConfiguration.defaultSuite(VerifySignatures.class);
     }
     

Modified: db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ClosedObjectTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ClosedObjectTest.java?rev=1084967&r1=1084966&r2=1084967&view=diff
==============================================================================
--- db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ClosedObjectTest.java (original)
+++ db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ClosedObjectTest.java Thu Mar 24 14:30:47 2011
@@ -109,6 +109,12 @@ public class ClosedObjectTest extends Ba
 
     /** Creates a suite with all tests in the class. */
     public static Test suite() {
+        if (JDBC.vmSupportsJDBC41()) {
+            // DERBY-4869: The runtime environment supports JDBC 4.1, but
+            // our database drivers don't yet. Disable this test until the
+            // drivers have been updated.
+            return new TestSuite("ClosedObjectTest - Disabled");
+        }
         TestSuite suite = new TestSuite("ClosedObjectTest suite");
         suite.addTest(baseSuite("ClosedObjectTest:embedded"));
         suite.addTest(TestConfiguration.clientServerDecorator(

Modified: db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/junit/JDBC.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/junit/JDBC.java?rev=1084967&r1=1084966&r2=1084967&view=diff
==============================================================================
--- db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/junit/JDBC.java (original)
+++ db/derby/code/branches/10.6/java/testing/org/apache/derbyTesting/junit/JDBC.java Thu Mar 24 14:30:47 2011
@@ -121,6 +121,22 @@ public class JDBC {
                            = haveClass("java.sql.SQLXML");
 
     /**
+     * Does java.sql.ResultSet implement java.lang.AutoCloseable?
+     * Indicates JDBC 4.1.
+     */
+    private static final boolean HAVE_AUTO_CLOSEABLE_RESULT_SET;
+    static {
+        boolean autoCloseable;
+        try {
+            Class acClass = Class.forName("java.lang.AutoCloseable");
+            autoCloseable = acClass.isAssignableFrom(ResultSet.class);
+        } catch (Throwable t) {
+            autoCloseable = false;
+        }
+        HAVE_AUTO_CLOSEABLE_RESULT_SET = autoCloseable;
+    }
+
+    /**
      * Can we load a specific class, use this to determine JDBC level.
      * @param className Class to attempt load on.
      * @return true if class can be loaded, false otherwise.
@@ -134,6 +150,15 @@ public class JDBC {
         	return false;
         }    	
     }
+
+    /**
+     * Return true if the virtual machine environment supports JDBC 4.1 or
+     * later. JDBC 4.1 is a superset of JDBC 4.0 and of JSR-169.
+     */
+    public static boolean vmSupportsJDBC41() {
+        return vmSupportsJDBC4() && HAVE_AUTO_CLOSEABLE_RESULT_SET;
+    }
+
  	/**
 	 * Return true if the virtual machine environment
 	 * supports JDBC4 or later. JDBC 4 is a superset