db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vnaraya...@apache.org
Subject svn commit: r661574 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DatabaseMetaDataTest.java
Date Fri, 30 May 2008 06:10:25 GMT
Author: vnarayanan
Date: Thu May 29 23:10:25 2008
New Revision: 661574

URL: http://svn.apache.org/viewvc?rev=661574&view=rev
Log:
DERBY-2514

Added a test case testDMDconnClosed() to DatabaseMetaDataTest.java.
testDMDconnClosed is a test case that tests reading of 
DatabaseMetaData obtained earlier, after a connection is 
closed. 

contributor: Svein Erik Løvland 

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DatabaseMetaDataTest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DatabaseMetaDataTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DatabaseMetaDataTest.java?rev=661574&r1=661573&r2=661574&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DatabaseMetaDataTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DatabaseMetaDataTest.java
Thu May 29 23:10:25 2008
@@ -4628,4 +4628,21 @@
     public static int getpc4b() {
         return 4;
     }
+
+    /**
+     * Reading of DatabaseMetaData obtained earlier, after a connection
+     * is closed.
+     */
+    public void testDMDconnClosed() throws SQLException {
+        ResultSet rs_ = getConnection().getMetaData().
+        getTables("%","%","%",null); // should work
+        getConnection().close();
+        try {
+            //should throw exception since the connection is closed
+            rs_.next();
+            fail("No Exception throw when getting metadata.");
+        } catch(SQLException sqle) {
+            assertSQLState("XCL16", sqle);
+        }
+    }
 }



Mime
View raw message