mirror of https://github.com/apache/lucene.git
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:
parent
824939d7e5
commit
62307cb0b5
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue