Return-Path: Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: (qmail 14330 invoked from network); 8 Feb 2011 17:36:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 8 Feb 2011 17:36:25 -0000 Received: (qmail 22175 invoked by uid 500); 8 Feb 2011 17:36:25 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 22112 invoked by uid 500); 8 Feb 2011 17:36:24 -0000 Mailing-List: contact derby-commits-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Derby Development" List-Id: Delivered-To: mailing list derby-commits@db.apache.org Received: (qmail 22100 invoked by uid 99); 8 Feb 2011 17:36:23 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Feb 2011 17:36:23 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Feb 2011 17:36:20 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id C0E462388900; Tue, 8 Feb 2011 17:35:58 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1068489 - in /db/derby/code/trunk/java: client/org/apache/derby/client/am/ client/org/apache/derby/client/net/ testing/org/apache/derbyTesting/functionTests/tests/jdbc4/ testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ Date: Tue, 08 Feb 2011 17:35:58 -0000 To: derby-commits@db.apache.org From: rhillegas@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110208173558.C0E462388900@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: rhillegas Date: Tue Feb 8 17:35:58 2011 New Revision: 1068489 URL: http://svn.apache.org/viewvc?rev=1068489&view=rev Log: DERBY-4869: Uncomment the signature-matching tests on Java 7 now that all of the JDBC 4.1 methods have been added. Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalDatabaseMetaData40.java db/derby/code/trunk/java/client/org/apache/derby/client/net/NetResultSet40.java 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 Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalDatabaseMetaData40.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalDatabaseMetaData40.java?rev=1068489&r1=1068488&r2=1068489&view=diff ============================================================================== --- db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalDatabaseMetaData40.java (original) +++ db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalDatabaseMetaData40.java Tue Feb 8 17:35:58 2011 @@ -106,4 +106,29 @@ public class LogicalDatabaseMetaData40 ).getSQLException(); } } + + ///////////////////////////////////////////////////////////////////////// + // + // JDBC 4.1 - New public methods + // + ///////////////////////////////////////////////////////////////////////// + + /** See DatabaseMetaData javadoc */ + public boolean generatedKeyAlwaysReturned() throws SQLException + { + return ((org.apache.derby.client.am.DatabaseMetaData) getRealMetaDataObject()).generatedKeyAlwaysReturned(); + } + + /** + * See DatabaseMetaData javadoc. Empty ResultSet because Derby does + * not support pseudo columns. + */ + public ResultSet getPseudoColumns + ( String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern ) + throws SQLException + { + return ((org.apache.derby.client.am.DatabaseMetaData) getRealMetaDataObject()).getPseudoColumns + ( catalog, schemaPattern, tableNamePattern, columnNamePattern ); + } + } Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/NetResultSet40.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/net/NetResultSet40.java?rev=1068489&r1=1068488&r2=1068489&view=diff ============================================================================== --- db/derby/code/trunk/java/client/org/apache/derby/client/net/NetResultSet40.java (original) +++ db/derby/code/trunk/java/client/org/apache/derby/client/net/NetResultSet40.java Tue Feb 8 17:35:58 2011 @@ -265,6 +265,12 @@ public class NetResultSet40 extends NetR public T getObject( int columnIndex, Class type ) throws SQLException { + try { + checkForClosedResultSet("getObject"); + } catch (SqlException se) { + throw se.getSQLException(); + } + // closeCloseFilterInputStream() should be called by all of the // more specific methods to which we forward this call 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=1068489&r1=1068488&r2=1068489&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 8 17:35:58 2011 @@ -78,9 +78,11 @@ public class UnsupportedVetter extends B new MD( "createNClob", new Class[] { } ), new MD( "createSQLXML", new Class[] { } ), new MD( "createStruct", new Class[] { String.class, Object[].class } ), + new MD( "getNetworkTimeout", new Class[] { }, JDBC.vmSupportsJDBC41() ), new MD( "getTypeMap", new Class[] { } ), new MD( "prepareStatement", new Class[] { String.class, int[].class } ), new MD( "prepareStatement", new Class[] { String.class, String[].class } ), + new MD( "setNetworkTimeout", new Class[] { java.util.concurrent.Executor.class, int.class }, JDBC.vmSupportsJDBC41() ), new MD( "setTypeMap", new Class[] { Map.class } ), } ), new Exclusions @@ -157,6 +159,7 @@ public class UnsupportedVetter extends B new MD( "getNString", new Class[] { int.class } ), new MD( "getNString", new Class[] { String.class } ), new MD( "getObject", new Class[] { String.class } ), + new MD( "getObject", new Class[] { String.class, Class.class }, JDBC.vmSupportsJDBC41() ), new MD( "getRef", new Class[] { int.class } ), new MD( "getRef", new Class[] { String.class } ), new MD( "getRowId", new Class[] { int.class } ), @@ -345,14 +348,9 @@ public class UnsupportedVetter extends B printUnsupportedList( unsupportedList ); printNotUnderstoodList( notUnderstoodList ); - int actualErrorCount = - vanishedMethodList.size() + - unsupportedList.size() + - notUnderstoodList.size(); - - assertEquals - ( "Unexpected discrepancies.", - 0, actualErrorCount ); + assertEquals( "vanishedMethodList", 0, vanishedMethodList.size() ); + assertEquals( "unsupportedList", 0, unsupportedList.size() ); + assertEquals( "notUnderstoodList", 0, notUnderstoodList.size() ); } // @@ -528,6 +526,8 @@ public class UnsupportedVetter extends B { MD md = mds[ j ]; + if ( !md.requiredAtThisLevel() ) { continue; } + // // If we are strictly enforcing the JDBC standard, // then expose the mandatory methods which we know Derby @@ -882,12 +882,18 @@ public class UnsupportedVetter extends B { private String _methodName; private Class[] _argTypes; + private boolean _requiredAtThisLevel; /** Construct from methodName and argument types. */ public MD( String methodName, Class[] argTypes ) { + this( methodName, argTypes, true ); + } + public MD( String methodName, Class[] argTypes, boolean requiredAtThisLevel ) + { _methodName = methodName; _argTypes = argTypes; + _requiredAtThisLevel = requiredAtThisLevel; } /** Get the name of this method. */ @@ -899,6 +905,9 @@ public class UnsupportedVetter extends B /** Return whether this method is optional */ public boolean isOptional() { return true; } + /** Return whether this method is required at the current JDBC level */ + public boolean requiredAtThisLevel() { return _requiredAtThisLevel; } + public String toString() { StringBuffer buffer = new StringBuffer(); @@ -1048,12 +1057,6 @@ 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=1068489&r1=1068488&r2=1068489&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 Tue Feb 8 17:35:58 2011 @@ -103,12 +103,6 @@ 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=1068489&r1=1068488&r2=1068489&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 Tue Feb 8 17:35:58 2011 @@ -96,8 +96,15 @@ public class ClosedObjectTest extends Ba method_.invoke(object, getNullArguments(method_.getParameterTypes())); - assertFalse("No exception was thrown", - decorator_.expectsException(method_)); + + // so far, only one method is allowed to be called (and is a NOP) + // on a closed JDBC object + + if ( !"public abstract void java.sql.Connection.abort(java.util.concurrent.Executor) throws java.sql.SQLException".equals( method_.toString() ) ) + { + assertFalse("No exception was thrown for method " + method_, + decorator_.expectsException(method_)); + } } catch (InvocationTargetException ite) { try { throw ite.getCause(); @@ -109,12 +116,6 @@ 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( @@ -469,7 +470,8 @@ public class ClosedObjectTest extends Ba String methodString=method.getName(); if (methodString.indexOf("(") > 1 ) methodString=methodString.substring(0, (methodString.length() -2)); - assertTrue("method: " + methodString + ", but message: " + sqle.getMessage(), sqle.getMessage().indexOf(methodString) > 0); + assertTrue("method = " + method.toString() + ", but message: " + sqle.getMessage(), + sqle.getMessage().indexOf(methodString) > 0); // everything is OK, do nothing } else { // unexpected exception