diff --git a/src/test/org/apache/commons/lang/mutable/MutableByteTest.java b/src/test/org/apache/commons/lang/mutable/MutableByteTest.java index dca42d30e..480f8c1b7 100755 --- a/src/test/org/apache/commons/lang/mutable/MutableByteTest.java +++ b/src/test/org/apache/commons/lang/mutable/MutableByteTest.java @@ -23,7 +23,7 @@ import junit.textui.TestRunner; /** * JUnit tests. * - * @version $Id: MutableByteTest.java,v 1.2 2004/07/07 23:50:28 scolebourne Exp $ + * @version $Id: MutableByteTest.java,v 1.3 2004/12/26 02:35:47 bayard Exp $ * @see MutableByte */ public class MutableByteTest extends TestCase { @@ -128,6 +128,15 @@ public class MutableByteTest extends TestCase { } 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()); diff --git a/src/test/org/apache/commons/lang/mutable/MutableDoubleTest.java b/src/test/org/apache/commons/lang/mutable/MutableDoubleTest.java index 6d669ff0f..f682a9f62 100755 --- a/src/test/org/apache/commons/lang/mutable/MutableDoubleTest.java +++ b/src/test/org/apache/commons/lang/mutable/MutableDoubleTest.java @@ -23,7 +23,7 @@ import junit.textui.TestRunner; /** * JUnit tests. * - * @version $Id: MutableDoubleTest.java,v 1.2 2004/07/07 23:50:28 scolebourne Exp $ + * @version $Id: MutableDoubleTest.java,v 1.3 2004/12/26 02:35:47 bayard Exp $ * @see MutableDouble */ public class MutableDoubleTest extends TestCase { @@ -139,6 +139,14 @@ public class MutableDoubleTest extends TestCase { } 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()); diff --git a/src/test/org/apache/commons/lang/mutable/MutableFloatTest.java b/src/test/org/apache/commons/lang/mutable/MutableFloatTest.java index 1a38cf06e..dc54b122e 100755 --- a/src/test/org/apache/commons/lang/mutable/MutableFloatTest.java +++ b/src/test/org/apache/commons/lang/mutable/MutableFloatTest.java @@ -23,7 +23,7 @@ import junit.textui.TestRunner; /** * JUnit tests. * - * @version $Id: MutableFloatTest.java,v 1.2 2004/07/07 23:50:28 scolebourne Exp $ + * @version $Id: MutableFloatTest.java,v 1.3 2004/12/26 02:35:47 bayard Exp $ * @see MutableFloat */ public class MutableFloatTest extends TestCase { @@ -139,6 +139,14 @@ public class MutableFloatTest extends TestCase { } 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()); diff --git a/src/test/org/apache/commons/lang/mutable/MutableIntTest.java b/src/test/org/apache/commons/lang/mutable/MutableIntTest.java index 1a788e760..d964139a2 100644 --- a/src/test/org/apache/commons/lang/mutable/MutableIntTest.java +++ b/src/test/org/apache/commons/lang/mutable/MutableIntTest.java @@ -23,7 +23,7 @@ import junit.textui.TestRunner; /** * JUnit tests. * - * @version $Id: MutableIntTest.java,v 1.1 2004/07/07 23:50:28 scolebourne Exp $ + * @version $Id: MutableIntTest.java,v 1.2 2004/12/26 02:35:47 bayard Exp $ * @see MutableInt */ public class MutableIntTest extends TestCase { @@ -128,6 +128,14 @@ public class MutableIntTest extends TestCase { } 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()); diff --git a/src/test/org/apache/commons/lang/mutable/MutableLongTest.java b/src/test/org/apache/commons/lang/mutable/MutableLongTest.java index 5a7894739..06ad37fa5 100755 --- a/src/test/org/apache/commons/lang/mutable/MutableLongTest.java +++ b/src/test/org/apache/commons/lang/mutable/MutableLongTest.java @@ -23,7 +23,7 @@ import junit.textui.TestRunner; /** * JUnit tests. * - * @version $Id: MutableLongTest.java,v 1.2 2004/07/07 23:50:28 scolebourne Exp $ + * @version $Id: MutableLongTest.java,v 1.3 2004/12/26 02:35:47 bayard Exp $ * @see MutableLong */ public class MutableLongTest extends TestCase { @@ -128,6 +128,13 @@ public class MutableLongTest extends TestCase { } 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()); diff --git a/src/test/org/apache/commons/lang/mutable/MutableObjectTest.java b/src/test/org/apache/commons/lang/mutable/MutableObjectTest.java index bf0033d5b..2d5d61aea 100644 --- a/src/test/org/apache/commons/lang/mutable/MutableObjectTest.java +++ b/src/test/org/apache/commons/lang/mutable/MutableObjectTest.java @@ -23,7 +23,7 @@ import junit.textui.TestRunner; /** * JUnit tests. * - * @version $Id: MutableObjectTest.java,v 1.1 2004/07/08 00:02:35 scolebourne Exp $ + * @version $Id: MutableObjectTest.java,v 1.2 2004/12/26 02:35:47 bayard Exp $ * @see MutableShort */ public class MutableObjectTest extends TestCase { @@ -99,6 +99,7 @@ public class MutableObjectTest extends TestCase { public void testToString() { assertEquals("HI", new MutableObject("HI").toString()); assertEquals("10.0", new MutableObject(new Double(10)).toString()); + assertEquals("null", new MutableObject(null).toString()); } } diff --git a/src/test/org/apache/commons/lang/mutable/MutableShortTest.java b/src/test/org/apache/commons/lang/mutable/MutableShortTest.java index 7c21231ff..887ea7c4b 100755 --- a/src/test/org/apache/commons/lang/mutable/MutableShortTest.java +++ b/src/test/org/apache/commons/lang/mutable/MutableShortTest.java @@ -23,7 +23,7 @@ import junit.textui.TestRunner; /** * JUnit tests. * - * @version $Id: MutableShortTest.java,v 1.2 2004/07/07 23:50:28 scolebourne Exp $ + * @version $Id: MutableShortTest.java,v 1.3 2004/12/26 02:35:47 bayard Exp $ * @see MutableShort */ public class MutableShortTest extends TestCase { @@ -128,6 +128,15 @@ public class MutableShortTest extends TestCase { } 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());