Protected a Number test so it only runs in 1.3+. I suspect the JDK doesn't support the type of number we're throwing at it in 1.2: "1.1E-700F" to BigDecimal.

git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137154 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Henri Yandell 2002-11-22 23:30:32 +00:00
parent 3a3889bebc
commit 8b1532bd3a
1 changed files with 6 additions and 2 deletions

View File

@ -66,7 +66,7 @@ import junit.framework.TestSuite;
*
* @author <a href="mailto:rand_mcneely@yahoo.com">Rand McNeely</a>
* @author <a href="mailto:ridesmet@users.sourceforge.net">Ringo De Smet</a>
* @version $Id: NumberUtilsTest.java,v 1.2 2002/09/15 10:27:56 scolebourne Exp $
* @version $Id: NumberUtilsTest.java,v 1.3 2002/11/22 23:30:32 bayard Exp $
*/
public class NumberUtilsTest extends TestCase {
@ -114,7 +114,11 @@ public class NumberUtilsTest extends TestCase {
assertEquals("createNumber(String) 12 failed", new Float("1.1E20"), NumberUtils.createNumber("1.1E20"));
assertEquals("createNumber(String) 13 failed", new Double("-1.1E200"), NumberUtils.createNumber("-1.1E200"));
assertEquals("createNumber(String) 14 failed", new Double("1.1E-200"), NumberUtils.createNumber("1.1E-200"));
assertEquals("createNumber(String) 15 failed", new BigDecimal("1.1E-700"), NumberUtils.createNumber("1.1E-700F"));
// jdk 1.2 doesn't support this. unsure about jdk 1.2.2
if(SystemUtils.isJavaVersionAtLeast(1.3f)) {
assertEquals("createNumber(String) 15 failed", new BigDecimal("1.1E-700"), NumberUtils.createNumber("1.1E-700F"));
}
assertEquals(
"createNumber(String) 16 failed",
new Long("10" + Integer.MAX_VALUE),