From 0f99c02ee5926e4a4a1cb03b35ed039df7cbe1ff Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Sun, 21 Feb 2010 10:40:57 +0000 Subject: [PATCH] LUCENE-1844: speed up TestNorms git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@912328 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/lucene/index/TestNorms.java | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/test/org/apache/lucene/index/TestNorms.java b/src/test/org/apache/lucene/index/TestNorms.java index 1a61f012e60..17d789117f1 100755 --- a/src/test/org/apache/lucene/index/TestNorms.java +++ b/src/test/org/apache/lucene/index/TestNorms.java @@ -28,7 +28,7 @@ import org.apache.lucene.document.Field.Store; 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 @@ public class TestNorms extends LuceneTestCase { * 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(); modifiedNorms = new ArrayList(); @@ -100,15 +92,13 @@ public class TestNorms extends LuceneTestCase { modifiedNorms = new ArrayList(); 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);