lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rm...@apache.org
Subject svn commit: r995863 [7/10] - in /lucene/dev/branches/branch_3x: ./ lucene/ lucene/backwards/src/ lucene/backwards/src/test/org/apache/lucene/analysis/ lucene/backwards/src/test/org/apache/lucene/document/ lucene/backwards/src/test/org/apache/lucene/ind...
Date Fri, 10 Sep 2010 16:49:48 GMT
Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/index/TestStressIndexing.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/index/TestStressIndexing.java?rev=995863&r1=995862&r2=995863&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/index/TestStressIndexing.java (original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/index/TestStressIndexing.java Fri Sep 10 16:49:41 2010
@@ -23,12 +23,9 @@ import org.apache.lucene.document.*;
 import org.apache.lucene.index.IndexWriterConfig.OpenMode;
 import org.apache.lucene.search.*;
 
-import java.util.Random;
 import java.io.File;
 
 public class TestStressIndexing extends LuceneTestCase {
-  private Random RANDOM;
-
   private static abstract class TimedThread extends Thread {
     volatile boolean failed;
     int count;
@@ -82,7 +79,7 @@ public class TestStressIndexing extends 
       // Add 10 docs:
       for(int j=0; j<10; j++) {
         Document d = new Document();
-        int n = RANDOM.nextInt();
+        int n = random.nextInt();
         d.add(new Field("id", Integer.toString(nextID++), Field.Store.YES, Field.Index.NOT_ANALYZED));
         d.add(new Field("contents", English.intToEnglish(n), Field.Store.NO, Field.Index.ANALYZED));
         writer.addDocument(d);
@@ -118,7 +115,7 @@ public class TestStressIndexing extends 
     stress test.
   */
   public void runStressTest(Directory directory, MergeScheduler mergeScheduler) throws Exception {
-    IndexWriter modifier = new IndexWriter(directory, newIndexWriterConfig(RANDOM,
+    IndexWriter modifier = new IndexWriter(directory, newIndexWriterConfig(
         TEST_VERSION_CURRENT, new SimpleAnalyzer(TEST_VERSION_CURRENT))
         .setOpenMode(OpenMode.CREATE).setMaxBufferedDocs(10).setMergeScheduler(
             mergeScheduler));
@@ -166,10 +163,8 @@ public class TestStressIndexing extends 
     FSDirectory.
   */
   public void testStressIndexAndSearching() throws Exception {
-    RANDOM = newRandom();
-
     // With ConcurrentMergeScheduler, in RAMDir
-    Directory directory = newDirectory(RANDOM);
+    Directory directory = newDirectory();
     runStressTest(directory, new ConcurrentMergeScheduler());
     directory.close();
 

Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/index/TestStressIndexing2.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/index/TestStressIndexing2.java?rev=995863&r1=995862&r2=995863&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/index/TestStressIndexing2.java (original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/index/TestStressIndexing2.java Fri Sep 10 16:49:41 2010
@@ -35,6 +35,7 @@ import org.apache.lucene.index.IndexWrit
 import org.apache.lucene.search.TermQuery;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util.LuceneTestCaseJ4;
 import org.apache.lucene.util.StringHelper;
 import org.apache.lucene.util._TestUtil;
 
@@ -46,8 +47,6 @@ public class TestStressIndexing2 extends
   static int maxBufferedDocs=3;
   static int seed=0;
 
-  Random r;
-
   public class MockIndexWriter extends IndexWriter {
 
     public MockIndexWriter(Directory dir, IndexWriterConfig conf) throws IOException {
@@ -57,36 +56,34 @@ public class TestStressIndexing2 extends
     @Override
     boolean testPoint(String name) {
       //      if (name.equals("startCommit")) {
-      if (r.nextInt(4) == 2)
+      if (random.nextInt(4) == 2)
         Thread.yield();
       return true;
     }
   }
   
   public void testRandomIWReader() throws Throwable {
-    r = newRandom();
-    Directory dir = newDirectory(r);
+    Directory dir = newDirectory();
     
     // TODO: verify equals using IW.getReader
     DocsAndWriter dw = indexRandomIWReader(5, 3, 100, dir);
     IndexReader reader = dw.writer.getReader();
     dw.writer.commit();
-    verifyEquals(r, reader, dir, "id");
+    verifyEquals(random, reader, dir, "id");
     reader.close();
     dw.writer.close();
     dir.close();
   }
   
   public void testRandom() throws Throwable {
-    r = newRandom();
-    Directory dir1 = newDirectory(r);
+    Directory dir1 = newDirectory();
     // dir1 = FSDirectory.open("foofoofoo");
-    Directory dir2 = newDirectory(r);
+    Directory dir2 = newDirectory();
     // mergeFactor=2; maxBufferedDocs=2; Map docs = indexRandom(1, 3, 2, dir1);
-    int maxThreadStates = 1+r.nextInt(10);
-    boolean doReaderPooling = r.nextBoolean();
+    int maxThreadStates = 1+random.nextInt(10);
+    boolean doReaderPooling = random.nextBoolean();
     Map<String,Document> docs = indexRandom(5, 3, 100, dir1, maxThreadStates, doReaderPooling);
-    indexSerial(r, docs, dir2);
+    indexSerial(random, docs, dir2);
 
     // verifying verify
     // verifyEquals(dir1, dir1, "id");
@@ -99,23 +96,22 @@ public class TestStressIndexing2 extends
 
   public void testMultiConfig() throws Throwable {
     // test lots of smaller different params together
-    r = newRandom();
-    int num = 3*RANDOM_MULTIPLIER;
+    int num = 3 * RANDOM_MULTIPLIER;
     for (int i = 0; i < num; i++) { // increase iterations for better testing
-      sameFieldOrder=r.nextBoolean();
-      mergeFactor=r.nextInt(3)+2;
-      maxBufferedDocs=r.nextInt(3)+2;
-      int maxThreadStates = 1+r.nextInt(10);
-      boolean doReaderPooling = r.nextBoolean();
+      sameFieldOrder=random.nextBoolean();
+      mergeFactor=random.nextInt(3)+2;
+      maxBufferedDocs=random.nextInt(3)+2;
+      int maxThreadStates = 1+random.nextInt(10);
+      boolean doReaderPooling = random.nextBoolean();
       seed++;
 
-      int nThreads=r.nextInt(5)+1;
-      int iter=r.nextInt(5)+1;
-      int range=r.nextInt(20)+1;
-      Directory dir1 = newDirectory(r);
-      Directory dir2 = newDirectory(r);
+      int nThreads=random.nextInt(5)+1;
+      int iter=random.nextInt(5)+1;
+      int range=random.nextInt(20)+1;
+      Directory dir1 = newDirectory();
+      Directory dir2 = newDirectory();
       Map<String,Document> docs = indexRandom(nThreads, iter, range, dir1, maxThreadStates, doReaderPooling);
-      indexSerial(r, docs, dir2);
+      indexSerial(random, docs, dir2);
       verifyEquals(dir1, dir2, "id");
       dir1.close();
       dir2.close();
@@ -142,7 +138,7 @@ public class TestStressIndexing2 extends
   
   public DocsAndWriter indexRandomIWReader(int nThreads, int iterations, int range, Directory dir) throws IOException, InterruptedException {
     Map<String,Document> docs = new HashMap<String,Document>();
-    IndexWriter w = new MockIndexWriter(dir, newIndexWriterConfig(r,
+    IndexWriter w = new MockIndexWriter(dir, newIndexWriterConfig(
         TEST_VERSION_CURRENT, new WhitespaceAnalyzer(TEST_VERSION_CURRENT)).setOpenMode(OpenMode.CREATE).setRAMBufferSizeMB(
         0.1).setMaxBufferedDocs(maxBufferedDocs));
     w.commit();
@@ -195,7 +191,7 @@ public class TestStressIndexing2 extends
                                           boolean doReaderPooling) throws IOException, InterruptedException {
     Map<String,Document> docs = new HashMap<String,Document>();
     for(int iter=0;iter<3;iter++) {
-      IndexWriter w = new MockIndexWriter(dir, newIndexWriterConfig(r,
+      IndexWriter w = new MockIndexWriter(dir, newIndexWriterConfig(
           TEST_VERSION_CURRENT, new WhitespaceAnalyzer(TEST_VERSION_CURRENT)).setOpenMode(OpenMode.CREATE)
                .setRAMBufferSizeMB(0.1).setMaxBufferedDocs(maxBufferedDocs).setMaxThreadStates(maxThreadStates)
                .setReaderPooling(doReaderPooling));
@@ -239,7 +235,7 @@ public class TestStressIndexing2 extends
 
   
   public static void indexSerial(Random random, Map<String,Document> docs, Directory dir) throws IOException {
-    IndexWriter w = new IndexWriter(dir, newIndexWriterConfig(random, TEST_VERSION_CURRENT, new WhitespaceAnalyzer(TEST_VERSION_CURRENT)));
+    IndexWriter w = new IndexWriter(dir, LuceneTestCaseJ4.newIndexWriterConfig(random, TEST_VERSION_CURRENT, new WhitespaceAnalyzer(TEST_VERSION_CURRENT)));
 
     // index all docs in a single thread
     Iterator<Document> iter = docs.values().iterator();

Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/index/TestTermVectorsReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/index/TestTermVectorsReader.java?rev=995863&r1=995862&r2=995863&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/index/TestTermVectorsReader.java (original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/index/TestTermVectorsReader.java Fri Sep 10 16:49:41 2010
@@ -22,7 +22,6 @@ import java.io.Reader;
 import java.util.Arrays;
 import java.util.Iterator;
 import java.util.Map;
-import java.util.Random;
 import java.util.SortedSet;
 
 import org.apache.lucene.analysis.Analyzer;
@@ -93,9 +92,8 @@ public class TestTermVectorsReader exten
     }
     Arrays.sort(tokens);
 
-    Random random = newRandom();
-    dir = newDirectory(random);
-    IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(random, TEST_VERSION_CURRENT, new MyAnalyzer()).setMaxBufferedDocs(-1));
+    dir = newDirectory();
+    IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig( TEST_VERSION_CURRENT, new MyAnalyzer()).setMaxBufferedDocs(-1));
     ((LogMergePolicy) writer.getConfig().getMergePolicy()).setUseCompoundFile(false);
     ((LogMergePolicy) writer.getConfig().getMergePolicy()).setUseCompoundDocStore(false);
     ((LogMergePolicy) writer.getConfig().getMergePolicy()).setMergeFactor(10);

Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/index/TestTermdocPerf.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/index/TestTermdocPerf.java?rev=995863&r1=995862&r2=995863&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/index/TestTermdocPerf.java (original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/index/TestTermdocPerf.java Fri Sep 10 16:49:41 2010
@@ -69,7 +69,7 @@ public class TestTermdocPerf extends Luc
 
     Document doc = new Document();
     doc.add(new Field(field,val, Field.Store.NO, Field.Index.NOT_ANALYZED_NO_NORMS));
-    IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(random,
+    IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(
         TEST_VERSION_CURRENT, analyzer)
         .setOpenMode(OpenMode.CREATE).setMaxBufferedDocs(100));
     ((LogMergePolicy) writer.getConfig().getMergePolicy()).setMergeFactor(100);
@@ -84,8 +84,7 @@ public class TestTermdocPerf extends Luc
 
 
   public int doTest(int iter, int ndocs, int maxTF, float percentDocs) throws IOException {
-    Random random = newRandom();
-    Directory dir = newDirectory(random);
+    Directory dir = newDirectory();
 
     long start = System.currentTimeMillis();
     addDocs(random, dir, ndocs, "foo", "val", maxTF, percentDocs);

Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/index/TestThreadedOptimize.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/index/TestThreadedOptimize.java?rev=995863&r1=995862&r2=995863&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/index/TestThreadedOptimize.java (original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/index/TestThreadedOptimize.java Fri Sep 10 16:49:41 2010
@@ -53,7 +53,7 @@ public class TestThreadedOptimize extend
 
   public void runTest(Random random, Directory directory, MergeScheduler merger) throws Exception {
 
-    IndexWriter writer = new IndexWriter(directory, newIndexWriterConfig(random,
+    IndexWriter writer = new IndexWriter(directory, newIndexWriterConfig(
         TEST_VERSION_CURRENT, ANALYZER)
         .setOpenMode(OpenMode.CREATE).setMaxBufferedDocs(2).setMergeScheduler(
             merger));
@@ -118,7 +118,7 @@ public class TestThreadedOptimize extend
       assertEquals(expectedDocCount, writer.maxDoc());
 
       writer.close();
-      writer = new IndexWriter(directory, newIndexWriterConfig(random,
+      writer = new IndexWriter(directory, newIndexWriterConfig(
           TEST_VERSION_CURRENT, ANALYZER).setOpenMode(
           OpenMode.APPEND).setMaxBufferedDocs(2));
 
@@ -135,8 +135,7 @@ public class TestThreadedOptimize extend
     FSDirectory.
   */
   public void testThreadedOptimize() throws Exception {
-    Random random = newRandom();
-    Directory directory = newDirectory(random);
+    Directory directory = newDirectory();
     runTest(random, directory, new SerialMergeScheduler());
     runTest(random, directory, new ConcurrentMergeScheduler());
     directory.close();

Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/index/TestTransactionRollback.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/index/TestTransactionRollback.java?rev=995863&r1=995862&r2=995863&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/index/TestTransactionRollback.java (original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/index/TestTransactionRollback.java Fri Sep 10 16:49:41 2010
@@ -25,7 +25,6 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.HashMap;
-import java.util.Random;
 
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.analysis.WhitespaceAnalyzer;
@@ -44,7 +43,6 @@ public class TestTransactionRollback ext
 	
   private static final String FIELD_RECORD_ID = "record_id";
   private Directory dir;
-  private Random random;
 	
   //Rolls back index to a chosen ID
   private void rollBackLast(int id) throws Exception {
@@ -64,7 +62,7 @@ public class TestTransactionRollback ext
     if (last==null)
       throw new RuntimeException("Couldn't find commit point "+id);
 		
-    IndexWriter w = new IndexWriter(dir, newIndexWriterConfig(random,
+    IndexWriter w = new IndexWriter(dir, newIndexWriterConfig(
         TEST_VERSION_CURRENT, new WhitespaceAnalyzer(TEST_VERSION_CURRENT)).setIndexDeletionPolicy(
         new RollbackDeletionPolicy(id)).setIndexCommit(last));
     Map<String,String> data = new HashMap<String,String>();
@@ -123,11 +121,10 @@ public class TestTransactionRollback ext
   @Override
   protected void setUp() throws Exception {
     super.setUp();
-    random = newRandom();
-    dir = newDirectory(random);
+    dir = newDirectory();
     //Build index, of records 1 to 100, committing after each batch of 10
     IndexDeletionPolicy sdp=new KeepAllDeletionPolicy();
-    IndexWriter w=new IndexWriter(dir, newIndexWriterConfig(random, TEST_VERSION_CURRENT, new WhitespaceAnalyzer(TEST_VERSION_CURRENT)).setIndexDeletionPolicy(sdp));
+    IndexWriter w=new IndexWriter(dir, newIndexWriterConfig(TEST_VERSION_CURRENT, new WhitespaceAnalyzer(TEST_VERSION_CURRENT)).setIndexDeletionPolicy(sdp));
     for(int currentRecordId=1;currentRecordId<=100;currentRecordId++) {
       Document doc=new Document();
       doc.add(new Field(FIELD_RECORD_ID,""+currentRecordId,Field.Store.YES,Field.Index.ANALYZED));
@@ -201,7 +198,7 @@ public class TestTransactionRollback ext
     for(int i=0;i<2;i++) {
       // Unless you specify a prior commit point, rollback
       // should not work:
-      new IndexWriter(dir, newIndexWriterConfig(random, TEST_VERSION_CURRENT, new WhitespaceAnalyzer(TEST_VERSION_CURRENT))
+      new IndexWriter(dir, newIndexWriterConfig(TEST_VERSION_CURRENT, new WhitespaceAnalyzer(TEST_VERSION_CURRENT))
           .setIndexDeletionPolicy(new DeleteLastCommitPolicy())).close();
       IndexReader r = IndexReader.open(dir, true);
       assertEquals(100, r.numDocs());

Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/index/TestTransactions.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/index/TestTransactions.java?rev=995863&r1=995862&r2=995863&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/index/TestTransactions.java (original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/index/TestTransactions.java Fri Sep 10 16:49:41 2010
@@ -18,7 +18,6 @@ package org.apache.lucene.index;
  */
 
 import java.io.IOException;
-import java.util.Random;
 
 import org.apache.lucene.analysis.WhitespaceAnalyzer;
 import org.apache.lucene.document.Document;
@@ -28,17 +27,15 @@ import org.apache.lucene.store.MockDirec
 import org.apache.lucene.store.RAMDirectory;
 import org.apache.lucene.util.English;
 import org.apache.lucene.util.LuceneTestCase;
-import org.apache.lucene.util._TestUtil;
 
 public class TestTransactions extends LuceneTestCase {
   
-  private Random RANDOM;
   private static volatile boolean doFail;
 
   private class RandomFailure extends MockDirectoryWrapper.Failure {
     @Override
     public void eval(MockDirectoryWrapper dir) throws IOException {
-      if (TestTransactions.doFail && RANDOM.nextInt() % 10 <= 3)
+      if (TestTransactions.doFail && random.nextInt() % 10 <= 3)
         throw new IOException("now failing randomly but on purpose");
     }
   }
@@ -94,14 +91,14 @@ public class TestTransactions extends Lu
     @Override
     public void doWork() throws Throwable {
 
-      IndexWriter writer1 = new IndexWriter(dir1, newIndexWriterConfig(RANDOM, TEST_VERSION_CURRENT, new WhitespaceAnalyzer(TEST_VERSION_CURRENT))
+      IndexWriter writer1 = new IndexWriter(dir1, newIndexWriterConfig(TEST_VERSION_CURRENT, new WhitespaceAnalyzer(TEST_VERSION_CURRENT))
           .setMaxBufferedDocs(3).setMergeScheduler(new ConcurrentMergeScheduler()));
       ((LogMergePolicy) writer1.getConfig().getMergePolicy()).setMergeFactor(2);
       ((ConcurrentMergeScheduler) writer1.getConfig().getMergeScheduler()).setSuppressExceptions();
 
       // Intentionally use different params so flush/merge
       // happen @ different times
-      IndexWriter writer2 = new IndexWriter(dir2, new IndexWriterConfig(TEST_VERSION_CURRENT, new WhitespaceAnalyzer(TEST_VERSION_CURRENT))
+      IndexWriter writer2 = new IndexWriter(dir2, newIndexWriterConfig(TEST_VERSION_CURRENT, new WhitespaceAnalyzer(TEST_VERSION_CURRENT))
           .setMaxBufferedDocs(2).setMergeScheduler(new ConcurrentMergeScheduler()));
       ((LogMergePolicy) writer2.getConfig().getMergePolicy()).setMergeFactor(3);
       ((ConcurrentMergeScheduler) writer2.getConfig().getMergeScheduler()).setSuppressExceptions();
@@ -142,7 +139,7 @@ public class TestTransactions extends Lu
       // Add 10 docs:
       for(int j=0; j<10; j++) {
         Document d = new Document();
-        int n = RANDOM.nextInt();
+        int n = random.nextInt();
         d.add(new Field("id", Integer.toString(nextID++), Field.Store.YES, Field.Index.NOT_ANALYZED));
         d.add(new Field("contents", English.intToEnglish(n), Field.Store.NO, Field.Index.ANALYZED));
         writer.addDocument(d);
@@ -184,10 +181,10 @@ public class TestTransactions extends Lu
   }
 
   public void initIndex(Directory dir) throws Throwable {
-    IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(RANDOM, TEST_VERSION_CURRENT, new WhitespaceAnalyzer(TEST_VERSION_CURRENT)));
+    IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(TEST_VERSION_CURRENT, new WhitespaceAnalyzer(TEST_VERSION_CURRENT)));
     for(int j=0; j<7; j++) {
       Document d = new Document();
-      int n = RANDOM.nextInt();
+      int n = random.nextInt();
       d.add(new Field("contents", English.intToEnglish(n), Field.Store.NO, Field.Index.ANALYZED));
       writer.addDocument(d);
     }
@@ -195,7 +192,6 @@ public class TestTransactions extends Lu
   }
 
   public void testTransactions() throws Throwable {
-    RANDOM = newRandom();
     // we cant use non-ramdir on windows, because this test needs to double-write.
     MockDirectoryWrapper dir1 = new MockDirectoryWrapper(new RAMDirectory());
     MockDirectoryWrapper dir2 = new MockDirectoryWrapper(new RAMDirectory());

Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/queryParser/TestMultiFieldQueryParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/queryParser/TestMultiFieldQueryParser.java?rev=995863&r1=995862&r2=995863&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/queryParser/TestMultiFieldQueryParser.java (original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/queryParser/TestMultiFieldQueryParser.java Fri Sep 10 16:49:41 2010
@@ -21,7 +21,6 @@ import java.io.IOException;
 import java.io.Reader;
 import java.util.HashMap;
 import java.util.Map;
-import java.util.Random;
 
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.TokenStream;
@@ -282,9 +281,8 @@ public class TestMultiFieldQueryParser e
 
   public void testStopWordSearching() throws Exception {
     Analyzer analyzer = new StandardAnalyzer(TEST_VERSION_CURRENT);
-    Random random = newRandom();
-    Directory ramDir = newDirectory(random);
-    IndexWriter iw =  new IndexWriter(ramDir, newIndexWriterConfig(random, TEST_VERSION_CURRENT, analyzer));
+    Directory ramDir = newDirectory();
+    IndexWriter iw =  new IndexWriter(ramDir, newIndexWriterConfig(TEST_VERSION_CURRENT, analyzer));
     Document doc = new Document();
     doc.add(new Field("body", "blah the footest blah", Field.Store.NO, Field.Index.ANALYZED));
     iw.addDocument(doc);

Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/queryParser/TestQueryParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/queryParser/TestQueryParser.java?rev=995863&r1=995862&r2=995863&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/queryParser/TestQueryParser.java (original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/queryParser/TestQueryParser.java Fri Sep 10 16:49:41 2010
@@ -28,7 +28,6 @@ import java.util.GregorianCalendar;
 import java.util.HashSet;
 import java.util.Locale;
 import java.util.Set;
-import java.util.Random;
 
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.KeywordAnalyzer;
@@ -540,9 +539,8 @@ public class TestQueryParser extends Loc
   }
     
   public void testFarsiRangeCollating() throws Exception {
-    Random random = newRandom();
-    Directory ramDir = newDirectory(random);
-    IndexWriter iw = new IndexWriter(ramDir, newIndexWriterConfig(random, TEST_VERSION_CURRENT, new WhitespaceAnalyzer(TEST_VERSION_CURRENT)));
+    Directory ramDir = newDirectory();
+    IndexWriter iw = new IndexWriter(ramDir, newIndexWriterConfig(TEST_VERSION_CURRENT, new WhitespaceAnalyzer(TEST_VERSION_CURRENT)));
     Document doc = new Document();
     doc.add(new Field("content","\u0633\u0627\u0628", 
                       Field.Store.YES, Field.Index.NOT_ANALYZED));
@@ -951,9 +949,9 @@ public class TestQueryParser extends Loc
   }
 
   public void testLocalDateFormat() throws IOException, ParseException {
-    Random random = newRandom();
-    Directory ramDir = newDirectory(random);
-    IndexWriter iw = new IndexWriter(ramDir, newIndexWriterConfig(random, TEST_VERSION_CURRENT, new WhitespaceAnalyzer(TEST_VERSION_CURRENT)));
+    Directory ramDir = newDirectory();
+    IndexWriter iw = new IndexWriter(ramDir, newIndexWriterConfig(TEST_VERSION_CURRENT, new WhitespaceAnalyzer(TEST_VERSION_CURRENT)));
+
     addDateDoc("a", 2005, 12, 2, 10, 15, 33, iw);
     addDateDoc("b", 2005, 12, 4, 22, 15, 00, iw);
     iw.close();
@@ -1098,10 +1096,9 @@ public class TestQueryParser extends Loc
   // enableStopPositionIncr & QueryParser's enablePosIncr
   // "match"
   public void testPositionIncrements() throws Exception {
-    Random random = newRandom();
-    Directory dir = newDirectory(random);
+    Directory dir = newDirectory();
     Analyzer a = new StandardAnalyzer(TEST_VERSION_CURRENT);
-    IndexWriter w = new IndexWriter(dir, newIndexWriterConfig(random, TEST_VERSION_CURRENT, a));
+    IndexWriter w = new IndexWriter(dir, newIndexWriterConfig( TEST_VERSION_CURRENT, a));
     Document doc = new Document();
     doc.add(new Field("f", "the wizard of ozzy", Field.Store.NO, Field.Index.ANALYZED));
     w.addDocument(doc);

Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/BaseTestRangeFilter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/BaseTestRangeFilter.java?rev=995863&r1=995862&r2=995863&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/BaseTestRangeFilter.java (original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/BaseTestRangeFilter.java Fri Sep 10 16:49:41 2010
@@ -34,8 +34,6 @@ public class BaseTestRangeFilter extends
   public static final boolean F = false;
   public static final boolean T = true;
   
-  protected Random rand = newRandom();
-  
   /**
    * Collation interacts badly with hyphens -- collation produces different
    * ordering than Unicode code-point ordering -- so two indexes are created:
@@ -48,12 +46,12 @@ public class BaseTestRangeFilter extends
     boolean allowNegativeRandomInts;
     Directory index;
     
-    TestIndex(int minR, int maxR, boolean allowNegativeRandomInts) {
+    TestIndex(Random random, int minR, int maxR, boolean allowNegativeRandomInts) {
       this.minR = minR;
       this.maxR = maxR;
       this.allowNegativeRandomInts = allowNegativeRandomInts;
       try {
-        index = newDirectory(rand);
+        index = newDirectory();
       } catch (IOException e) { throw new RuntimeException(e); }
     }
   }
@@ -91,10 +89,10 @@ public class BaseTestRangeFilter extends
    
   protected void setUp() throws Exception {
     super.setUp();
-    signedIndexDir = new TestIndex(Integer.MAX_VALUE, Integer.MIN_VALUE, true);
-    unsignedIndexDir = new TestIndex(Integer.MAX_VALUE, 0, false);
-    signedIndexReader = build(rand, signedIndexDir);
-    unsignedIndexReader = build(rand, unsignedIndexDir);
+    signedIndexDir = new TestIndex(random, Integer.MAX_VALUE, Integer.MIN_VALUE, true);
+    unsignedIndexDir = new TestIndex(random, Integer.MAX_VALUE, 0, false);
+    signedIndexReader = build(random, signedIndexDir);
+    unsignedIndexReader = build(random, unsignedIndexDir);
   }
   
   protected void tearDown() throws Exception {
@@ -108,14 +106,14 @@ public class BaseTestRangeFilter extends
   private IndexReader build(Random random, TestIndex index) throws IOException {
     /* build an index */
     RandomIndexWriter writer = new RandomIndexWriter(random, index.index, 
-        newIndexWriterConfig(random, TEST_VERSION_CURRENT, new SimpleAnalyzer(TEST_VERSION_CURRENT))
+        newIndexWriterConfig(TEST_VERSION_CURRENT, new SimpleAnalyzer(TEST_VERSION_CURRENT))
     .setOpenMode(OpenMode.CREATE));
     
     for (int d = minId; d <= maxId; d++) {
       Document doc = new Document();
       doc.add(new Field("id", pad(d), Field.Store.YES,
           Field.Index.NOT_ANALYZED));
-      int r = index.allowNegativeRandomInts ? rand.nextInt() : rand
+      int r = index.allowNegativeRandomInts ? random.nextInt() : random
           .nextInt(Integer.MAX_VALUE);
       if (index.maxR < r) {
         index.maxR = r;

Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestBoolean2.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestBoolean2.java?rev=995863&r1=995862&r2=995863&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestBoolean2.java (original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestBoolean2.java Fri Sep 10 16:49:41 2010
@@ -40,7 +40,6 @@ public class TestBoolean2 extends Lucene
   private IndexSearcher searcher;
   private IndexSearcher bigSearcher;
   private IndexReader reader;
-  private Random rnd;
   private static int NUM_EXTRA_DOCS = 6000;
 
   public static final String field = "field";
@@ -51,9 +50,8 @@ public class TestBoolean2 extends Lucene
   @Override
   protected void setUp() throws Exception {
     super.setUp();
-    rnd = newRandom();
-    directory = newDirectory(rnd);
-    RandomIndexWriter writer= new RandomIndexWriter(rnd, directory);
+    directory = newDirectory();
+    RandomIndexWriter writer= new RandomIndexWriter(random, directory);
     for (int i = 0; i < docFields.length; i++) {
       Document doc = new Document();
       doc.add(new Field(field, docFields[i], Field.Store.NO, Field.Index.ANALYZED));
@@ -70,14 +68,14 @@ public class TestBoolean2 extends Lucene
     int docCount = 0;
     do {
       final Directory copy = new MockDirectoryWrapper(new RAMDirectory(dir2));
-      RandomIndexWriter w = new RandomIndexWriter(rnd, dir2);
+      RandomIndexWriter w = new RandomIndexWriter(random, dir2);
       w.addIndexes(new Directory[] {copy});
       docCount = w.maxDoc();
       w.close();
       mulFactor *= 2;
     } while(docCount < 3000);
 
-    RandomIndexWriter w = new RandomIndexWriter(rnd, dir2);
+    RandomIndexWriter w = new RandomIndexWriter(random, dir2);
     Document doc = new Document();
     doc.add(new Field("field2", "xxx", Field.Store.NO, Field.Index.ANALYZED));
     for(int i=0;i<NUM_EXTRA_DOCS/2;i++) {
@@ -211,8 +209,8 @@ public class TestBoolean2 extends Lucene
       // increase number of iterations for more complete testing
       int num = 50 * RANDOM_MULTIPLIER;
       for (int i=0; i<num; i++) {
-        int level = rnd.nextInt(3);
-        q1 = randBoolQuery(new Random(rnd.nextLong()), rnd.nextBoolean(), level, field, vals, null);
+        int level = random.nextInt(3);
+        q1 = randBoolQuery(new Random(random.nextLong()), random.nextBoolean(), level, field, vals, null);
         
         // Can't sort by relevance since floating point numbers may not quite
         // match up.

Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestBooleanMinShouldMatch.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestBooleanMinShouldMatch.java?rev=995863&r1=995862&r2=995863&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestBooleanMinShouldMatch.java (original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestBooleanMinShouldMatch.java Fri Sep 10 16:49:41 2010
@@ -32,7 +32,6 @@ import java.util.Random;
  */
 public class TestBooleanMinShouldMatch extends LuceneTestCase {
 
-    private Random rnd;
     private Directory index;
     private IndexReader r;
     private IndexSearcher s;
@@ -41,8 +40,6 @@ public class TestBooleanMinShouldMatch e
     protected void setUp() throws Exception {
         super.setUp();
 
-        rnd = newRandom();
-        
         String[] data = new String [] {
             "A 1 2 3 4 5 6",
             "Z       4 5 6",
@@ -54,8 +51,8 @@ public class TestBooleanMinShouldMatch e
             "X       4 5 6"
         };
 
-        index = newDirectory(rnd);
-        RandomIndexWriter w = new RandomIndexWriter(rnd, index);
+        index = newDirectory();
+        RandomIndexWriter w = new RandomIndexWriter(random, index);
 
         for (int i = 0; i < data.length; i++) {
             Document doc = new Document();
@@ -308,7 +305,7 @@ public class TestBooleanMinShouldMatch e
           for (int i=0; i<c.length;i++) {
             if (c[i].getOccur() == BooleanClause.Occur.SHOULD) opt++;
           }
-          q.setMinimumNumberShouldMatch(rnd.nextInt(opt+2));
+          q.setMinimumNumberShouldMatch(random.nextInt(opt+2));
         }
       };
 
@@ -317,8 +314,8 @@ public class TestBooleanMinShouldMatch e
       // increase number of iterations for more complete testing      
       int num = 50 * RANDOM_MULTIPLIER;
       for (int i = 0; i < num; i++) {
-        int lev = rnd.nextInt(maxLev);
-        final long seed = rnd.nextLong();
+        int lev = random.nextInt(maxLev);
+        final long seed = random.nextLong();
         BooleanQuery q1 = TestBoolean2.randBoolQuery(new Random(seed), true, lev, field, vals, null);
         // BooleanQuery q2 = TestBoolean2.randBoolQuery(new Random(seed), lev, field, vals, minNrCB);
         BooleanQuery q2 = TestBoolean2.randBoolQuery(new Random(seed), true, lev, field, vals, null);

Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestBooleanOr.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestBooleanOr.java?rev=995863&r1=995862&r2=995863&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestBooleanOr.java (original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestBooleanOr.java Fri Sep 10 16:49:41 2010
@@ -16,7 +16,6 @@ package org.apache.lucene.search;
  * limitations under the License.
  */
 import java.io.IOException;
-import java.util.Random;
 
 import org.apache.lucene.util.LuceneTestCase;
 
@@ -136,8 +135,7 @@ public class TestBooleanOr extends Lucen
     super.setUp();
 
     //
-    Random random = newRandom();
-    dir = newDirectory(random);
+    dir = newDirectory();
 
 
     //

Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestBooleanPrefixQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestBooleanPrefixQuery.java?rev=995863&r1=995862&r2=995863&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestBooleanPrefixQuery.java (original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestBooleanPrefixQuery.java Fri Sep 10 16:49:41 2010
@@ -17,8 +17,6 @@ package org.apache.lucene.search;
  * limitations under the License.
  */
 
-import java.util.Random;
-
 import org.apache.lucene.util.LuceneTestCase;
 import junit.framework.Test;
 import junit.framework.TestSuite;
@@ -67,8 +65,7 @@ public class TestBooleanPrefixQuery exte
   }
 
   public void testMethod() throws Exception {
-    Random random = newRandom();
-    Directory directory = newDirectory(random);
+    Directory directory = newDirectory();
 
     String[] categories = new String[]{"food",
                                        "foodanddrink",

Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestBooleanQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestBooleanQuery.java?rev=995863&r1=995862&r2=995863&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestBooleanQuery.java (original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestBooleanQuery.java Fri Sep 10 16:49:41 2010
@@ -17,8 +17,6 @@ package org.apache.lucene.search;
  * limitations under the License.
  */
 
-import java.util.Random;
-
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.RandomIndexWriter;
 import org.apache.lucene.document.Document;
@@ -60,8 +58,7 @@ public class TestBooleanQuery extends Lu
 
   // LUCENE-1630
   public void testNullOrSubScorer() throws Throwable {
-    Random random = newRandom();
-    Directory dir = newDirectory(random);
+    Directory dir = newDirectory();
     RandomIndexWriter w = new RandomIndexWriter(random, dir);
     Document doc = new Document();
     doc.add(new Field("field", "a b c d", Field.Store.NO, Field.Index.ANALYZED));

Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestBooleanScorer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestBooleanScorer.java?rev=995863&r1=995862&r2=995863&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestBooleanScorer.java (original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestBooleanScorer.java Fri Sep 10 16:49:41 2010
@@ -19,7 +19,6 @@ package org.apache.lucene.search;
 
 import java.io.IOException;
 import java.util.Arrays;
-import java.util.Random;
 
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
@@ -40,8 +39,7 @@ public class TestBooleanScorer extends L
   private static final String FIELD = "category";
   
   public void testMethod() throws Exception {
-    Random random = newRandom();
-    Directory directory = newDirectory(random);
+    Directory directory = newDirectory();
 
     String[] values = new String[] { "1", "2", "3", "4" };
 

Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestCachingSpanFilter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestCachingSpanFilter.java?rev=995863&r1=995862&r2=995863&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestCachingSpanFilter.java (original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestCachingSpanFilter.java Fri Sep 10 16:49:41 2010
@@ -18,7 +18,6 @@ package org.apache.lucene.search;
  */
 
 import java.io.IOException;
-import java.util.Random;
 
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.RandomIndexWriter;
@@ -32,8 +31,7 @@ import org.apache.lucene.util.LuceneTest
 public class TestCachingSpanFilter extends LuceneTestCase {
 
   public void testEnforceDeletions() throws Exception {
-    Random random = newRandom();
-    Directory dir = newDirectory(random);
+    Directory dir = newDirectory();
     RandomIndexWriter writer = new RandomIndexWriter(random, dir);
     // NOTE: cannot use writer.getReader because RIW (on
     // flipping a coin) may give us a newly opened reader,

Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestCachingWrapperFilter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestCachingWrapperFilter.java?rev=995863&r1=995862&r2=995863&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestCachingWrapperFilter.java (original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestCachingWrapperFilter.java Fri Sep 10 16:49:41 2010
@@ -17,7 +17,6 @@ package org.apache.lucene.search;
  * limitations under the License.
  */
 
-import java.util.Random;
 import java.io.IOException;
 
 import org.apache.lucene.index.IndexReader;
@@ -33,17 +32,10 @@ import org.apache.lucene.util.OpenBitSet
 import org.apache.lucene.util.OpenBitSetDISI;
 
 public class TestCachingWrapperFilter extends LuceneTestCase {
-  Random rand;
-
-  @Override
-  public void setUp() throws Exception {
-    super.setUp();
-    rand = newRandom();
-  }
 
   public void testCachingWorks() throws Exception {
-    Directory dir = newDirectory(rand);
-    RandomIndexWriter writer = new RandomIndexWriter(rand, dir);
+    Directory dir = newDirectory();
+    RandomIndexWriter writer = new RandomIndexWriter(random, dir);
     writer.close();
 
     IndexReader reader = IndexReader.open(dir, true);
@@ -68,8 +60,8 @@ public class TestCachingWrapperFilter ex
   }
   
   public void testNullDocIdSet() throws Exception {
-    Directory dir = newDirectory(rand);
-    RandomIndexWriter writer = new RandomIndexWriter(rand, dir);
+    Directory dir = newDirectory();
+    RandomIndexWriter writer = new RandomIndexWriter(random, dir);
     writer.close();
 
     IndexReader reader = IndexReader.open(dir, true);
@@ -90,8 +82,8 @@ public class TestCachingWrapperFilter ex
   }
   
   public void testNullDocIdSetIterator() throws Exception {
-    Directory dir = newDirectory(rand);
-    RandomIndexWriter writer = new RandomIndexWriter(rand, dir);
+    Directory dir = newDirectory();
+    RandomIndexWriter writer = new RandomIndexWriter(random, dir);
     writer.close();
 
     IndexReader reader = IndexReader.open(dir, true);
@@ -131,8 +123,8 @@ public class TestCachingWrapperFilter ex
   }
   
   public void testIsCacheAble() throws Exception {
-    Directory dir = newDirectory(rand);
-    RandomIndexWriter writer = new RandomIndexWriter(rand, dir);
+    Directory dir = newDirectory();
+    RandomIndexWriter writer = new RandomIndexWriter(random, dir);
     writer.addDocument(new Document());
     writer.close();
 
@@ -157,9 +149,9 @@ public class TestCachingWrapperFilter ex
   }
 
   public void testEnforceDeletions() throws Exception {
-    Directory dir = newDirectory(rand);
-    RandomIndexWriter writer = new RandomIndexWriter(rand, dir,
-                                                     newIndexWriterConfig(rand, TEST_VERSION_CURRENT, new WhitespaceAnalyzer(TEST_VERSION_CURRENT)).setMergeScheduler(new SerialMergeScheduler()));
+    Directory dir = newDirectory();
+    RandomIndexWriter writer = new RandomIndexWriter(random, dir,
+                                                     newIndexWriterConfig(TEST_VERSION_CURRENT, new WhitespaceAnalyzer(TEST_VERSION_CURRENT)).setMergeScheduler(new SerialMergeScheduler()));
 
     // NOTE: cannot use writer.getReader because RIW (on
     // flipping a coin) may give us a newly opened reader,

Propchange: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestCachingWrapperFilter.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Sep 10 16:49:41 2010
@@ -1,4 +1,4 @@
-/lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestCachingWrapperFilter.java:931298,931337,931502,932129-932131,932163,932304,932369,932374,932398,932417,932541,932576,932587,932698,932731-932749,932752,932773,932795,932828,932856-932857,932862,932864,932878,932963,932998-932999,933541-933575,933598,933613,933679,933879,934339,934954,935014-935048,935065,935186-935513,935521-935522,935553-935962,936522,936544,936605,936657-936726,937039,937360,938582-938646,938989,939111,939611,939649,940433,940447,940451-940452,940666,940699,940730,940878-940892,940994,941270,941363,942166,942288,942676,942719,943142,943493,943931,945057,945090,945130,945245,945343,945420,946139,946330,946338,946599,948011,948082,948429,949288,949311,949445,949976,949997,950008,950042,950458,950613,951126,951355,951397,951521,953407,955547,955613,955615,955796-955797,955809-955996,956097,956125,956173,956316,956715,957465,957520,957634,957707,960367,960371,960374,960719,962555,963372,963654,9637
 20,963781,963873,963906,963909,963920,964019,964054,964430,964459,964720,964753,964832,964856,965103,965110,965222,965230,965299,965327,965330,965585,966354,966878,967080,979453,979809,980369,980428,980436,980501,980909,980911,980917,981265,981550,981598,981650,981661,981857,981936,982073,982084,982201,982725,982824,983100,983212,983216,983313,983495,983500,983530,983622,983632,983778,984187,984202,984232,984510,984715,984968,985453,985455,985672,986158,986173,986612,987122,988087,988206,988216,988259,988346,988478,988527,988543,988592,988613,988688,988710,988736,988739,989004,989010,989013,989030,989035,989315,989321,989334,989785,990160-990161,990180,990189,990281,990301,990451,990459,990766,990781,990854,991053,991191,991310,991497,992424,992469,992567,992571,992623,993106,993194,993199,993287,993408,994935,994976,994979,995247,995250,995376
+/lucene/dev/trunk/lucene/src/test/org/apache/lucene/search/TestCachingWrapperFilter.java:931298,931337,931502,932129-932131,932163,932304,932369,932374,932398,932417,932541,932576,932587,932698,932731-932749,932752,932773,932795,932828,932856-932857,932862,932864,932878,932963,932998-932999,933541-933575,933598,933613,933679,933879,934339,934954,935014-935048,935065,935186-935513,935521-935522,935553-935962,936522,936544,936605,936657-936726,937039,937360,938582-938646,938989,939111,939611,939649,940433,940447,940451-940452,940666,940699,940730,940878-940892,940994,941270,941363,942166,942288,942676,942719,943142,943493,943931,945057,945090,945130,945245,945343,945420,946139,946330,946338,946599,948011,948082,948429,949288,949311,949445,949976,949997,950008,950042,950458,950613,951126,951355,951397,951521,953407,955547,955613,955615,955796-955797,955809-955996,956097,956125,956173,956316,956715,957465,957520,957634,957707,960367,960371,960374,960719,962555,963372,963654,9637
 20,963781,963873,963906,963909,963920,964019,964054,964430,964459,964720,964753,964832,964856,965103,965110,965222,965230,965299,965327,965330,965585,966354,966878,967080,979453,979809,980369,980428,980436,980501,980909,980911,980917,981265,981550,981598,981650,981661,981857,981936,982073,982084,982201,982725,982824,983100,983212,983216,983313,983495,983500,983530,983622,983632,983778,984187,984202,984232,984510,984715,984968,985453,985455,985672,986158,986173,986612,987122,988087,988206,988216,988259,988346,988478,988527,988543,988592,988613,988688,988710,988736,988739,989004,989010,989013,989030,989035,989315,989321,989334,989785,990160-990161,990180,990189,990281,990301,990451,990459,990766,990781,990854,991053,991191,991310,991497,992424,992469,992567,992571,992623,993106,993194,993199,993287,993408,994935,994976,994979,995247,995250,995376,995772
 /lucene/dev/trunk/src/test/org/apache/lucene/search/TestCachingWrapperFilter.java:932749
 /lucene/java/branches/flex_1458/src/test/org/apache/lucene/search/TestCachingWrapperFilter.java:924791,924850,930201
 /lucene/java/branches/lucene_2_4/src/test/org/apache/lucene/search/TestCachingWrapperFilter.java:748824

Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestCustomSearcherSort.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestCustomSearcherSort.java?rev=995863&r1=995862&r2=995863&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestCustomSearcherSort.java (original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestCustomSearcherSort.java Fri Sep 10 16:49:41 2010
@@ -48,10 +48,9 @@ public class TestCustomSearcherSort exte
   @Override
   protected void setUp() throws Exception {
     super.setUp();
-    Random rand = newRandom();
-    index = newDirectory(rand);
-    RandomIndexWriter writer = new RandomIndexWriter(rand, index);
-    RandomGen random = new RandomGen(rand);
+    index = newDirectory();
+    RandomIndexWriter writer = new RandomIndexWriter(random, index);
+    RandomGen random = new RandomGen(this.random);
     for (int i = 0; i < INDEX_SIZE; ++i) { // don't decrease; if to low the
                                            // problem doesn't show up
       Document doc = new Document();

Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestDateFilter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestDateFilter.java?rev=995863&r1=995862&r2=995863&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestDateFilter.java (original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestDateFilter.java Fri Sep 10 16:49:41 2010
@@ -28,7 +28,6 @@ import org.apache.lucene.index.RandomInd
 import org.apache.lucene.index.Term;
 
 import java.io.IOException;
-import java.util.Random;
 
 /**
  * DateFilter JUnit tests.
@@ -46,8 +45,7 @@ public class TestDateFilter extends Luce
    */
   public void testBefore() throws IOException {
     // create an index
-    Random random = newRandom();
-    Directory indexStore = newDirectory(random);
+    Directory indexStore = newDirectory();
     RandomIndexWriter writer = new RandomIndexWriter(random, indexStore);
     
     long now = System.currentTimeMillis();
@@ -113,8 +111,7 @@ public class TestDateFilter extends Luce
    */
   public void testAfter() throws IOException {
     // create an index
-    Random random = newRandom();
-    Directory indexStore = newDirectory(random);
+    Directory indexStore = newDirectory();
     RandomIndexWriter writer = new RandomIndexWriter(random, indexStore);
     
     long now = System.currentTimeMillis();

Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestDateSort.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestDateSort.java?rev=995863&r1=995862&r2=995863&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestDateSort.java (original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestDateSort.java Fri Sep 10 16:49:41 2010
@@ -18,7 +18,6 @@ package org.apache.lucene.search;
  */
 
 import java.util.Arrays;
-import java.util.Random;
 
 import org.apache.lucene.util.LuceneTestCase;
 
@@ -51,8 +50,7 @@ public class TestDateSort extends Lucene
   protected void setUp() throws Exception {
     super.setUp();
     // Create an index writer.
-    Random random = newRandom();
-    directory = newDirectory(random);;
+    directory = newDirectory();
     RandomIndexWriter writer = new RandomIndexWriter(random, directory, new WhitespaceAnalyzer(TEST_VERSION_CURRENT));
 
     // oldest doc:

Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestDisjunctionMaxQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestDisjunctionMaxQuery.java?rev=995863&r1=995862&r2=995863&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestDisjunctionMaxQuery.java (original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestDisjunctionMaxQuery.java Fri Sep 10 16:49:41 2010
@@ -27,7 +27,6 @@ import org.apache.lucene.index.Term;
 import org.apache.lucene.store.Directory;
 
 import java.text.DecimalFormat;
-import java.util.Random;
 import java.io.IOException;
 
 /**
@@ -78,10 +77,9 @@ public class TestDisjunctionMaxQuery ext
   protected void setUp() throws Exception {
     super.setUp();
     
-    Random random = newRandom();
-    index = newDirectory(random);
+    index = newDirectory();
     RandomIndexWriter writer = new RandomIndexWriter(random, index,
-        newIndexWriterConfig(random, TEST_VERSION_CURRENT, new WhitespaceAnalyzer(TEST_VERSION_CURRENT))
+        newIndexWriterConfig(TEST_VERSION_CURRENT, new WhitespaceAnalyzer(TEST_VERSION_CURRENT))
             .setSimilarity(sim));
     
     // hed is the most important field, dek is secondary

Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestDocBoost.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestDocBoost.java?rev=995863&r1=995862&r2=995863&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestDocBoost.java (original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestDocBoost.java Fri Sep 10 16:49:41 2010
@@ -18,7 +18,6 @@ package org.apache.lucene.search;
  */
 
 import java.io.IOException;
-import java.util.Random;
 
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.document.*;
@@ -38,8 +37,7 @@ public class TestDocBoost extends Lucene
   }
 
   public void testDocBoost() throws Exception {
-    Random random = newRandom();
-    Directory store = newDirectory(random);
+    Directory store = newDirectory();
     RandomIndexWriter writer = new RandomIndexWriter(random, store);
 
     Fieldable f1 = new Field("field", "word", Field.Store.YES, Field.Index.ANALYZED);

Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestDocIdSet.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestDocIdSet.java?rev=995863&r1=995862&r2=995863&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestDocIdSet.java (original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestDocIdSet.java Fri Sep 10 16:49:41 2010
@@ -21,7 +21,6 @@ import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Iterator;
-import java.util.Random;
 
 import junit.framework.Assert;
 
@@ -101,8 +100,7 @@ public class TestDocIdSet extends Lucene
   public void testNullDocIdSet() throws Exception {
     // Tests that if a Filter produces a null DocIdSet, which is given to
     // IndexSearcher, everything works fine. This came up in LUCENE-1754.
-    Random random = newRandom();
-    Directory dir = newDirectory(random);
+    Directory dir = newDirectory();
     RandomIndexWriter writer = new RandomIndexWriter(random, dir);
     Document doc = new Document();
     doc.add(new Field("c", "val", Store.NO, Index.NOT_ANALYZED_NO_NORMS));

Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestElevationComparator.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestElevationComparator.java?rev=995863&r1=995862&r2=995863&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestElevationComparator.java (original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestElevationComparator.java Fri Sep 10 16:49:41 2010
@@ -27,7 +27,6 @@ import org.apache.lucene.util.LuceneTest
 import java.io.IOException;
 import java.util.HashMap;
 import java.util.Map;
-import java.util.Random;
 
 public class TestElevationComparator extends LuceneTestCase {
 
@@ -35,9 +34,8 @@ public class TestElevationComparator ext
 
   //@Test
   public void testSorting() throws Throwable {
-    Random random = newRandom();
-    Directory directory = newDirectory(random);
-    IndexWriter writer = new IndexWriter(directory, newIndexWriterConfig(random, TEST_VERSION_CURRENT, new WhitespaceAnalyzer(TEST_VERSION_CURRENT)).setMaxBufferedDocs(2));
+    Directory directory = newDirectory();
+    IndexWriter writer = new IndexWriter(directory, newIndexWriterConfig(TEST_VERSION_CURRENT, new WhitespaceAnalyzer(TEST_VERSION_CURRENT)).setMaxBufferedDocs(2));
     ((LogMergePolicy) writer.getConfig().getMergePolicy()).setMergeFactor(1000);
     writer.addDocument(adoc(new String[] {"id", "a", "title", "ipod", "str_s", "a"}));
     writer.addDocument(adoc(new String[] {"id", "b", "title", "ipod ipod", "str_s", "b"}));

Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestExplanations.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestExplanations.java?rev=995863&r1=995862&r2=995863&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestExplanations.java (original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestExplanations.java Fri Sep 10 16:49:41 2010
@@ -17,8 +17,6 @@ package org.apache.lucene.search;
  * limitations under the License.
  */
 
-import java.util.Random;
-
 import org.apache.lucene.queryParser.QueryParser;
 import org.apache.lucene.queryParser.ParseException;
 import org.apache.lucene.analysis.WhitespaceAnalyzer;
@@ -52,7 +50,6 @@ public class TestExplanations extends Lu
   protected IndexSearcher searcher;
   protected IndexReader reader;
   protected Directory directory;
-  protected Random random;
   
   public static final String KEY = "KEY";
   public static final String FIELD = "field";
@@ -70,8 +67,7 @@ public class TestExplanations extends Lu
   @Override
   protected void setUp() throws Exception {
     super.setUp();
-    random = newRandom();
-    directory = newDirectory(random);
+    directory = newDirectory();
     RandomIndexWriter writer= new RandomIndexWriter(random, directory);
     for (int i = 0; i < docFields.length; i++) {
       Document doc = new Document();

Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestFieldCache.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestFieldCache.java?rev=995863&r1=995862&r2=995863&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestFieldCache.java (original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestFieldCache.java Fri Sep 10 16:49:41 2010
@@ -25,12 +25,10 @@ import org.apache.lucene.util.LuceneTest
 import java.io.IOException;
 import java.io.ByteArrayOutputStream;
 import java.io.PrintStream;
-import java.util.Random;
 
 public class TestFieldCache extends LuceneTestCase {
   protected IndexReader reader;
   private static final int NUM_DOCS = 1000;
-  private Random random;
   private Directory directory;
   
   public TestFieldCache(String s) {
@@ -40,8 +38,7 @@ public class TestFieldCache extends Luce
   @Override
   protected void setUp() throws Exception {
     super.setUp();
-    random = newRandom();
-    directory = newDirectory(random);
+    directory = newDirectory();
     RandomIndexWriter writer= new RandomIndexWriter(random, directory);
     long theLong = Long.MAX_VALUE;
     double theDouble = Double.MAX_VALUE;

Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestFieldCacheRangeFilter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestFieldCacheRangeFilter.java?rev=995863&r1=995862&r2=995863&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestFieldCacheRangeFilter.java (original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestFieldCacheRangeFilter.java Fri Sep 10 16:49:41 2010
@@ -523,8 +523,8 @@ public class TestFieldCacheRangeFilter e
   
   // test using a sparse index (with deleted docs). The DocIdSet should be not cacheable, as it uses TermDocs if the range contains 0
   public void testSparseIndex() throws IOException {
-    Directory dir = newDirectory(rand);
-    IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(rand, TEST_VERSION_CURRENT, new SimpleAnalyzer(TEST_VERSION_CURRENT)));
+    Directory dir = newDirectory();
+    IndexWriter writer = new IndexWriter(dir, newIndexWriterConfig(TEST_VERSION_CURRENT, new SimpleAnalyzer(TEST_VERSION_CURRENT)));
 
     for (int d = -20; d <= 20; d++) {
       Document doc = new Document();

Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestFieldCacheTermsFilter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestFieldCacheTermsFilter.java?rev=995863&r1=995862&r2=995863&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestFieldCacheTermsFilter.java (original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestFieldCacheTermsFilter.java Fri Sep 10 16:49:41 2010
@@ -27,7 +27,6 @@ import org.apache.lucene.store.Directory
 
 import java.util.ArrayList;
 import java.util.List;
-import java.util.Random;
 
 /**
  * A basic unit test for FieldCacheTermsFilter
@@ -37,8 +36,7 @@ import java.util.Random;
 public class TestFieldCacheTermsFilter extends LuceneTestCase {
   public void testMissingTerms() throws Exception {
     String fieldName = "field1";
-    Random random = newRandom();
-    Directory rd = newDirectory(random);
+    Directory rd = newDirectory();
     RandomIndexWriter w = new RandomIndexWriter(random, rd);
     for (int i = 0; i < 100; i++) {
       Document doc = new Document();

Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestFilteredQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestFilteredQuery.java?rev=995863&r1=995862&r2=995863&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestFilteredQuery.java (original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestFilteredQuery.java Fri Sep 10 16:49:41 2010
@@ -27,7 +27,6 @@ import org.apache.lucene.store.Directory
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.util.DocIdBitSet;
 import java.util.BitSet;
-import java.util.Random;
 
 /**
  * FilteredQuery JUnit tests.
@@ -48,8 +47,7 @@ public class TestFilteredQuery extends L
   @Override
   protected void setUp() throws Exception {
     super.setUp();
-    Random random = newRandom();
-    directory = newDirectory(random);
+    directory = newDirectory();
     RandomIndexWriter writer = new RandomIndexWriter (random, directory);
 
     Document doc = new Document();

Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestFilteredSearch.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestFilteredSearch.java?rev=995863&r1=995862&r2=995863&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestFilteredSearch.java (original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestFilteredSearch.java Fri Sep 10 16:49:41 2010
@@ -18,7 +18,6 @@
 package org.apache.lucene.search;
 
 import java.io.IOException;
-import java.util.Random;
 
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.analysis.WhitespaceAnalyzer;
@@ -47,18 +46,17 @@ public class TestFilteredSearch extends 
   
   public void testFilteredSearch() throws CorruptIndexException, LockObtainFailedException, IOException {
     boolean enforceSingleSegment = true;
-    Random random = newRandom();
-    Directory directory = newDirectory(random);
+    Directory directory = newDirectory();
     int[] filterBits = {1, 36};
     SimpleDocIdSetFilter filter = new SimpleDocIdSetFilter(filterBits);
-    IndexWriter writer = new IndexWriter(directory, newIndexWriterConfig(random, TEST_VERSION_CURRENT, new WhitespaceAnalyzer(TEST_VERSION_CURRENT)));
+    IndexWriter writer = new IndexWriter(directory, newIndexWriterConfig(TEST_VERSION_CURRENT, new WhitespaceAnalyzer(TEST_VERSION_CURRENT)));
     searchFiltered(writer, directory, filter, enforceSingleSegment);
     // run the test on more than one segment
     enforceSingleSegment = false;
     // reset - it is stateful
     filter.reset();
     writer.close();
-    writer = new IndexWriter(directory, newIndexWriterConfig(random, TEST_VERSION_CURRENT, new WhitespaceAnalyzer(TEST_VERSION_CURRENT)).setOpenMode(OpenMode.CREATE).setMaxBufferedDocs(10));
+    writer = new IndexWriter(directory, newIndexWriterConfig(TEST_VERSION_CURRENT, new WhitespaceAnalyzer(TEST_VERSION_CURRENT)).setOpenMode(OpenMode.CREATE).setMaxBufferedDocs(10));
     // we index 60 docs - this will create 6 segments
     searchFiltered(writer, directory, filter, enforceSingleSegment);
     writer.close();

Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestFuzzyQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestFuzzyQuery.java?rev=995863&r1=995862&r2=995863&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestFuzzyQuery.java (original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestFuzzyQuery.java Fri Sep 10 16:49:41 2010
@@ -19,7 +19,6 @@ package org.apache.lucene.search;
 
 import java.util.List;
 import java.util.Arrays;
-import java.util.Random;
 import java.io.IOException;
 
 import org.apache.lucene.analysis.standard.StandardAnalyzer;
@@ -39,8 +38,7 @@ import org.apache.lucene.queryParser.Que
 public class TestFuzzyQuery extends LuceneTestCase {
 
   public void testFuzziness() throws Exception {
-    Random random = newRandom();
-    Directory directory = newDirectory(random);
+    Directory directory = newDirectory();
     RandomIndexWriter writer = new RandomIndexWriter(random, directory);
     addDoc("aaaaa", writer);
     addDoc("aaaab", writer);
@@ -193,8 +191,7 @@ public class TestFuzzyQuery extends Luce
   }
 
   public void testFuzzinessLong() throws Exception {
-    Random random = newRandom();
-    Directory directory = newDirectory(random);
+    Directory directory = newDirectory();
     RandomIndexWriter writer = new RandomIndexWriter(random, directory);
     addDoc("aaaaaaa", writer);
     addDoc("segment", writer);
@@ -284,8 +281,7 @@ public class TestFuzzyQuery extends Luce
   }
   
   public void testTokenLengthOpt() throws IOException {
-    Random random = newRandom();
-    Directory directory = newDirectory(random);
+    Directory directory = newDirectory();
     RandomIndexWriter writer = new RandomIndexWriter(random, directory);
     addDoc("12345678911", writer);
     addDoc("segment", writer);
@@ -322,8 +318,7 @@ public class TestFuzzyQuery extends Luce
   
   /** Test the TopTermsBoostOnlyBooleanQueryRewrite rewrite method. */
   public void testBoostOnlyRewrite() throws Exception {
-    Random random = newRandom();
-    Directory directory = newDirectory(random);
+    Directory directory = newDirectory();
     RandomIndexWriter writer = new RandomIndexWriter(random, directory);
     addDoc("Lucene", writer);
     addDoc("Lucene", writer);
@@ -349,8 +344,7 @@ public class TestFuzzyQuery extends Luce
   public void testGiga() throws Exception {
 
     StandardAnalyzer analyzer = new StandardAnalyzer(TEST_VERSION_CURRENT);
-    Random random = newRandom();
-    Directory index = newDirectory(random);
+    Directory index = newDirectory();
     RandomIndexWriter w = new RandomIndexWriter(random, index);
 
     addDoc("Lucene in Action", w);

Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestMatchAllDocsQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestMatchAllDocsQuery.java?rev=995863&r1=995862&r2=995863&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestMatchAllDocsQuery.java (original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestMatchAllDocsQuery.java Fri Sep 10 16:49:41 2010
@@ -17,7 +17,6 @@
 package org.apache.lucene.search;
 
 import java.io.IOException;
-import java.util.Random;
 
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.standard.StandardAnalyzer;
@@ -39,9 +38,8 @@ public class TestMatchAllDocsQuery exten
   private Analyzer analyzer = new StandardAnalyzer(TEST_VERSION_CURRENT);
   
   public void testQuery() throws Exception {
-    Random random = newRandom();
-    Directory dir = newDirectory(random);
-    IndexWriter iw = new IndexWriter(dir, newIndexWriterConfig(random,
+    Directory dir = newDirectory();
+    IndexWriter iw = new IndexWriter(dir, newIndexWriterConfig(
         TEST_VERSION_CURRENT, analyzer).setMaxBufferedDocs(2));
     addDoc("one", iw, 1f);
     addDoc("two", iw, 20f);

Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestMultiPhraseQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestMultiPhraseQuery.java?rev=995863&r1=995862&r2=995863&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestMultiPhraseQuery.java (original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestMultiPhraseQuery.java Fri Sep 10 16:49:41 2010
@@ -29,7 +29,6 @@ import org.apache.lucene.util.LuceneTest
 
 import java.io.IOException;
 import java.util.LinkedList;
-import java.util.Random;
 
 /**
  * This class tests the MultiPhraseQuery class.
@@ -42,8 +41,7 @@ public class TestMultiPhraseQuery extend
   }
   
   public void testPhrasePrefix() throws IOException {
-    Random random = newRandom();
-    Directory indexStore = newDirectory(random);
+    Directory indexStore = newDirectory();
     RandomIndexWriter writer = new RandomIndexWriter(random, indexStore);
     add("blueberry pie", writer);
     add("blueberry strudel", writer);
@@ -131,8 +129,7 @@ public class TestMultiPhraseQuery extend
 
   // LUCENE-2580
   public void testTall() throws IOException {
-    Random random = newRandom();
-    Directory indexStore = newDirectory(random);
+    Directory indexStore = newDirectory();
     RandomIndexWriter writer = new RandomIndexWriter(random, indexStore);
     add("blueberry chocolate pie", writer);
     add("blueberry chocolate tart", writer);
@@ -161,8 +158,7 @@ public class TestMultiPhraseQuery extend
     // In order to cause the bug, the outer query must have more than one term
     // and all terms required.
     // The contained PhraseMultiQuery must contain exactly one term array.
-    Random random = newRandom();
-    Directory indexStore = newDirectory(random);
+    Directory indexStore = newDirectory();
     RandomIndexWriter writer = new RandomIndexWriter(random, indexStore);
     add("blueberry pie", writer);
     add("blueberry chewing gum", writer);
@@ -194,8 +190,7 @@ public class TestMultiPhraseQuery extend
   }
   
   public void testPhrasePrefixWithBooleanQuery() throws IOException {
-    Random random = newRandom();
-    Directory indexStore = newDirectory(random);
+    Directory indexStore = newDirectory();
     RandomIndexWriter writer = new RandomIndexWriter(random, indexStore);
     add("This is a test", "object", writer);
     add("a note", "note", writer);
@@ -223,8 +218,7 @@ public class TestMultiPhraseQuery extend
   }
   
   public void testNoDocs() throws Exception {
-    Random random = newRandom();
-    Directory indexStore = newDirectory(random);
+    Directory indexStore = newDirectory();
     RandomIndexWriter writer = new RandomIndexWriter(random, indexStore);
     add("a note", "note", writer);
     

Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestMultiSearcher.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestMultiSearcher.java?rev=995863&r1=995862&r2=995863&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestMultiSearcher.java (original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestMultiSearcher.java Fri Sep 10 16:49:41 2010
@@ -20,6 +20,7 @@ package org.apache.lucene.search;
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.analysis.KeywordAnalyzer;
 import org.apache.lucene.analysis.standard.StandardAnalyzer;
+import org.apache.lucene.util.LuceneTestCaseJ4;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Field;
 import org.apache.lucene.document.SetBasedFieldSelector;
@@ -42,13 +43,6 @@ import java.util.Set;
  */
 public class TestMultiSearcher extends LuceneTestCase
 {
-  private Random random;
-  
-  @Override
-  public void setUp() throws Exception {
-    super.setUp();
-    random = newRandom();
-  }
   
     public TestMultiSearcher(String name)
     {
@@ -65,8 +59,8 @@ public class TestMultiSearcher extends L
 
     public void testEmptyIndex() throws Exception {
         // creating two directories for indices
-        Directory indexStoreA = newDirectory(random);
-        Directory indexStoreB = newDirectory(random);
+        Directory indexStoreA = newDirectory();
+        Directory indexStoreB = newDirectory();
 
         // creating a document to store
         Document lDoc = new Document();
@@ -89,9 +83,9 @@ public class TestMultiSearcher extends L
         lDoc3.add(new Field("handle", "1", Field.Store.YES, Field.Index.NOT_ANALYZED));
 
         // creating an index writer for the first index
-        IndexWriter writerA = new IndexWriter(indexStoreA, newIndexWriterConfig(random, TEST_VERSION_CURRENT, new StandardAnalyzer(TEST_VERSION_CURRENT)));
+        IndexWriter writerA = new IndexWriter(indexStoreA, newIndexWriterConfig(TEST_VERSION_CURRENT, new StandardAnalyzer(TEST_VERSION_CURRENT)));
         // creating an index writer for the second index, but writing nothing
-        IndexWriter writerB = new IndexWriter(indexStoreB, newIndexWriterConfig(random, TEST_VERSION_CURRENT, new StandardAnalyzer(TEST_VERSION_CURRENT)));
+        IndexWriter writerB = new IndexWriter(indexStoreB, newIndexWriterConfig(TEST_VERSION_CURRENT, new StandardAnalyzer(TEST_VERSION_CURRENT)));
 
         //--------------------------------------------------------------------
         // scenario 1
@@ -135,7 +129,7 @@ public class TestMultiSearcher extends L
         //--------------------------------------------------------------------
 
         // adding one document to the empty index
-        writerB = new IndexWriter(indexStoreB, newIndexWriterConfig(random,
+        writerB = new IndexWriter(indexStoreB, newIndexWriterConfig(
             TEST_VERSION_CURRENT, 
                 new StandardAnalyzer(TEST_VERSION_CURRENT))
                 .setOpenMode(OpenMode.APPEND));
@@ -228,7 +222,7 @@ public class TestMultiSearcher extends L
         IndexWriter indexWriter=null;
         
         try {
-          indexWriter = new IndexWriter(directory, newIndexWriterConfig(random,
+          indexWriter = new IndexWriter(directory, LuceneTestCaseJ4.newIndexWriterConfig(random,
               TEST_VERSION_CURRENT, new KeywordAnalyzer()).setOpenMode(
                   create ? OpenMode.CREATE : OpenMode.APPEND));
             
@@ -246,8 +240,8 @@ public class TestMultiSearcher extends L
     Directory ramDirectory1, ramDirectory2;
     IndexSearcher indexSearcher1, indexSearcher2;
 
-    ramDirectory1 = newDirectory(random);
-    ramDirectory2 = newDirectory(random);
+    ramDirectory1 = newDirectory();
+    ramDirectory2 = newDirectory();
     Query query = new TermQuery(new Term("contents", "doc0"));
 
     // Now put the documents in a different index
@@ -308,7 +302,7 @@ public class TestMultiSearcher extends L
         IndexSearcher indexSearcher1;
         ScoreDoc[] hits;
         
-        ramDirectory1=newDirectory(random);
+        ramDirectory1=newDirectory();
         
         // First put the documents in the same index
         initIndex(random, ramDirectory1, nDocs, true, null); // documents with a single token "doc0", "doc1", etc...
@@ -335,8 +329,8 @@ public class TestMultiSearcher extends L
         Directory ramDirectory2;
         IndexSearcher indexSearcher2;
         
-        ramDirectory1=newDirectory(random);
-        ramDirectory2=newDirectory(random);
+        ramDirectory1=newDirectory();
+        ramDirectory2=newDirectory();
         
         // Now put the documents in a different index
         initIndex(random, ramDirectory1, nDocs, true, null); // documents with a single token "doc0", "doc1", etc...
@@ -378,7 +372,7 @@ public class TestMultiSearcher extends L
      * @throws IOException 
      */
     public void testCustomSimilarity () throws IOException {
-        Directory dir = newDirectory(random);
+        Directory dir = newDirectory();
         initIndex(random, dir, 10, true, "x"); // documents with two tokens "doc0" and "x", "doc1" and x, etc...
         IndexSearcher srchr = new IndexSearcher(dir, true);
         MultiSearcher msrchr = getMultiSearcherInstance(new Searcher[]{srchr});
@@ -421,8 +415,8 @@ public class TestMultiSearcher extends L
     }
     
     public void testDocFreq() throws IOException{
-      Directory dir1 = newDirectory(random);
-      Directory dir2 = newDirectory(random);
+      Directory dir1 = newDirectory();
+      Directory dir2 = newDirectory();
 
       initIndex(random, dir1, 10, true, "x"); // documents with two tokens "doc0" and "x", "doc1" and x, etc...
       initIndex(random, dir2, 5, true, "x"); // documents with two tokens "doc0" and "x", "doc1" and x, etc...
@@ -439,8 +433,8 @@ public class TestMultiSearcher extends L
     }
     
     public void testCreateDocFrequencyMap() throws IOException{
-      Directory dir1 = newDirectory(random);
-      Directory dir2 = newDirectory(random);
+      Directory dir1 = newDirectory();
+      Directory dir2 = newDirectory();
       Term template = new Term("contents") ;
       String[] contents  = {"a", "b", "c"};
       HashSet<Term> termsSet = new HashSet<Term>();

Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestMultiSearcherRanking.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestMultiSearcherRanking.java?rev=995863&r1=995862&r2=995863&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestMultiSearcherRanking.java (original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestMultiSearcherRanking.java Fri Sep 10 16:49:41 2010
@@ -26,7 +26,6 @@ import org.apache.lucene.queryParser.Par
 import org.apache.lucene.queryParser.QueryParser;
 import org.apache.lucene.store.Directory;
 import java.io.IOException;
-import java.util.Random;
 
 /**
  * Tests {@link MultiSearcher} ranking, i.e. makes sure this bug is fixed:
@@ -110,14 +109,13 @@ public class TestMultiSearcherRanking ex
   @Override
   protected void setUp() throws Exception {
     super.setUp();
-    Random random = newRandom();
     // create MultiSearcher from two seperate searchers
-    d1 = newDirectory(random);
-    IndexWriter iw1 = new IndexWriter(d1, newIndexWriterConfig(random, TEST_VERSION_CURRENT, new StandardAnalyzer(TEST_VERSION_CURRENT)));
+    d1 = newDirectory();
+    IndexWriter iw1 = new IndexWriter(d1, newIndexWriterConfig(TEST_VERSION_CURRENT, new StandardAnalyzer(TEST_VERSION_CURRENT)));
     addCollection1(iw1);
     iw1.close();
-    d2 = newDirectory(random);
-    IndexWriter iw2 = new IndexWriter(d2, newIndexWriterConfig(random, TEST_VERSION_CURRENT, new StandardAnalyzer(TEST_VERSION_CURRENT)));
+    d2 = newDirectory();
+    IndexWriter iw2 = new IndexWriter(d2, newIndexWriterConfig(TEST_VERSION_CURRENT, new StandardAnalyzer(TEST_VERSION_CURRENT)));
     addCollection2(iw2);
     iw2.close();
 
@@ -127,8 +125,8 @@ public class TestMultiSearcherRanking ex
     multiSearcher = new MultiSearcher(s);
 
     // create IndexSearcher which contains all documents
-    d = newDirectory(random);
-    IndexWriter iw = new IndexWriter(d, newIndexWriterConfig(random, TEST_VERSION_CURRENT, new StandardAnalyzer(TEST_VERSION_CURRENT)));
+    d = newDirectory();
+    IndexWriter iw = new IndexWriter(d, newIndexWriterConfig(TEST_VERSION_CURRENT, new StandardAnalyzer(TEST_VERSION_CURRENT)));
     addCollection1(iw);
     addCollection2(iw);
     iw.close();

Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestMultiTermConstantScore.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestMultiTermConstantScore.java?rev=995863&r1=995862&r2=995863&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestMultiTermConstantScore.java (original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestMultiTermConstantScore.java Fri Sep 10 16:49:41 2010
@@ -54,8 +54,8 @@ public class TestMultiTermConstantScore 
         "B   2   4 5 6", "Y     3   5 6", null, "C     3     6",
         "X       4 5 6" };
 
-    small = newDirectory(rand);
-    RandomIndexWriter writer = new RandomIndexWriter(rand, small, new WhitespaceAnalyzer(TEST_VERSION_CURRENT));
+    small = newDirectory();
+    RandomIndexWriter writer = new RandomIndexWriter(random, small, new WhitespaceAnalyzer(TEST_VERSION_CURRENT));
 
     for (int i = 0; i < data.length; i++) {
       Document doc = new Document();
@@ -608,8 +608,8 @@ public class TestMultiTermConstantScore 
   public void testFarsi() throws Exception {
 
     /* build an index */
-    Directory farsiIndex = newDirectory(rand);
-    RandomIndexWriter writer = new RandomIndexWriter(rand, farsiIndex, new SimpleAnalyzer(TEST_VERSION_CURRENT));
+    Directory farsiIndex = newDirectory();
+    RandomIndexWriter writer = new RandomIndexWriter(random, farsiIndex, new SimpleAnalyzer(TEST_VERSION_CURRENT));
     Document doc = new Document();
     doc.add(new Field("content", "\u0633\u0627\u0628", Field.Store.YES,
         Field.Index.NOT_ANALYZED));
@@ -648,8 +648,8 @@ public class TestMultiTermConstantScore 
   public void testDanish() throws Exception {
 
     /* build an index */
-    Directory danishIndex = newDirectory(rand);
-    RandomIndexWriter writer = new RandomIndexWriter(rand, danishIndex, new SimpleAnalyzer(TEST_VERSION_CURRENT));
+    Directory danishIndex = newDirectory();
+    RandomIndexWriter writer = new RandomIndexWriter(random, danishIndex, new SimpleAnalyzer(TEST_VERSION_CURRENT));
 
     // Danish collation orders the words below in the given order
     // (example taken from TestSort.testInternationalSort() ).

Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestMultiThreadTermVectors.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestMultiThreadTermVectors.java?rev=995863&r1=995862&r2=995863&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestMultiThreadTermVectors.java (original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestMultiThreadTermVectors.java Fri Sep 10 16:49:41 2010
@@ -27,7 +27,6 @@ import org.apache.lucene.store.Directory
 import org.apache.lucene.util.English;
 
 import java.io.IOException;
-import java.util.Random;
 
 public class TestMultiThreadTermVectors extends LuceneTestCase {
   private Directory directory;
@@ -41,9 +40,8 @@ public class TestMultiThreadTermVectors 
   @Override
   protected void setUp() throws Exception {
     super.setUp();
-    Random random = newRandom();
-    directory = newDirectory(random);
-    IndexWriter writer = new IndexWriter(directory, newIndexWriterConfig(random, TEST_VERSION_CURRENT, new SimpleAnalyzer(TEST_VERSION_CURRENT)));
+    directory = newDirectory();
+    IndexWriter writer = new IndexWriter(directory, newIndexWriterConfig(TEST_VERSION_CURRENT, new SimpleAnalyzer(TEST_VERSION_CURRENT)));
     //writer.setUseCompoundFile(false);
     //writer.infoStream = System.out;
     for (int i = 0; i < numDocs; i++) {

Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestMultiValuedNumericRangeQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestMultiValuedNumericRangeQuery.java?rev=995863&r1=995862&r2=995863&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestMultiValuedNumericRangeQuery.java (original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestMultiValuedNumericRangeQuery.java Fri Sep 10 16:49:41 2010
@@ -17,7 +17,6 @@ package org.apache.lucene.search;
  * limitations under the License.
  */
 
-import java.util.Random;
 import java.util.Locale;
 import java.text.DecimalFormat;
 import java.text.DecimalFormatSymbols;
@@ -38,18 +37,16 @@ public class TestMultiValuedNumericRange
    * do not interfere with multiple numeric values.
    */
   public void testMultiValuedNRQ() throws Exception {
-    final Random rnd = newRandom();
-
-    Directory directory = newDirectory(rnd);
-    RandomIndexWriter writer = new RandomIndexWriter(rnd, directory);
+    Directory directory = newDirectory();
+    RandomIndexWriter writer = new RandomIndexWriter(random, directory);
     
     DecimalFormat format = new DecimalFormat("00000000000", new DecimalFormatSymbols(Locale.US));
     
     int num = 5000 * RANDOM_MULTIPLIER;
     for (int l = 0; l < num; l++) {
       Document doc = new Document();
-      for (int m=0, c=rnd.nextInt(10); m<=c; m++) {
-        int value = rnd.nextInt(Integer.MAX_VALUE);
+      for (int m=0, c=random.nextInt(10); m<=c; m++) {
+        int value = random.nextInt(Integer.MAX_VALUE);
         doc.add(new Field("asc", format.format(value), Field.Store.NO, Field.Index.NOT_ANALYZED));
         doc.add(new NumericField("trie", Field.Store.NO, true).setIntValue(value));
       }
@@ -61,8 +58,8 @@ public class TestMultiValuedNumericRange
     Searcher searcher=new IndexSearcher(reader);
     num = 50 * RANDOM_MULTIPLIER;
     for (int i = 0; i < num; i++) {
-      int lower=rnd.nextInt(Integer.MAX_VALUE);
-      int upper=rnd.nextInt(Integer.MAX_VALUE);
+      int lower=random.nextInt(Integer.MAX_VALUE);
+      int upper=random.nextInt(Integer.MAX_VALUE);
       if (lower>upper) {
         int a=lower; lower=upper; upper=a;
       }

Modified: lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestNot.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestNot.java?rev=995863&r1=995862&r2=995863&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestNot.java (original)
+++ lucene/dev/branches/branch_3x/lucene/src/test/org/apache/lucene/search/TestNot.java Fri Sep 10 16:49:41 2010
@@ -17,8 +17,6 @@ package org.apache.lucene.search;
  * limitations under the License.
  */
 
-import java.util.Random;
-
 import org.apache.lucene.util.LuceneTestCase;
 
 import org.apache.lucene.index.IndexReader;
@@ -40,8 +38,7 @@ public class TestNot extends LuceneTestC
   }
 
   public void testNot() throws Exception {
-    Random random = newRandom();
-    Directory store = newDirectory(random);
+    Directory store = newDirectory();
     RandomIndexWriter writer = new RandomIndexWriter(random, store);
 
     Document d1 = new Document();



Mime
View raw message