db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r1445235 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java
Date Tue, 12 Feb 2013 16:20:55 GMT
Author: rhillegas
Date: Tue Feb 12 16:20:55 2013
New Revision: 1445235

URL: http://svn.apache.org/r1445235
Log:
DERBY-6000: Exclude deliberately unimplemented CallableStatement.registerOutParameter() overloads
from the checks performed by the UnsupportedVetter test on Java 8.

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.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=1445235&r1=1445234&r2=1445235&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
Tue Feb 12 16:20:55 2013
@@ -111,7 +111,7 @@ public class UnsupportedVetter	extends B
 						new MD( "setNClob", new Class[] { int.class, java.io.Reader.class, long.class } ),
 						new MD( "setNString", new Class[] { int.class, String.class } ),
 						new MD( "setRef", new Class[] { int.class, Ref.class } ),
-						new MD( "setRowId", new Class[] { int.class, RowId.class } ),
+                        new MD( "setRowId", new Class[] { int.class, RowId.class } ),
 						new MD( "setSQLXML", new Class[] { int.class, SQLXML.class } ),
 					    new MD( "setURL", new Class[] { int.class, URL.class } ),
 					    new MD( "setNull", new Class[] { int.class, int.class, String.class } ),
@@ -178,6 +178,9 @@ public class UnsupportedVetter	extends B
 						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( "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
} ),
@@ -298,6 +301,30 @@ public class UnsupportedVetter	extends B
 
 		};
 
+    //
+    // Make an MD if the JVM level supports the indicated classes.
+    // Returns null if the JVM doesn't.
+    //
+    private static  MD  makeMD
+        ( String methodName, String[] argClassNames, boolean requiredAtThisLevel )
+    {
+        // return null if the class names can't be resolved
+        int     count = argClassNames.length;
+        Class[] argTypes = new Class[ count ];
+
+        try {
+            for ( int i = 0; i < count; i++ )
+            {
+                String  className = argClassNames[ i ];
+                if ( "int".equals( className ) ) { argTypes[ i ] = int.class; }
+                else { argTypes[ i ] = Class.forName( argClassNames[ i ] ); }
+            }
+        }
+        catch (Exception e) { return null; }
+
+        return new MD( methodName, argTypes, requiredAtThisLevel );
+    }
+    
 	//
 	// This is the Hashtable where we keep the exclusions.
 	//
@@ -526,6 +553,7 @@ public class UnsupportedVetter	extends B
 			{
 				MD		md = mds[ j ];
 
+                if ( md == null ) { continue; }
                 if ( !md.requiredAtThisLevel() ) { continue; }
 
 				//



Mime
View raw message