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 20:25:53 UTC

svn commit: r1085087 - in /db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting: functionTests/tests/jdbc4/UnsupportedVetter.java functionTests/tests/jdbc4/VerifySignatures.java functionTests/tests/jdbcapi/ClosedObjectTest.java junit/JDBC.java

Author: kmarsden
Date: Thu Mar 24 19:25:52 2011
New Revision: 1085087

URL: http://svn.apache.org/viewvc?rev=1085087&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.5/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java
    db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/VerifySignatures.java
    db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ClosedObjectTest.java
    db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/junit/JDBC.java

Modified: db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java?rev=1085087&r1=1085086&r2=1085087&view=diff
==============================================================================
--- db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java (original)
+++ db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java Thu Mar 24 19:25:52 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.5/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/VerifySignatures.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/VerifySignatures.java?rev=1085087&r1=1085086&r2=1085087&view=diff
==============================================================================
--- db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/VerifySignatures.java (original)
+++ db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/VerifySignatures.java Thu Mar 24 19:25:52 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.5/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ClosedObjectTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ClosedObjectTest.java?rev=1085087&r1=1085086&r2=1085087&view=diff
==============================================================================
--- db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ClosedObjectTest.java (original)
+++ db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ClosedObjectTest.java Thu Mar 24 19:25:52 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.5/java/testing/org/apache/derbyTesting/junit/JDBC.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/junit/JDBC.java?rev=1085087&r1=1085086&r2=1085087&view=diff
==============================================================================
--- db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/junit/JDBC.java (original)
+++ db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/junit/JDBC.java Thu Mar 24 19:25:52 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