You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mb...@apache.org on 2007/12/03 18:23:06 UTC

svn commit: r600608 - /commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/AbstractMessageFormatTest.java

Author: mbenson
Date: Mon Dec  3 09:23:05 2007
New Revision: 600608

URL: http://svn.apache.org/viewvc?rev=600608&view=rev
Log:
account for unavailability of NumberFormat.getIntegerInstance(...) pre JDK 1.4

Modified:
    commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/AbstractMessageFormatTest.java

Modified: commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/AbstractMessageFormatTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/AbstractMessageFormatTest.java?rev=600608&r1=600607&r2=600608&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/AbstractMessageFormatTest.java (original)
+++ commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/AbstractMessageFormatTest.java Mon Dec  3 09:23:05 2007
@@ -29,6 +29,8 @@
 import java.util.GregorianCalendar;
 import java.util.Locale;
 
+import org.apache.commons.lang.SystemUtils;
+
 import junit.framework.TestCase;
 
 /**
@@ -160,12 +162,12 @@
     }
 
     public void testInteger() {
-        doAssertions(NumberFormat.getIntegerInstance(locale), NUMBERS,
+        doAssertions(getIntegerNumberFormat(locale), NUMBERS,
                 "number,integer");
     }
 
     public void testIntegerLooseFormatting() {
-        doAssertions(NumberFormat.getIntegerInstance(locale), NUMBERS,
+        doAssertions(getIntegerNumberFormat(locale), NUMBERS,
                 " number , integer ", "number,integer");
     }
 
@@ -291,4 +293,12 @@
         doAssertions(new ChoiceFormat(choice.toString()), NUMBERS, format
                 .toString());
     }
+
+    private NumberFormat getIntegerNumberFormat(Locale locale) {
+        NumberFormat result = NumberFormat.getInstance(locale);
+        result.setMaximumFractionDigits(0);
+        result.setParseIntegerOnly(true);
+        return result;
+    }
+
 }