db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1331262 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/InternationalConnectTest.java
Date Fri, 27 Apr 2012 07:19:36 GMT
Author: kahatlen
Date: Fri Apr 27 07:19:36 2012
New Revision: 1331262

URL: http://svn.apache.org/viewvc?rev=1331262&view=rev
Log:
DERBY-5722: InternationalConnectTest forgets to call super.tearDown()

- Call super.tearDown() from tearDown()

- Close XAConnections and PooledConnections

- Clear reference to ArrayList in tearDown() to allow it to be gc'ed

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

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/InternationalConnectTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/InternationalConnectTest.java?rev=1331262&r1=1331261&r2=1331262&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/InternationalConnectTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/InternationalConnectTest.java
Fri Apr 27 07:19:36 2012
@@ -188,18 +188,21 @@ public class InternationalConnectTest ex
         XAConnection xaconn = ds.getXAConnection();
         Connection conn = xaconn.getConnection();
         conn.close();
+        xaconn.close();
   
         // Chinese user
         J2EEDataSource.setBeanProperty(ds, "user", "\u4e10");
         xaconn = ds.getXAConnection();
         conn = xaconn.getConnection();
         conn.close();
+        xaconn.close();
 
         // Chinese password
         J2EEDataSource.setBeanProperty(ds, "password", "\u4e10");
         xaconn = ds.getXAConnection();
         conn = xaconn.getConnection();
         conn.close();
+        xaconn.close();
         
         /* Add the created database for cleanup by tearDown() */
         databasesForCleanup.add("\u4e10");
@@ -219,18 +222,21 @@ public class InternationalConnectTest ex
         PooledConnection poolConn = ds.getPooledConnection();
         Connection conn = poolConn.getConnection();
         conn.close();
+        poolConn.close();
  
         // Chinese user
         J2EEDataSource.setBeanProperty(ds, "user", "\u4e10");
         poolConn = ds.getPooledConnection();
         conn = poolConn.getConnection();
         conn.close();
+        poolConn.close();
 
         // Chinese password
         J2EEDataSource.setBeanProperty(ds, "password", "\u4e10");
         poolConn= ds.getPooledConnection();
         conn = poolConn.getConnection();
         conn.close();
+        poolConn.close();
         
         /* Add the created database for cleanup by tearDown() */
         databasesForCleanup.add("\u4e10");
@@ -261,7 +267,7 @@ public class InternationalConnectTest ex
         }
     }
 
-    public void tearDown() throws SQLException {
+    public void tearDown() throws Exception {
         /* Iterate through the databases for cleanup and delete them */
         for (int i=0; i<databasesForCleanup.size(); i++) {
             String shutdownUrl = TestConfiguration.getCurrent()
@@ -278,7 +284,9 @@ public class InternationalConnectTest ex
         }
         
         /* Clear the array list as new fixtures will add other databases */
-        databasesForCleanup.clear();
+        databasesForCleanup = null;
+
+        super.tearDown();
     }
     
     public static Test suite() {        



Mime
View raw message