commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r600608 - /commons/proper/lang/trunk/src/test/org/apache/commons/lang/text/AbstractMessageFormatTest.java
Date Mon, 03 Dec 2007 17:23:06 GMT
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;
+    }
+
 }



Mime
View raw message