db-derby-commits mailing list archives

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

URL: http://svn.apache.org/r1464103
Log:
DERBY-6000: Fix UnsupportedVetter failures when 10.9 jars run on Java 8.

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.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=1464103&r1=1464102&r2=1464103&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
Wed Apr  3 16:53:17 2013
@@ -174,13 +174,13 @@ public class UnsupportedVetter	extends B
 					new MD( "getTimestamp", new Class[] { String.class, java.util.Calendar.class } ),
 					new MD( "getURL", new Class[] { int.class } ),
 					new MD( "getURL", new Class[] { String.class } ),
-						new MD( "registerOutParameter", new Class[] { String.class, int.class } ),
-						new MD( "registerOutParameter", new Class[] { String.class, int.class, int.class }
),
-						new MD( "registerOutParameter", new Class[] { String.class, int.class, String.class
} ),
-						new MD( "registerOutParameter", new Class[] { int.class, int.class, String.class }
),
-                        makeMD( "registerOutParameter", new String[] { "java.lang.String",
"java.sql.SQLType" }, true ),
-                        makeMD( "registerOutParameter", new String[] { "java.lang.String",
"java.sql.SQLType", "int" }, true ),
-                        makeMD( "registerOutParameter", new String[] { "java.lang.String",
"java.sql.SQLType", "java.lang.String" }, true ),
+                    new MD( "registerOutParameter", new Class[] { String.class, int.class
} ),
+                    new MD( "registerOutParameter", new Class[] { String.class, int.class,
int.class } ),
+                    new MD( "registerOutParameter", new Class[] { String.class, int.class,
String.class } ),
+                    new MD( "registerOutParameter", new Class[] { int.class, int.class, String.class
} ),
+                    makeMD( "registerOutParameter", new String[] { "java.lang.String", "java.sql.SQLType"
}, JDBC.vmSupportsJDBC42() ),
+                    makeMD( "registerOutParameter", new String[] { "java.lang.String", "java.sql.SQLType",
"int" }, JDBC.vmSupportsJDBC42() ),
+                    makeMD( "registerOutParameter", new String[] { "java.lang.String", "java.sql.SQLType",
"java.lang.String" }, JDBC.vmSupportsJDBC42() ),
 						new MD( "setArray", new Class[] { int.class, java.sql.Array.class } ),
 						new MD( "setAsciiStream", new Class[] { String.class, java.io.InputStream.class } ),
 						new MD( "setAsciiStream", new Class[] { String.class, java.io.InputStream.class, int.class
} ),
@@ -357,6 +357,8 @@ public class UnsupportedVetter	extends B
 	{
         getTestConfiguration().setVerbosity( true );
 
+        println( "Supports JDBC 4.2 = " + JDBC. vmSupportsJDBC42() );
+
 		HashSet<String>	vanishedMethodList = new HashSet<String>();
 		HashSet<String>	unsupportedList = new HashSet<String>();
 		HashSet<String>	notUnderstoodList = new HashSet<String>();

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=1464103&r1=1464102&r2=1464103&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 Wed Apr  3 16:53:17
2013
@@ -139,6 +139,17 @@ public class JDBC {
         HAVE_REFERENCEABLE = ok;
     }
 
+    private static final boolean HAVE_SQLTYPE;
+    static {
+        boolean ok = false;
+        try {
+            Class.forName("java.sql.SQLType");
+            ok = true;
+        } catch (Throwable t) {
+        }
+        HAVE_SQLTYPE = ok;
+    }
+    
     /**
      * Is javax.management.MBeanServer available? Indicates whether the
      * JVM supports the Java Management Extensions (JMX).
@@ -162,6 +173,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