commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject cvs commit: jakarta-commons/lang/src/test/org/apache/commons/lang/mutable MutableByteTest.java MutableDoubleTest.java MutableFloatTest.java MutableIntTest.java MutableLongTest.java MutableObjectTest.java MutableShortTest.java
Date Sun, 26 Dec 2004 02:35:47 GMT
bayard      2004/12/25 18:35:47

  Modified:    lang/src/test/org/apache/commons/lang/mutable
                        MutableByteTest.java MutableDoubleTest.java
                        MutableFloatTest.java MutableIntTest.java
                        MutableLongTest.java MutableObjectTest.java
                        MutableShortTest.java
  Log:
  all non-covered parts of the code are now covered. 100% coverage for a package, while not
in itself a great thing, feels damn good
  
  Revision  Changes    Path
  1.3       +10 -1     jakarta-commons/lang/src/test/org/apache/commons/lang/mutable/MutableByteTest.java
  
  Index: MutableByteTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/lang/src/test/org/apache/commons/lang/mutable/MutableByteTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- MutableByteTest.java	7 Jul 2004 23:50:28 -0000	1.2
  +++ MutableByteTest.java	26 Dec 2004 02:35:47 -0000	1.3
  @@ -128,6 +128,15 @@
           } catch (ClassCastException ex) {}
       }
   
  +    public void testPrimitiveValues() {
  +        MutableByte mutNum = new MutableByte( (byte) 1 );
  +        
  +        assertEquals( 1.0F, mutNum.floatValue(), 0 );
  +        assertEquals( 1.0, mutNum.doubleValue(), 0 );
  +        assertEquals( 1, mutNum.intValue() );
  +        assertEquals( 1L, mutNum.longValue() );
  +    }
  +
       public void testToString() {
           assertEquals("0", new MutableByte((byte) 0).toString());
           assertEquals("10", new MutableByte((byte) 10).toString());
  
  
  
  1.3       +9 -1      jakarta-commons/lang/src/test/org/apache/commons/lang/mutable/MutableDoubleTest.java
  
  Index: MutableDoubleTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/lang/src/test/org/apache/commons/lang/mutable/MutableDoubleTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- MutableDoubleTest.java	7 Jul 2004 23:50:28 -0000	1.2
  +++ MutableDoubleTest.java	26 Dec 2004 02:35:47 -0000	1.3
  @@ -139,6 +139,14 @@
           } catch (ClassCastException ex) {}
       }
   
  +    public void testPrimitiveValues() {
  +        MutableDouble mutNum = new MutableDouble(1.7);
  +        
  +        assertEquals( 1.7F, mutNum.floatValue(), 0 );
  +        assertEquals( 1, mutNum.intValue() );
  +        assertEquals( 1L, mutNum.longValue() );
  +    }
  +
       public void testToString() {
           assertEquals("0.0", new MutableDouble(0d).toString());
           assertEquals("10.0", new MutableDouble(10d).toString());
  
  
  
  1.3       +9 -1      jakarta-commons/lang/src/test/org/apache/commons/lang/mutable/MutableFloatTest.java
  
  Index: MutableFloatTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/lang/src/test/org/apache/commons/lang/mutable/MutableFloatTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- MutableFloatTest.java	7 Jul 2004 23:50:28 -0000	1.2
  +++ MutableFloatTest.java	26 Dec 2004 02:35:47 -0000	1.3
  @@ -139,6 +139,14 @@
           } catch (ClassCastException ex) {}
       }
   
  +    public void testPrimitiveValues() {
  +        MutableFloat mutNum = new MutableFloat(1.7F);
  +        
  +        assertEquals( 1, mutNum.intValue() );
  +        assertEquals( 1.7, mutNum.doubleValue(), 0.00001 );
  +        assertEquals( 1L, mutNum.longValue() );
  +    }
  +
       public void testToString() {
           assertEquals("0.0", new MutableFloat(0f).toString());
           assertEquals("10.0", new MutableFloat(10f).toString());
  
  
  
  1.2       +9 -1      jakarta-commons/lang/src/test/org/apache/commons/lang/mutable/MutableIntTest.java
  
  Index: MutableIntTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/lang/src/test/org/apache/commons/lang/mutable/MutableIntTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MutableIntTest.java	7 Jul 2004 23:50:28 -0000	1.1
  +++ MutableIntTest.java	26 Dec 2004 02:35:47 -0000	1.2
  @@ -128,6 +128,14 @@
           } catch (ClassCastException ex) {}
       }
   
  +    public void testPrimitiveValues() {
  +        MutableInt mutNum = new MutableInt(1);
  +        
  +        assertEquals( 1.0F, mutNum.floatValue(), 0 );
  +        assertEquals( 1.0, mutNum.doubleValue(), 0 );
  +        assertEquals( 1L, mutNum.longValue() );
  +    }
  +
       public void testToString() {
           assertEquals("0", new MutableInt(0).toString());
           assertEquals("10", new MutableInt(10).toString());
  
  
  
  1.3       +8 -1      jakarta-commons/lang/src/test/org/apache/commons/lang/mutable/MutableLongTest.java
  
  Index: MutableLongTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/lang/src/test/org/apache/commons/lang/mutable/MutableLongTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- MutableLongTest.java	7 Jul 2004 23:50:28 -0000	1.2
  +++ MutableLongTest.java	26 Dec 2004 02:35:47 -0000	1.3
  @@ -128,6 +128,13 @@
           } catch (ClassCastException ex) {}
       }
   
  +    public void testPrimitiveValues() {
  +        MutableLong mutNum = new MutableLong(1L);
  +
  +        assertEquals( 1.0F, mutNum.floatValue(), 0 );
  +        assertEquals( 1.0, mutNum.doubleValue(), 0 );
  +    }
  +
       public void testToString() {
           assertEquals("0", new MutableLong(0).toString());
           assertEquals("10", new MutableLong(10).toString());
  
  
  
  1.2       +2 -1      jakarta-commons/lang/src/test/org/apache/commons/lang/mutable/MutableObjectTest.java
  
  Index: MutableObjectTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/lang/src/test/org/apache/commons/lang/mutable/MutableObjectTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MutableObjectTest.java	8 Jul 2004 00:02:35 -0000	1.1
  +++ MutableObjectTest.java	26 Dec 2004 02:35:47 -0000	1.2
  @@ -99,6 +99,7 @@
       public void testToString() {
           assertEquals("HI", new MutableObject("HI").toString());
           assertEquals("10.0", new MutableObject(new Double(10)).toString());
  +        assertEquals("null", new MutableObject(null).toString());
       }
   
   }
  
  
  
  1.3       +10 -1     jakarta-commons/lang/src/test/org/apache/commons/lang/mutable/MutableShortTest.java
  
  Index: MutableShortTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/lang/src/test/org/apache/commons/lang/mutable/MutableShortTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- MutableShortTest.java	7 Jul 2004 23:50:28 -0000	1.2
  +++ MutableShortTest.java	26 Dec 2004 02:35:47 -0000	1.3
  @@ -128,6 +128,15 @@
           } catch (ClassCastException ex) {}
       }
   
  +    public void testPrimitiveValues() {
  +        MutableShort mutNum = new MutableShort( (short) 1 );
  +        
  +        assertEquals( 1.0F, mutNum.floatValue(), 0 );
  +        assertEquals( 1.0, mutNum.doubleValue(), 0 );
  +        assertEquals( 1, mutNum.intValue() );
  +        assertEquals( 1L, mutNum.longValue() );
  +    }
  +
       public void testToString() {
           assertEquals("0", new MutableShort((short) 0).toString());
           assertEquals("10", new MutableShort((short) 10).toString());
  
  
  

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


Mime
View raw message