Skip to content

Apache Lucene open-source search software

don't randomly pick Facet42 DocValuesFormat: it's not general purpose

Michael McCandlessabfbd31c199f
diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleSetupAndRestoreClassEnv.java b/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleSetupAndRestoreClassEnv.java
index 01cbbcdcf20..ebe0426a18c 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleSetupAndRestoreClassEnv.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/util/TestRuleSetupAndRestoreClassEnv.java
@@ -18,10 +18,12 @@ package org.apache.lucene.util;
*/
import java.io.PrintStream;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
+import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Random;
@@ -173,8 +175,9 @@ final class TestRuleSetupAndRestoreClassEnv extends AbstractBeforeAfterRule {
final DocValuesFormat dvFormat;
if ("random".equals(TEST_DOCVALUESFORMAT)) {
// pick one from SPI
- String formats[] = DocValuesFormat.availableDocValuesFormats().toArray(new String[0]);
- dvFormat = DocValuesFormat.forName(formats[random.nextInt(formats.length)]);
+ List<String> formats = new ArrayList<String>(DocValuesFormat.availableDocValuesFormats());
+ formats.remove("Facet42");
+ dvFormat = DocValuesFormat.forName(formats.get(random.nextInt(formats.size())));
} else {
dvFormat = DocValuesFormat.forName(TEST_DOCVALUESFORMAT);
}