commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1735428 - in /commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2: TestBasicDataSource.java TestBasicDataSourceFactory.java
Date Thu, 17 Mar 2016 14:03:16 GMT
Author: markt
Date: Thu Mar 17 14:03:13 2016
New Revision: 1735428

URL: http://svn.apache.org/viewvc?rev=1735428&view=rev
Log:
Fix IDE auto-boxing warnings

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

Modified: commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/TestBasicDataSource.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/TestBasicDataSource.java?rev=1735428&r1=1735427&r2=1735428&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/TestBasicDataSource.java
(original)
+++ commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/TestBasicDataSource.java
Thu Mar 17 14:03:13 2016
@@ -224,7 +224,7 @@ public class TestBasicDataSource extends
     @Test
     public void testNoAccessToUnderlyingConnectionAllowed() throws Exception {
         // default: false
-        assertEquals(false, ds.isAccessToUnderlyingConnectionAllowed());
+        assertFalse(ds.isAccessToUnderlyingConnectionAllowed());
 
         final Connection conn = getConnection();
         Connection dconn = ((DelegatingConnection<?>) conn).getDelegate();
@@ -237,7 +237,7 @@ public class TestBasicDataSource extends
     @Test
     public void testAccessToUnderlyingConnectionAllowed() throws Exception {
         ds.setAccessToUnderlyingConnectionAllowed(true);
-        assertEquals(true, ds.isAccessToUnderlyingConnectionAllowed());
+        assertTrue(ds.isAccessToUnderlyingConnectionAllowed());
 
         final Connection conn = getConnection();
         Connection dconn = ((DelegatingConnection<?>) conn).getDelegate();
@@ -340,23 +340,23 @@ public class TestBasicDataSource extends
     @Test
     public void testSetValidationTestProperties() {
         // defaults
-        assertEquals(true, ds.getTestOnBorrow());
-        assertEquals(false, ds.getTestOnReturn());
-        assertEquals(false, ds.getTestWhileIdle());
+        assertTrue(ds.getTestOnBorrow());
+        assertFalse(ds.getTestOnReturn());
+        assertFalse(ds.getTestWhileIdle());
 
         ds.setTestOnBorrow(true);
         ds.setTestOnReturn(true);
         ds.setTestWhileIdle(true);
-        assertEquals(true, ds.getTestOnBorrow());
-        assertEquals(true, ds.getTestOnReturn());
-        assertEquals(true, ds.getTestWhileIdle());
+        assertTrue(ds.getTestOnBorrow());
+        assertTrue(ds.getTestOnReturn());
+        assertTrue(ds.getTestWhileIdle());
 
         ds.setTestOnBorrow(false);
         ds.setTestOnReturn(false);
         ds.setTestWhileIdle(false);
-        assertEquals(false, ds.getTestOnBorrow());
-        assertEquals(false, ds.getTestOnReturn());
-        assertEquals(false, ds.getTestWhileIdle());
+        assertFalse(ds.getTestOnBorrow());
+        assertFalse(ds.getTestOnReturn());
+        assertFalse(ds.getTestWhileIdle());
     }
 
     @Test
@@ -391,15 +391,15 @@ public class TestBasicDataSource extends
 
         final Connection conn = getConnection();
         assertNotNull(conn);
-        assertEquals(false, conn.getAutoCommit());
+        assertFalse(conn.getAutoCommit());
 
         final Connection dconn = ((DelegatingConnection<?>) conn).getInnermostDelegate();
         assertNotNull(dconn);
-        assertEquals(false, dconn.getAutoCommit());
+        assertFalse(dconn.getAutoCommit());
 
         conn.close();
 
-        assertEquals(true, dconn.getAutoCommit());
+        assertTrue(dconn.getAutoCommit());
     }
 
     @Test
@@ -508,9 +508,9 @@ public class TestBasicDataSource extends
         final Connection conn = ds.getConnection();
         assertNotNull(conn);
 
-        assertEquals(false, ds.getConnectionPool().getTestOnBorrow());
-        assertEquals(false, ds.getConnectionPool().getTestWhileIdle());
-        assertEquals(true, ds.getConnectionPool().getTestOnReturn());
+        assertFalse(ds.getConnectionPool().getTestOnBorrow());
+        assertFalse(ds.getConnectionPool().getTestWhileIdle());
+        assertTrue(ds.getConnectionPool().getTestOnReturn());
     }
 
     /**
@@ -732,7 +732,7 @@ public class TestBasicDataSource extends
         ds.setMaxTotal(8);
         ds.setLifo(true);
         ds.setMaxWaitMillis(-1);
-        
+
         // Threads just borrow and return - validation will trigger close check
         final TestThread testThread1 = new TestThread(1000,0);
         final Thread t1 = new Thread(testThread1);
@@ -740,22 +740,22 @@ public class TestBasicDataSource extends
         final TestThread testThread2 = new TestThread(1000,0);
         final Thread t2 = new Thread(testThread1);
         t2.start();
-        
+
         // Grab and invalidate connections
         for (int i = 0; i < 1000; i++) {
             final Connection conn = ds.getConnection();
             ds.invalidateConnection(conn);
         }
-        
+
         // Make sure borrow threads complete successfully
         t1.join();
         t2.join();
         assertFalse(testThread1.failed());
         assertFalse(testThread2.failed());
-        
+
         ds.close();
     }
-    
+
     /**
      * Make sure setting jmxName to null suppresses JMX registration of connection and statement
pools.
      * JIRA: DBCP-434

Modified: commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/TestBasicDataSourceFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/TestBasicDataSourceFactory.java?rev=1735428&r1=1735427&r2=1735428&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/TestBasicDataSourceFactory.java
(original)
+++ commons/proper/dbcp/trunk/src/test/java/org/apache/commons/dbcp2/TestBasicDataSourceFactory.java
Thu Mar 17 14:03:13 2016
@@ -18,6 +18,7 @@
 package org.apache.commons.dbcp2;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
@@ -158,8 +159,8 @@ public class TestBasicDataSourceFactory
         assertEquals(Boolean.FALSE, ds.getDefaultReadOnly());
         assertEquals(Connection.TRANSACTION_READ_COMMITTED, ds.getDefaultTransactionIsolation());
         assertEquals("test", ds.getDefaultCatalog());
-        assertEquals(true, ds.getTestOnBorrow());
-        assertEquals(false, ds.getTestOnReturn());
+        assertTrue(ds.getTestOnBorrow());
+        assertFalse(ds.getTestOnReturn());
         assertEquals("username", ds.getUsername());
         assertEquals("password", ds.getPassword());
         assertEquals("SELECT DUMMY FROM DUAL", ds.getValidationQuery());
@@ -171,17 +172,17 @@ public class TestBasicDataSourceFactory
         assertEquals(2000, ds.getMinEvictableIdleTimeMillis());
         assertEquals(3000, ds.getSoftMinEvictableIdleTimeMillis());
         assertEquals(2, ds.getNumTestsPerEvictionRun());
-        assertEquals(true, ds.getTestWhileIdle());
-        assertEquals(true, ds.isAccessToUnderlyingConnectionAllowed());
-        assertEquals(true, ds.getRemoveAbandonedOnBorrow());
-        assertEquals(true, ds.getRemoveAbandonedOnMaintenance());
+        assertTrue(ds.getTestWhileIdle());
+        assertTrue(ds.isAccessToUnderlyingConnectionAllowed());
+        assertTrue(ds.getRemoveAbandonedOnBorrow());
+        assertTrue(ds.getRemoveAbandonedOnMaintenance());
         assertEquals(3000, ds.getRemoveAbandonedTimeout());
-        assertEquals(true, ds.getLogAbandoned());
-        assertEquals(true, ds.getAbandonedUsageTracking());
-        assertEquals(true, ds.isPoolPreparedStatements());
+        assertTrue(ds.getLogAbandoned());
+        assertTrue(ds.getAbandonedUsageTracking());
+        assertTrue(ds.isPoolPreparedStatements());
         assertEquals(10, ds.getMaxOpenPreparedStatements());
-        assertEquals(true, ds.getLifo());
-        assertEquals(true, ds.getFastFailValidation());
+        assertTrue(ds.getLifo());
+        assertTrue(ds.getFastFailValidation());
         assertTrue(ds.getDisconnectionSqlCodes().contains("XXX"));
         assertTrue(ds.getDisconnectionSqlCodes().contains("YYY"));
         assertEquals("org.apache.commons.dbcp2:name=test", ds.getJmxName());



Mime
View raw message