testing all primitive value methods, including the ones not implemented in the MutableXxx class so that we can tell when Sun change the wrapper implementations
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@151305 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2c13ceefd8
commit
df21ea512e
|
@ -23,7 +23,7 @@ import junit.textui.TestRunner;
|
|||
/**
|
||||
* JUnit tests.
|
||||
*
|
||||
* @version $Id: MutableByteTest.java,v 1.3 2004/12/26 02:35:47 bayard Exp $
|
||||
* @version $Id$
|
||||
* @see MutableByte
|
||||
*/
|
||||
public class MutableByteTest extends TestCase {
|
||||
|
@ -133,6 +133,8 @@ public class MutableByteTest extends TestCase {
|
|||
|
||||
assertEquals( 1.0F, mutNum.floatValue(), 0 );
|
||||
assertEquals( 1.0, mutNum.doubleValue(), 0 );
|
||||
assertEquals( (byte) 1, mutNum.byteValue() );
|
||||
assertEquals( (short) 1, mutNum.shortValue() );
|
||||
assertEquals( 1, mutNum.intValue() );
|
||||
assertEquals( 1L, mutNum.longValue() );
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ import junit.textui.TestRunner;
|
|||
/**
|
||||
* JUnit tests.
|
||||
*
|
||||
* @version $Id: MutableDoubleTest.java,v 1.3 2004/12/26 02:35:47 bayard Exp $
|
||||
* @version $Id$
|
||||
* @see MutableDouble
|
||||
*/
|
||||
public class MutableDoubleTest extends TestCase {
|
||||
|
@ -143,6 +143,9 @@ public class MutableDoubleTest extends TestCase {
|
|||
MutableDouble mutNum = new MutableDouble(1.7);
|
||||
|
||||
assertEquals( 1.7F, mutNum.floatValue(), 0 );
|
||||
assertEquals( 1.7, mutNum.doubleValue(), 0 );
|
||||
assertEquals( (byte) 1, mutNum.byteValue() );
|
||||
assertEquals( (short) 1, mutNum.shortValue() );
|
||||
assertEquals( 1, mutNum.intValue() );
|
||||
assertEquals( 1L, mutNum.longValue() );
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ import junit.textui.TestRunner;
|
|||
/**
|
||||
* JUnit tests.
|
||||
*
|
||||
* @version $Id: MutableFloatTest.java,v 1.3 2004/12/26 02:35:47 bayard Exp $
|
||||
* @version $Id$
|
||||
* @see MutableFloat
|
||||
*/
|
||||
public class MutableFloatTest extends TestCase {
|
||||
|
@ -144,6 +144,9 @@ public class MutableFloatTest extends TestCase {
|
|||
|
||||
assertEquals( 1, mutNum.intValue() );
|
||||
assertEquals( 1.7, mutNum.doubleValue(), 0.00001 );
|
||||
assertEquals( (byte) 1, mutNum.byteValue() );
|
||||
assertEquals( (short) 1, mutNum.shortValue() );
|
||||
assertEquals( 1, mutNum.intValue() );
|
||||
assertEquals( 1L, mutNum.longValue() );
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ import junit.textui.TestRunner;
|
|||
/**
|
||||
* JUnit tests.
|
||||
*
|
||||
* @version $Id: MutableIntTest.java,v 1.2 2004/12/26 02:35:47 bayard Exp $
|
||||
* @version $Id$
|
||||
* @see MutableInt
|
||||
*/
|
||||
public class MutableIntTest extends TestCase {
|
||||
|
@ -131,6 +131,8 @@ public class MutableIntTest extends TestCase {
|
|||
public void testPrimitiveValues() {
|
||||
MutableInt mutNum = new MutableInt(1);
|
||||
|
||||
assertEquals( (byte) 1, mutNum.byteValue() );
|
||||
assertEquals( (short) 1, mutNum.shortValue() );
|
||||
assertEquals( 1.0F, mutNum.floatValue(), 0 );
|
||||
assertEquals( 1.0, mutNum.doubleValue(), 0 );
|
||||
assertEquals( 1L, mutNum.longValue() );
|
||||
|
|
|
@ -23,7 +23,7 @@ import junit.textui.TestRunner;
|
|||
/**
|
||||
* JUnit tests.
|
||||
*
|
||||
* @version $Id: MutableLongTest.java,v 1.3 2004/12/26 02:35:47 bayard Exp $
|
||||
* @version $Id$
|
||||
* @see MutableLong
|
||||
*/
|
||||
public class MutableLongTest extends TestCase {
|
||||
|
@ -133,6 +133,10 @@ public class MutableLongTest extends TestCase {
|
|||
|
||||
assertEquals( 1.0F, mutNum.floatValue(), 0 );
|
||||
assertEquals( 1.0, mutNum.doubleValue(), 0 );
|
||||
assertEquals( (byte) 1, mutNum.byteValue() );
|
||||
assertEquals( (short) 1, mutNum.shortValue() );
|
||||
assertEquals( 1, mutNum.intValue() );
|
||||
assertEquals( 1L, mutNum.longValue() );
|
||||
}
|
||||
|
||||
public void testToString() {
|
||||
|
|
|
@ -23,7 +23,7 @@ import junit.textui.TestRunner;
|
|||
/**
|
||||
* JUnit tests.
|
||||
*
|
||||
* @version $Id: MutableShortTest.java,v 1.3 2004/12/26 02:35:47 bayard Exp $
|
||||
* @version $Id$
|
||||
* @see MutableShort
|
||||
*/
|
||||
public class MutableShortTest extends TestCase {
|
||||
|
@ -133,6 +133,8 @@ public class MutableShortTest extends TestCase {
|
|||
|
||||
assertEquals( 1.0F, mutNum.floatValue(), 0 );
|
||||
assertEquals( 1.0, mutNum.doubleValue(), 0 );
|
||||
assertEquals( (byte) 1, mutNum.byteValue() );
|
||||
assertEquals( (short) 1, mutNum.shortValue() );
|
||||
assertEquals( 1, mutNum.intValue() );
|
||||
assertEquals( 1L, mutNum.longValue() );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue