commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1547344 - /commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestPoolableConnection.java
Date Tue, 03 Dec 2013 11:22:04 GMT
Author: markt
Date: Tue Dec  3 11:22:03 2013
New Revision: 1547344

URL: http://svn.apache.org/r1547344
Log:
Use generics in this unit test

Modified:
    commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestPoolableConnection.java

Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestPoolableConnection.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestPoolableConnection.java?rev=1547344&r1=1547343&r2=1547344&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestPoolableConnection.java
(original)
+++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestPoolableConnection.java
Tue Dec  3 11:22:03 2013
@@ -40,7 +40,7 @@ public class TestPoolableConnection exte
         return new TestSuite(TestPoolableConnection.class);
     }
 
-    private ObjectPool pool = null;
+    private ObjectPool<PoolableConnection> pool = null;
 
     @Override
     public void setUp() throws Exception {
@@ -50,13 +50,13 @@ public class TestPoolableConnection exte
         factory.setDefaultAutoCommit(true);
         factory.setDefaultReadOnly(true);
 
-        pool = new GenericObjectPool(factory);
+        pool = new GenericObjectPool<>(factory);
         factory.setPool(pool);
     }
 
     public void testConnectionPool() throws Exception {
         // Grab a new connection from the pool
-        Connection c = (Connection)pool.borrowObject();
+        Connection c = pool.borrowObject();
 
         assertNotNull("Connection should be created and should not be null", c);
         assertEquals("There should be exactly one active object in the pool", 1, pool.getNumActive());
@@ -71,7 +71,7 @@ public class TestPoolableConnection exte
     // delegated connection closes itself.
     public void testPoolableConnectionLeak() throws Exception {
         // 'Borrow' a connection from the pool
-        Connection conn = (Connection)pool.borrowObject();
+        Connection conn = pool.borrowObject();
 
         // Now close our innermost delegate, simulating the case where the
         // underlying connection closes itself



Mime
View raw message