LUCENE-2466: fix these lucene tests to work under all locales

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@945274 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2010-05-17 17:58:43 +00:00
parent 824939d7e5
commit 62307cb0b5
2 changed files with 6 additions and 2 deletions

View File

@ -18,7 +18,9 @@ package org.apache.lucene.search;
*/
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.NumberFormat;
import java.util.Locale;
import java.util.Random;
import org.apache.lucene.analysis.MockAnalyzer;
@ -49,7 +51,7 @@ public class TestRegexpRandom extends LuceneTestCase {
Field field = new Field("field", "", Field.Store.NO, Field.Index.ANALYZED);
doc.add(field);
NumberFormat df = new DecimalFormat("0000");
NumberFormat df = new DecimalFormat("0000", new DecimalFormatSymbols(Locale.ENGLISH));
for (int i = 0; i < 10000; i++) {
field.setValue(df.format(i));
writer.addDocument(doc);

View File

@ -18,7 +18,9 @@ package org.apache.lucene.search;
*/
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.NumberFormat;
import java.util.Locale;
import java.util.Random;
import org.apache.lucene.analysis.MockAnalyzer;
@ -50,7 +52,7 @@ public class TestWildcardRandom extends LuceneTestCase {
Field field = new Field("field", "", Field.Store.NO, Field.Index.ANALYZED);
doc.add(field);
NumberFormat df = new DecimalFormat("0000");
NumberFormat df = new DecimalFormat("0000", new DecimalFormatSymbols(Locale.ENGLISH));
for (int i = 0; i < 10000; i++) {
field.setValue(df.format(i));
writer.addDocument(doc);