commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pste...@apache.org
Subject svn commit: r449577 - /jakarta/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestConnectionPool.java
Date Mon, 25 Sep 2006 05:17:03 GMT
Author: psteitz
Date: Sun Sep 24 22:17:02 2006
New Revision: 449577

URL: http://svn.apache.org/viewvc?view=rev&rev=449577
Log:
Added test case showing that the fix for DBCP-198 resolved DBCP-128 as well.

Modified:
    jakarta/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestConnectionPool.java

Modified: jakarta/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestConnectionPool.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestConnectionPool.java?view=diff&rev=449577&r1=449576&r2=449577
==============================================================================
--- jakarta/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestConnectionPool.java
(original)
+++ jakarta/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp/TestConnectionPool.java
Sun Sep 24 22:17:02 2006
@@ -21,6 +21,7 @@
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Statement;
+import java.util.Hashtable;
 import java.util.Stack;
 
 import junit.framework.TestCase;
@@ -384,6 +385,21 @@
         for (int i = 0; i < c.length; i++) {
             c[i].close();
         }
+    }
+    
+    /**
+     * DBCP-128: BasicDataSource.getConnection()
+     * Connections don't work as hashtable keys 
+     */
+    public void testHashing() throws Exception {
+        Connection con = getConnection();
+        Hashtable hash = new Hashtable();
+        hash.put(con, "test");
+        assertEquals("test", hash.get(con));
+        assertTrue(hash.containsKey(con));
+        assertTrue(hash.contains("test")); 
+        hash.clear();
+        con.close();
     }
 
     public void testThreaded() {



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message