From 3afc5c146b3242f7ccd4030d82e665859eca3988 Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Tue, 14 Dec 2010 14:55:03 +0000 Subject: [PATCH] use LuceneTestCase's random in SimpleFacetsTest git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1049117 13f79535-47bb-0310-9956-ffa450edef68 --- .../test/org/apache/solr/request/SimpleFacetsTest.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/solr/src/test/org/apache/solr/request/SimpleFacetsTest.java b/solr/src/test/org/apache/solr/request/SimpleFacetsTest.java index b66321ff9d6..f0478eb61ed 100644 --- a/solr/src/test/org/apache/solr/request/SimpleFacetsTest.java +++ b/solr/src/test/org/apache/solr/request/SimpleFacetsTest.java @@ -24,7 +24,6 @@ import org.junit.Test; import java.util.ArrayList; import java.util.Collections; -import java.util.Random; public class SimpleFacetsTest extends SolrTestCaseJ4 { @@ -34,12 +33,11 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 { createIndex(); } - static Random rand = new Random(); // TODO: a way to use lucene's newRandom()? static int random_commit_percent = 30; static int random_dupe_percent = 25; // some duplicates in the index to create deleted docs static void randomCommit(int percent_chance) { - if (rand.nextInt(100) <= percent_chance) + if (random.nextInt(100) <= percent_chance) assertU(commit()); } @@ -49,7 +47,7 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 { static void add_doc(String... fieldsAndValues) { do { pendingDocs.add(fieldsAndValues); - } while (rand.nextInt(100) <= random_dupe_percent); + } while (random.nextInt(100) <= random_dupe_percent); // assertU(adoc(fieldsAndValues)); // randomCommit(random_commit_percent); @@ -63,7 +61,7 @@ public class SimpleFacetsTest extends SolrTestCaseJ4 { indexFacetPrefixMultiValued(); indexFacetPrefixSingleValued(); - Collections.shuffle(pendingDocs, rand); + Collections.shuffle(pendingDocs, random); for (String[] doc : pendingDocs) { assertU(adoc(doc)); randomCommit(random_commit_percent);