db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r1464120 - in /db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting: functionTests/tests/jdbc4/UnsupportedVetter.java junit/JDBC.java
Date Wed, 03 Apr 2013 17:43:40 GMT
Author: rhillegas
Date: Wed Apr  3 17:43:40 2013
New Revision: 1464120

URL: http://svn.apache.org/r1464120
Log:
DERBY-6000: Disable UnsupportedVetter test when run on 10.8 on Java 8.

Modified:
    db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java
    db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/junit/JDBC.java

Modified: db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java?rev=1464120&r1=1464119&r2=1464120&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java
(original)
+++ db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java
Wed Apr  3 17:43:40 2013
@@ -330,6 +330,12 @@ public class UnsupportedVetter	extends B
 	{
         getTestConfiguration().setVerbosity( true );
 
+        println( "Supports JDBC 4.2 = " + JDBC. vmSupportsJDBC42() );
+
+        // this test will fail if run on Java 8 or higher because the JDBC 4.2
+        // support does not exist on 10.9 and earlier
+        if ( JDBC.vmSupportsJDBC42() ) { return; }
+
 		HashSet<String>	vanishedMethodList = new HashSet<String>();
 		HashSet<String>	unsupportedList = new HashSet<String>();
 		HashSet<String>	notUnderstoodList = new HashSet<String>();

Modified: db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/junit/JDBC.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/junit/JDBC.java?rev=1464120&r1=1464119&r2=1464120&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/junit/JDBC.java (original)
+++ db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/junit/JDBC.java Wed Apr
 3 17:43:40 2013
@@ -136,6 +136,17 @@ public class JDBC {
         HAVE_AUTO_CLOSEABLE_RESULT_SET = autoCloseable;
     }
 
+    private static final boolean HAVE_SQLTYPE;
+    static {
+        boolean ok = false;
+        try {
+            Class.forName("java.sql.SQLType");
+            ok = true;
+        } catch (Throwable t) {
+        }
+        HAVE_SQLTYPE = ok;
+    }
+    
     /**
      * Can we load a specific class, use this to determine JDBC level.
      * @param className Class to attempt load on.
@@ -152,6 +163,14 @@ public class JDBC {
     }
 
     /**
+     * Return true if the virtual machine environment supports JDBC 4.2 or
+     * later.
+     */
+    public static boolean vmSupportsJDBC42() {
+        return vmSupportsJDBC41() && HAVE_SQLTYPE;
+    }
+
+    /**
      * 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.
      */



Mime
View raw message