commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1171779 [2/2] - in /commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils: ./ handlers/ wrappers/
Date Fri, 16 Sep 2011 21:01:31 GMT
Modified: commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/handlers/MapListHandlerTest.java
URL: http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/handlers/MapListHandlerTest.java?rev=1171779&r1=1171778&r2=1171779&view=diff
==============================================================================
--- commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/handlers/MapListHandlerTest.java
(original)
+++ commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/handlers/MapListHandlerTest.java
Fri Sep 16 21:01:30 2011
@@ -29,22 +29,22 @@ import org.apache.commons.dbutils.Result
  */
 public class MapListHandlerTest extends BaseTestCase {
 
-	public void testHandle() throws SQLException {
-		ResultSetHandler<List<Map<String,Object>>> h = new MapListHandler();
-		List<Map<String,Object>> results = h.handle(this.rs);
+    public void testHandle() throws SQLException {
+        ResultSetHandler<List<Map<String,Object>>> h = new MapListHandler();
+        List<Map<String,Object>> results = h.handle(this.rs);
 
-		assertNotNull(results);
-		assertEquals(ROWS, results.size());
+        assertNotNull(results);
+        assertEquals(ROWS, results.size());
 
-		Iterator<Map<String,Object>> iter = results.iterator();
-		Map<String,Object> row = null;
+        Iterator<Map<String,Object>> iter = results.iterator();
+        Map<String,Object> row = null;
         assertTrue(iter.hasNext());
         row = iter.next();
         assertEquals(COLS, row.keySet().size());
         assertEquals("1", row.get("one"));
         assertEquals("2", row.get("TWO"));
         assertEquals("3", row.get("Three"));
-            
+
         assertTrue(iter.hasNext());
         row = iter.next();
         assertEquals(COLS, row.keySet().size());
@@ -52,16 +52,16 @@ public class MapListHandlerTest extends 
         assertEquals("4", row.get("one"));
         assertEquals("5", row.get("TWO"));
         assertEquals("6", row.get("Three"));
-            
+
         assertFalse(iter.hasNext());
-	}
+    }
 
-	public void testEmptyResultSetHandle() throws SQLException {
-		ResultSetHandler<List<Map<String,Object>>> h = new MapListHandler();
-		List<Map<String,Object>> results = h.handle(this.emptyResultSet);
-
-		assertNotNull(results);
-		assertTrue(results.isEmpty());
-	}
+    public void testEmptyResultSetHandle() throws SQLException {
+        ResultSetHandler<List<Map<String,Object>>> h = new MapListHandler();
+        List<Map<String,Object>> results = h.handle(this.emptyResultSet);
+
+        assertNotNull(results);
+        assertTrue(results.isEmpty());
+    }
 
 }

Modified: commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSetTest.java
URL: http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSetTest.java?rev=1171779&r1=1171778&r2=1171779&view=diff
==============================================================================
--- commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSetTest.java
(original)
+++ commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSetTest.java
Fri Sep 16 21:01:30 2011
@@ -195,17 +195,17 @@ public class SqlNullCheckedResultSetTest
         assertArrayEquals(b, rs.getBytes("column"));
 
     }
-    
+
     private static void assertArrayEquals(byte[] expected, byte[] actual) {
-    	if (expected == actual) return;
-    	if (expected.length != actual.length) {
-    		failNotEquals(null, Arrays.toString(expected), Arrays.toString(actual));
-    	}
-    	for (int i = 0; i < expected.length; i++) {
-    		byte expectedItem = expected[i];
-    		byte actualItem = actual[i];
-    		assertEquals("Array not equal at index " + i, expectedItem, actualItem);
-    	}
+        if (expected == actual) return;
+        if (expected.length != actual.length) {
+            failNotEquals(null, Arrays.toString(expected), Arrays.toString(actual));
+        }
+        for (int i = 0; i < expected.length; i++) {
+            byte expectedItem = expected[i];
+            byte actualItem = actual[i];
+            assertEquals("Array not equal at index " + i, expectedItem, actualItem);
+        }
     }
 
     /**
@@ -464,22 +464,22 @@ public class SqlNullCheckedResultSetTest
         assertNotNull(rs.getTimestamp("column", Calendar.getInstance()));
         assertEquals(ts, rs.getTimestamp("column", Calendar.getInstance()));
     }
-    
+
     /**
      * Tests the getURL and setNullURL implementations.
      *
      * Uses reflection to allow for building under JDK 1.3.
      */
-    public void testURL() throws SQLException, MalformedURLException, 
-            IllegalAccessException, IllegalArgumentException, 
-            java.lang.reflect.InvocationTargetException 
+    public void testURL() throws SQLException, MalformedURLException,
+            IllegalAccessException, IllegalArgumentException,
+            java.lang.reflect.InvocationTargetException
     {
         Method getUrlInt = null;
         Method getUrlString = null;
         try {
-            getUrlInt = ResultSet.class.getMethod("getURL", 
+            getUrlInt = ResultSet.class.getMethod("getURL",
                         new Class[] { Integer.TYPE } );
-            getUrlString = ResultSet.class.getMethod("getURL", 
+            getUrlString = ResultSet.class.getMethod("getURL",
                            new Class[] { String.class } );
         } catch(NoSuchMethodException e) {
             // ignore
@@ -487,18 +487,18 @@ public class SqlNullCheckedResultSetTest
             // ignore
         }
         if (getUrlInt != null && getUrlString != null) {
-            assertEquals(null, getUrlInt.invoke(rs, 
+            assertEquals(null, getUrlInt.invoke(rs,
                          new Object[] { Integer.valueOf(1) } ) );
             assertTrue(rs.wasNull());
-            assertEquals(null, getUrlString.invoke(rs, 
+            assertEquals(null, getUrlString.invoke(rs,
                          new Object[] { "column" } ) );
             assertTrue(rs.wasNull());
             // Set what gets returned to something other than the default
             URL u = new URL("http://www.apache.org");
             rs2.setNullURL(u);
-            assertEquals(u, getUrlInt.invoke(rs, 
+            assertEquals(u, getUrlInt.invoke(rs,
                          new Object[] { Integer.valueOf(1) } ) );
-            assertEquals(u, getUrlString.invoke(rs, 
+            assertEquals(u, getUrlString.invoke(rs,
                          new Object[] { "column" } ) );
         }
     }
@@ -810,7 +810,7 @@ public class SqlNullCheckedResultSetTest
         assertNotNull(rs.getTimestamp("column", Calendar.getInstance()));
         assertEquals(ts, rs.getTimestamp("column", Calendar.getInstance()));
     }
-    
+
 }
 
 class SqlNullUncheckedMockResultSet implements InvocationHandler {
@@ -894,7 +894,7 @@ class SqlNullCheckedResultSetMockBlob im
     }
 
     public void free() throws SQLException {
-      
+
     }
 
     public InputStream getBinaryStream(long pos, long length) throws SQLException {



Mime
View raw message