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 rh...@apache.org on 2013/04/03 19:33:11 UTC

svn commit: r1464117 - in /db/derby/code/branches/10.9: ./ java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java java/testing/org/apache/derbyTesting/junit/JDBC.java

Author: rhillegas
Date: Wed Apr  3 17:33:11 2013
New Revision: 1464117

URL: http://svn.apache.org/r1464117
Log:
DERBY-6000: Disable the UnsupportedVetter test for 10.9 on Java 8.

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

Propchange: db/derby/code/branches/10.9/
------------------------------------------------------------------------------
  Merged /db/derby/code/trunk:r1445235,1464103

Modified: db/derby/code/branches/10.9/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.9/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java?rev=1464117&r1=1464116&r2=1464117&view=diff
==============================================================================
--- db/derby/code/branches/10.9/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java (original)
+++ db/derby/code/branches/10.9/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java Wed Apr  3 17:33:11 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.9/java/testing/org/apache/derbyTesting/junit/JDBC.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.9/java/testing/org/apache/derbyTesting/junit/JDBC.java?rev=1464117&r1=1464116&r2=1464117&view=diff
==============================================================================
--- db/derby/code/branches/10.9/java/testing/org/apache/derbyTesting/junit/JDBC.java (original)
+++ db/derby/code/branches/10.9/java/testing/org/apache/derbyTesting/junit/JDBC.java Wed Apr  3 17:33:11 2013
@@ -128,6 +128,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.
@@ -144,6 +155,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.
      */