You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by dg...@apache.org on 2004/12/19 03:42:24 UTC

cvs commit: jakarta-commons/dbutils/src/test/org/apache/commons/dbutils/wrappers SqlNullCheckedResultSetTest.java

dgraham     2004/12/18 18:42:24

  Modified:    dbutils/src/test/org/apache/commons/dbutils/wrappers
                        SqlNullCheckedResultSetTest.java
  Log:
  Removed unnecessary casts.
  
  Revision  Changes    Path
  1.5       +13 -29    jakarta-commons/dbutils/src/test/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSetTest.java
  
  Index: SqlNullCheckedResultSetTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/dbutils/src/test/org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSetTest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SqlNullCheckedResultSetTest.java	28 Feb 2004 00:12:24 -0000	1.4
  +++ SqlNullCheckedResultSetTest.java	19 Dec 2004 02:42:24 -0000	1.5
  @@ -290,24 +290,21 @@
        * Tests the getFloat implementation.
        */
       public void testGetFloat() throws SQLException {
  -
  -        assertEquals((float) 0, rs.getFloat(1), 0.0);
  +        assertEquals(0, rs.getFloat(1), 0.0);
           assertTrue(rs.wasNull());
  -        assertEquals((float) 0, rs.getFloat("column"), 0.0);
  +        assertEquals(0, rs.getFloat("column"), 0.0);
           assertTrue(rs.wasNull());
           // Set what gets returned to something other than the default
  -        float f = (float) 10.0;
  +        float f = 10;
           rs2.setNullFloat(f);
           assertEquals(f, rs.getFloat(1), 0.0);
           assertEquals(f, rs.getFloat("column"), 0.0);
  -
       }
   
       /**
        * Tests the getInt implementation.
        */
       public void testGetInt() throws SQLException {
  -
           assertEquals(0, rs.getInt(1));
           assertTrue(rs.wasNull());
           assertEquals(0, rs.getInt("column"));
  @@ -317,24 +314,21 @@
           rs2.setNullInt(i);
           assertEquals(i, rs.getInt(1));
           assertEquals(i, rs.getInt("column"));
  -
       }
   
       /**
        * Tests the getLong implementation.
        */
       public void testGetLong() throws SQLException {
  -
  -        assertEquals((long) 0, rs.getLong(1));
  +        assertEquals(0, rs.getLong(1));
           assertTrue(rs.wasNull());
  -        assertEquals((long) 0, rs.getLong("column"));
  +        assertEquals(0, rs.getLong("column"));
           assertTrue(rs.wasNull());
           // Set what gets returned to something other than the default
  -        long l = (long) 10;
  +        long l = 10;
           rs2.setNullLong(l);
           assertEquals(l, rs.getLong(1));
           assertEquals(l, rs.getLong("column"));
  -
       }
   
       /**
  @@ -648,67 +642,58 @@
        * Tests the setNullDouble implementation.
        */
       public void testSetNullDouble() throws SQLException {
  -
  -        assertEquals((double) 0.0, rs2.getNullDouble(), 0.0);
  +        assertEquals(0.0, rs2.getNullDouble(), 0.0);
           // Set what gets returned to something other than the default
  -        double d = (double) 10.0;
  +        double d = 10.0;
           rs2.setNullDouble(d);
           assertEquals(d, rs.getDouble(1), 0.0);
           assertEquals(d, rs.getDouble("column"), 0.0);
  -
       }
   
       /**
        * Tests the setNullFloat implementation.
        */
       public void testSetNullFloat() throws SQLException {
  -
           assertEquals((float) 0.0, rs2.getNullFloat(), 0.0);
           // Set what gets returned to something other than the default
           float f = (float) 10.0;
           rs2.setNullFloat(f);
           assertEquals(f, rs.getFloat(1), 0.0);
           assertEquals(f, rs.getFloat("column"), 0.0);
  -
       }
   
       /**
        * Tests the setNullInt implementation.
        */
       public void testSetNullInt() throws SQLException {
  -
           assertEquals(0, rs2.getNullInt());
  -        assertEquals((int) 0, rs.getInt(1));
  +        assertEquals(0, rs.getInt(1));
           assertTrue(rs.wasNull());
  -        assertEquals((int) 0, rs.getInt("column"));
  +        assertEquals(0, rs.getInt("column"));
           assertTrue(rs.wasNull());
           // Set what gets returned to something other than the default
  -        int i = (int) 10;
  +        int i = 10;
           rs2.setNullInt(i);
           assertEquals(i, rs.getInt(1));
           assertEquals(i, rs.getInt("column"));
  -
       }
   
       /**
        * Tests the setNullLong implementation.
        */
       public void testSetNullLong() throws SQLException {
  -
  -        assertEquals((long) 0, rs2.getNullLong());
  +        assertEquals(0, rs2.getNullLong());
           // Set what gets returned to something other than the default
  -        long l = (long) 10;
  +        long l = 10;
           rs2.setNullLong(l);
           assertEquals(l, rs.getLong(1));
           assertEquals(l, rs.getLong("column"));
  -
       }
   
       /**
        * Tests the setNullObject implementation.
        */
       public void testSetNullObject() throws SQLException {
  -
           assertNull(rs2.getNullObject());
           // Set what gets returned to something other than the default
           Object o = new Object();
  @@ -721,7 +706,6 @@
           assertEquals(o, rs.getObject(1, (Map) null));
           assertNotNull(rs.getObject("column", (Map) null));
           assertEquals(o, rs.getObject("column", (Map) null));
  -
       }
   
       /**
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org