commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1537586 - in /commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2: TestDelegatingConnection.java TestPStmtPooling.java TestPoolingDriver.java datasources/TestKeyedCPDSConnectionFactory.java
Date Thu, 31 Oct 2013 19:06:11 GMT
Author: sebb
Date: Thu Oct 31 19:06:10 2013
New Revision: 1537586

URL: http://svn.apache.org/r1537586
Log:
Generics fixes

Modified:
    commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestDelegatingConnection.java
    commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestPStmtPooling.java
    commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestPoolingDriver.java
    commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestKeyedCPDSConnectionFactory.java

Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestDelegatingConnection.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestDelegatingConnection.java?rev=1537586&r1=1537585&r2=1537586&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestDelegatingConnection.java
(original)
+++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestDelegatingConnection.java
Thu Oct 31 19:06:10 2013
@@ -121,7 +121,7 @@ public class TestDelegatingConnection ex
 
         try {
             PoolingConnection pc = new PoolingConnection(delegateConn2);
-            pc.setStatementPool(new GenericKeyedObjectPool(pc));
+            pc.setStatementPool(new GenericKeyedObjectPool<>(pc));
             conn = new DelegatingConnection(pc);
             pc.close();
             conn.close();

Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestPStmtPooling.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestPStmtPooling.java?rev=1537586&r1=1537585&r2=1537586&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestPStmtPooling.java (original)
+++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestPStmtPooling.java Thu
Oct 31 19:06:10 2013
@@ -55,9 +55,9 @@ public class TestPStmtPooling extends Te
         pcf.setPoolStatements(true);
         pcf.setDefaultReadOnly(false);
         pcf.setDefaultAutoCommit(true);
-        ObjectPool connPool = new GenericObjectPool(pcf);
+        ObjectPool<? extends Connection> connPool = new GenericObjectPool<>(pcf);
 
-        DataSource ds = new PoolingDataSource(connPool);
+        DataSource ds = new PoolingDataSource((ObjectPool<Connection>) connPool);
 
         Connection conn = ds.getConnection();
         Statement stmt1 = conn.prepareStatement("select 1 from dual");

Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestPoolingDriver.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestPoolingDriver.java?rev=1537586&r1=1537585&r2=1537586&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestPoolingDriver.java (original)
+++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/TestPoolingDriver.java Thu
Oct 31 19:06:10 2013
@@ -187,7 +187,7 @@ public class TestPoolingDriver extends T
         Connection conn = DriverManager.getConnection("jdbc:apache:commons:dbcp:test");
         assertNotNull(conn);
 
-        ObjectPool pool = driver.getConnectionPool("test");
+        ObjectPool<?> pool = driver.getConnectionPool("test");
         assertEquals(1, pool.getNumActive());
         assertEquals(0, pool.getNumIdle());
 

Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestKeyedCPDSConnectionFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestKeyedCPDSConnectionFactory.java?rev=1537586&r1=1537585&r2=1537586&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestKeyedCPDSConnectionFactory.java
(original)
+++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestKeyedCPDSConnectionFactory.java
Thu Oct 31 19:06:10 2013
@@ -92,16 +92,16 @@ public class TestKeyedCPDSConnectionFact
         UserPassKey key = new UserPassKey("username", "password");
         KeyedCPDSConnectionFactory factory = 
             new KeyedCPDSConnectionFactory(cpds, null, false);
-        KeyedObjectPool pool = new GenericKeyedObjectPool(factory);
+        KeyedObjectPool<UserPassKey, PooledConnectionAndInfo> pool = new GenericKeyedObjectPool<>(factory);
         factory.setPool(pool);
         
         // Checkout a pair of connections
         PooledConnection pcon1 = 
-            ((PooledConnectionAndInfo) pool.borrowObject(key))
+            pool.borrowObject(key)
                 .getPooledConnection();
         Connection con1 = pcon1.getConnection();
         PooledConnection pcon2 = 
-            ((PooledConnectionAndInfo) pool.borrowObject(key))
+            pool.borrowObject(key)
                 .getPooledConnection();
         assertEquals(2, pool.getNumActive(key));
         assertEquals(0, pool.getNumIdle(key));
@@ -125,7 +125,7 @@ public class TestKeyedCPDSConnectionFact
         // Ask for another connection - should trigger makeObject, which causes
         // cleanup, removing listeners.
         PooledConnection pcon3 = 
-            ((PooledConnectionAndInfo) pool.borrowObject(key))
+            pool.borrowObject(key)
                 .getPooledConnection();
         assertTrue(!pcon3.equals(pcon1)); // better not get baddie back
         assertTrue(!pc.getListeners().contains(factory)); // verify cleanup



Mime
View raw message