From 8b1532bd3a4c8573221f4cc0164b442cc274a170 Mon Sep 17 00:00:00 2001 From: Henri Yandell Date: Fri, 22 Nov 2002 23:30:32 +0000 Subject: [PATCH] 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 --- src/test/org/apache/commons/lang/NumberUtilsTest.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/test/org/apache/commons/lang/NumberUtilsTest.java b/src/test/org/apache/commons/lang/NumberUtilsTest.java index 3e284ba8f..1f4754787 100644 --- a/src/test/org/apache/commons/lang/NumberUtilsTest.java +++ b/src/test/org/apache/commons/lang/NumberUtilsTest.java @@ -66,7 +66,7 @@ import junit.framework.TestSuite; * * @author Rand McNeely * @author Ringo De Smet - * @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),