commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1205526 - in /commons/proper/dbutils/trunk/src/test/java/org/apache/commons/dbutils/handlers: BeanMapHandlerTest.java KeyedHandlerTest.java ScalarHandlerTest.java
Date Wed, 23 Nov 2011 18:22:15 GMT
Author: sebb
Date: Wed Nov 23 18:22:12 2011
New Revision: 1205526

URL: http://svn.apache.org/viewvc?rev=1205526&view=rev
Log:
Explicit boxing

Modified:
    commons/proper/dbutils/trunk/src/test/java/org/apache/commons/dbutils/handlers/BeanMapHandlerTest.java
    commons/proper/dbutils/trunk/src/test/java/org/apache/commons/dbutils/handlers/KeyedHandlerTest.java
    commons/proper/dbutils/trunk/src/test/java/org/apache/commons/dbutils/handlers/ScalarHandlerTest.java

Modified: commons/proper/dbutils/trunk/src/test/java/org/apache/commons/dbutils/handlers/BeanMapHandlerTest.java
URL: http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/test/java/org/apache/commons/dbutils/handlers/BeanMapHandlerTest.java?rev=1205526&r1=1205525&r2=1205526&view=diff
==============================================================================
--- commons/proper/dbutils/trunk/src/test/java/org/apache/commons/dbutils/handlers/BeanMapHandlerTest.java
(original)
+++ commons/proper/dbutils/trunk/src/test/java/org/apache/commons/dbutils/handlers/BeanMapHandlerTest.java
Wed Nov 23 18:22:12 2011
@@ -42,17 +42,17 @@ public class BeanMapHandlerTest {
 	public void setUp() throws Exception {
 		MockitoAnnotations.initMocks(this);
 
-		when(rs.next()).thenReturn(true, false);
-		when(rs.getObject(1)).thenReturn(23L);
-		when(rs.getObject(2)).thenReturn(23L);
-		when(rs.getObject("id")).thenReturn(23L);
+		when(Boolean.valueOf(rs.next())).thenReturn(Boolean.TRUE, Boolean.FALSE);
+		when(rs.getObject(1)).thenReturn(Long.valueOf(23L));
+		when(rs.getObject(2)).thenReturn(Long.valueOf(23L));
+		when(rs.getObject("id")).thenReturn(Long.valueOf(23L));
 		when(rs.getMetaData()).thenReturn(rsmd);
 		when(rp.toBean(rs, TestBean.class)).thenReturn(new TestBean());
 	}
 
 	private void handle() throws Exception {
 		res = bmh.handle(rs);
-		assertNotNull(res.get(23L));
+		assertNotNull(res.get(Long.valueOf(23L)));
 	}
 	
 	@Test
@@ -81,10 +81,10 @@ public class BeanMapHandlerTest {
 	
 	@Test
 	public void testEmptyResultSet() throws Exception {
-		when(rs.next()).thenReturn(false);
+		when(Boolean.valueOf(rs.next())).thenReturn(Boolean.FALSE);
 		bmh = new BeanMapHandler<Long, TestBean>(TestBean.class);
 		res = bmh.handle(rs);
-		assertNull(res.get(23L));
+		assertNull(res.get(Long.valueOf(23L)));
 	}
 
 }

Modified: commons/proper/dbutils/trunk/src/test/java/org/apache/commons/dbutils/handlers/KeyedHandlerTest.java
URL: http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/test/java/org/apache/commons/dbutils/handlers/KeyedHandlerTest.java?rev=1205526&r1=1205525&r2=1205526&view=diff
==============================================================================
--- commons/proper/dbutils/trunk/src/test/java/org/apache/commons/dbutils/handlers/KeyedHandlerTest.java
(original)
+++ commons/proper/dbutils/trunk/src/test/java/org/apache/commons/dbutils/handlers/KeyedHandlerTest.java
Wed Nov 23 18:22:12 2011
@@ -86,7 +86,7 @@ public class KeyedHandlerTest extends Ba
             assertNotNull(row);
             assertEquals(COLS, row.keySet().size());
         }
-        row = results.get(3);
+        row = results.get(Integer.valueOf(3));
         assertEquals("4", row.get("one"));
         assertEquals("5", row.get("TWO"));
         assertEquals("6", row.get("Three"));

Modified: commons/proper/dbutils/trunk/src/test/java/org/apache/commons/dbutils/handlers/ScalarHandlerTest.java
URL: http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/test/java/org/apache/commons/dbutils/handlers/ScalarHandlerTest.java?rev=1205526&r1=1205525&r2=1205526&view=diff
==============================================================================
--- commons/proper/dbutils/trunk/src/test/java/org/apache/commons/dbutils/handlers/ScalarHandlerTest.java
(original)
+++ commons/proper/dbutils/trunk/src/test/java/org/apache/commons/dbutils/handlers/ScalarHandlerTest.java
Wed Nov 23 18:22:12 2011
@@ -41,7 +41,7 @@ public class ScalarHandlerTest extends B
         ResultSetHandler<Integer> h = new ScalarHandler<Integer>("intTest");
         Object results = h.handle(this.rs);
         assertNotNull(results);
-        assertEquals(1, results);
+        assertEquals(Integer.valueOf(1), results);
     }
 
     public void testEmptyResultSetHandle() throws SQLException {



Mime
View raw message