commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pste...@apache.org
Subject svn commit: r891521 - /commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/managed/TestBasicManagedDataSource.java
Date Thu, 17 Dec 2009 02:22:07 GMT
Author: psteitz
Date: Thu Dec 17 02:22:07 2009
New Revision: 891521

URL: http://svn.apache.org/viewvc?rev=891521&view=rev
Log:
Eliminated redundant connection registration in testReallyClose().

Modified:
    commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/managed/TestBasicManagedDataSource.java

Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/managed/TestBasicManagedDataSource.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/managed/TestBasicManagedDataSource.java?rev=891521&r1=891520&r2=891521&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/managed/TestBasicManagedDataSource.java
(original)
+++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/managed/TestBasicManagedDataSource.java
Thu Dec 17 02:22:07 2009
@@ -60,13 +60,12 @@
         basicManagedDataSource.setUsername("username");
         basicManagedDataSource.setPassword("password");
         basicManagedDataSource.setMaxIdle(1); 
-        // Create and register a connection
+        // Create two connections 
         ManagedConnection conn = (ManagedConnection) basicManagedDataSource.getConnection();
-        basicManagedDataSource.getTransactionRegistry().registerConnection(conn, new LocalXAResource(conn));
-        // Create another connection and return it to the pool
+        assertNotNull(basicManagedDataSource.getTransactionRegistry().getXAResource(conn));
         ManagedConnection conn2 = (ManagedConnection) basicManagedDataSource.getConnection();
-        conn2.close();
-        conn.close(); // No room at the inn - this will trigger reallyClose(), which should
unregister
+        conn2.close(); // Return one connection to the pool
+        conn.close();  // No room at the inn - this will trigger reallyClose(), which should
unregister
         try {
             basicManagedDataSource.getTransactionRegistry().getXAResource(conn);
             fail("Expecting SQLException - XAResources orphaned");



Mime
View raw message