commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1562954 - in /commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources: TestCPDSConnectionFactory.java TestPerUserPoolDataSource.java
Date Thu, 30 Jan 2014 20:45:08 GMT
Author: markt
Date: Thu Jan 30 20:45:08 2014
New Revision: 1562954

URL: http://svn.apache.org/r1562954
Log:
Fix a couple of FindBugs warnings

Modified:
    commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestCPDSConnectionFactory.java
    commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestPerUserPoolDataSource.java

Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestCPDSConnectionFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestCPDSConnectionFactory.java?rev=1562954&r1=1562953&r2=1562954&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestCPDSConnectionFactory.java
(original)
+++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestCPDSConnectionFactory.java
Thu Jan 30 20:45:08 2014
@@ -65,9 +65,9 @@ public class TestCPDSConnectionFactory e
     public void testSharedPoolDSDestroyOnReturn() throws Exception {
        PerUserPoolDataSource ds = new PerUserPoolDataSource();
        ds.setConnectionPoolDataSource(cpds);
-       ds.setPerUserMaxTotal("username",new Integer(10));// Integer.valueOf() is Java 1.5
-       ds.setPerUserMaxWaitMillis("username",new Integer(50));
-       ds.setPerUserMaxIdle("username",new Integer(2));
+       ds.setPerUserMaxTotal("username", Integer.valueOf(10));
+       ds.setPerUserMaxWaitMillis("username", Integer.valueOf(50));
+       ds.setPerUserMaxIdle("username", Integer.valueOf(2));
        Connection conn1 = ds.getConnection("username", "password");
        Connection conn2 = ds.getConnection("username", "password");
        Connection conn3 = ds.getConnection("username", "password");

Modified: commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestPerUserPoolDataSource.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestPerUserPoolDataSource.java?rev=1562954&r1=1562953&r2=1562954&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestPerUserPoolDataSource.java
(original)
+++ commons/proper/dbcp/trunk/src/test/org/apache/commons/dbcp2/datasources/TestPerUserPoolDataSource.java
Thu Jan 30 20:45:08 2014
@@ -70,8 +70,8 @@ public class TestPerUserPoolDataSource e
         tds.setConnectionPoolDataSource(pcds);
         tds.setDefaultMaxTotal(getMaxTotal());
         tds.setDefaultMaxWaitMillis((int)(getMaxWaitMillis()));
-        tds.setPerUserMaxTotal("foo",new Integer(getMaxTotal()));
-        tds.setPerUserMaxWaitMillis("foo",new Integer((int)(getMaxWaitMillis())));
+        tds.setPerUserMaxTotal("foo", Integer.valueOf(getMaxTotal()));
+        tds.setPerUserMaxWaitMillis("foo", Integer.valueOf((int)(getMaxWaitMillis())));
         tds.setDefaultTransactionIsolation(
             Connection.TRANSACTION_READ_COMMITTED);
 
@@ -333,7 +333,7 @@ public class TestPerUserPoolDataSource e
     public void testMaxWaitMillisZero() throws Exception {
         PerUserPoolDataSource tds = (PerUserPoolDataSource) ds;
         tds.setDefaultMaxWaitMillis(0);
-        tds.setPerUserMaxTotal("u1", new Integer(1));
+        tds.setPerUserMaxTotal("u1", Integer.valueOf(1));
         Connection conn = tds.getConnection("u1", "p1");
         try {
             tds.getConnection("u1", "p1");
@@ -348,8 +348,8 @@ public class TestPerUserPoolDataSource e
         PerUserPoolDataSource tds = (PerUserPoolDataSource) ds;
 
         // you need to set maxActive otherwise there is no accounting
-        tds.setPerUserMaxTotal("u1", new Integer(5));
-        tds.setPerUserMaxTotal("u2", new Integer(5));
+        tds.setPerUserMaxTotal("u1", Integer.valueOf(5));
+        tds.setPerUserMaxTotal("u2", Integer.valueOf(5));
 
         assertEquals(0, tds.getNumActive());
         assertEquals(0, tds.getNumActive("u1", "p1"));
@@ -486,7 +486,7 @@ public class TestPerUserPoolDataSource e
         TesterDriver.addUser("jsmith", "password");
 
         PerUserPoolDataSource puds = (PerUserPoolDataSource) ds;
-        puds.setPerUserMaxTotal("jsmith", new Integer(2));
+        puds.setPerUserMaxTotal("jsmith", Integer.valueOf(2));
         String[] users = {"mkh", "hanafey", "jsmith"};
         String password = "password";
         Connection[] c = new Connection[users.length];
@@ -506,7 +506,7 @@ public class TestPerUserPoolDataSource e
         TesterDriver.addUser("jsmith", "password");
 
         PerUserPoolDataSource puds = (PerUserPoolDataSource) ds;
-        puds.setPerUserMaxTotal("jsmith", new Integer(2));
+        puds.setPerUserMaxTotal("jsmith", Integer.valueOf(2));
         String[] users = {"jsmith", "hanafey", "mkh"};
         String password = "password";
         Connection[] c = new Connection[users.length];



Mime
View raw message