commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject svn commit: r1091153 - /commons/proper/math/trunk/src/test/java/org/apache/commons/math/exception/TooManyEvaluationsExceptionTest.java
Date Mon, 11 Apr 2011 18:02:52 GMT
Author: luc
Date: Mon Apr 11 18:02:52 2011
New Revision: 1091153

URL: http://svn.apache.org/viewvc?rev=1091153&view=rev
Log:
make sure the test runs correctly even in a non-US environment

Modified:
    commons/proper/math/trunk/src/test/java/org/apache/commons/math/exception/TooManyEvaluationsExceptionTest.java

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/exception/TooManyEvaluationsExceptionTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/exception/TooManyEvaluationsExceptionTest.java?rev=1091153&r1=1091152&r2=1091153&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/exception/TooManyEvaluationsExceptionTest.java
(original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/exception/TooManyEvaluationsExceptionTest.java
Mon Apr 11 18:02:52 2011
@@ -17,6 +17,7 @@
 package org.apache.commons.math.exception;
 
 import java.text.MessageFormat;
+import java.util.Locale;
 
 import org.junit.Assert;
 import org.junit.Test;
@@ -32,9 +33,12 @@ public class TooManyEvaluationsException
         final int max = 12345;
         final TooManyEvaluationsException e = new TooManyEvaluationsException(max);
         final String msg = e.getMessage();
+        final MessageFormat usFormat = new MessageFormat("{0}", Locale.US);
         Assert.assertTrue(msg,
                           msg.matches(".*?" +
-                                      MessageFormat.format("{0}", max) +
+                                      usFormat.format(new Object[] {max},
+                                                      new StringBuffer(),
+                                                      null) +
                                       ".*"));
     }
 }



Mime
View raw message