lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rm...@apache.org
Subject svn commit: r912328 - /lucene/java/trunk/src/test/org/apache/lucene/index/TestNorms.java
Date Sun, 21 Feb 2010 10:40:58 GMT
Author: rmuir
Date: Sun Feb 21 10:40:57 2010
New Revision: 912328

URL: http://svn.apache.org/viewvc?rev=912328&view=rev
Log:
LUCENE-1844: speed up TestNorms

Modified:
    lucene/java/trunk/src/test/org/apache/lucene/index/TestNorms.java

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestNorms.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestNorms.java?rev=912328&r1=912327&r2=912328&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestNorms.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestNorms.java Sun Feb 21 10:40:57
2010
@@ -28,7 +28,7 @@
 import org.apache.lucene.search.DefaultSimilarity;
 import org.apache.lucene.search.Similarity;
 import org.apache.lucene.store.Directory;
-import org.apache.lucene.store.FSDirectory;
+import org.apache.lucene.store.RAMDirectory;
 
 import java.io.File;
 import java.io.IOException;
@@ -75,15 +75,7 @@
    * Including optimize. 
    */
   public void testNorms() throws IOException {
-    // tmp dir
-    String tempDir = System.getProperty("java.io.tmpdir");
-    if (tempDir == null) {
-      throw new IOException("java.io.tmpdir undefined, cannot run test");
-    }
-    
-    // test with a single index: index1
-    File indexDir1 = new File(tempDir, "lucenetestindex1");
-    Directory dir1 = FSDirectory.open(indexDir1);
+    Directory dir1 = new RAMDirectory();
 
     norms = new ArrayList<Float>();
     modifiedNorms = new ArrayList<Float>();
@@ -100,15 +92,13 @@
     modifiedNorms = new ArrayList<Float>();
     numDocNorms = 0;
     
-    File indexDir2 = new File(tempDir, "lucenetestindex2");
-    Directory dir2 = FSDirectory.open(indexDir2);
+    Directory dir2 = new RAMDirectory();
 
     createIndex(dir2);
     doTestNorms(dir2);
 
     // add index1 and index2 to a third index: index3
-    File indexDir3 = new File(tempDir, "lucenetestindex3");
-    Directory dir3 = FSDirectory.open(indexDir3);
+    Directory dir3 = new RAMDirectory();
 
     createIndex(dir3);
     IndexWriter iw = new IndexWriter(dir3,anlzr,false, IndexWriter.MaxFieldLength.LIMITED);



Mime
View raw message