db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1035164 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting: functionTests/tests/jdbc4/UnsupportedVetter.java functionTests/tests/jdbc4/VerifySignatures.java functionTests/tests/jdbcapi/ClosedObjectTest.java junit/JDBC.java
Date Mon, 15 Nov 2010 07:36:54 GMT
Author: kahatlen
Date: Mon Nov 15 07:36:54 2010
New Revision: 1035164

URL: http://svn.apache.org/viewvc?rev=1035164&view=rev
Log:
DERBY-4869: Disable signature checking tests on platforms that support JDBC 4.1

These tests will fail until the new JDBC 4.1 methods have been
implemented, so silence them for now.

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/VerifySignatures.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ClosedObjectTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/JDBC.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java?rev=1035164&r1=1035163&r2=1035164&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java
Mon Nov 15 07:36:54 2010
@@ -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/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/VerifySignatures.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/VerifySignatures.java?rev=1035164&r1=1035163&r2=1035164&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/VerifySignatures.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/VerifySignatures.java
Mon Nov 15 07:36:54 2010
@@ -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/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ClosedObjectTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ClosedObjectTest.java?rev=1035164&r1=1035163&r2=1035164&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ClosedObjectTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ClosedObjectTest.java
Mon Nov 15 07:36:54 2010
@@ -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/trunk/java/testing/org/apache/derbyTesting/junit/JDBC.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/JDBC.java?rev=1035164&r1=1035163&r2=1035164&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/JDBC.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/junit/JDBC.java Mon Nov 15 07:36:54
2010
@@ -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



Mime
View raw message