fix test to properly checkindex and to avoid NRTCachingDir

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1401169 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2012-10-23 06:01:13 +00:00
parent 5079f039e5
commit db2e268bec
1 changed files with 3 additions and 12 deletions

View File

@ -21,7 +21,7 @@ import org.apache.lucene.analysis.MockAnalyzer;
import org.apache.lucene.document.Document; import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field; import org.apache.lucene.document.Field;
import org.apache.lucene.document.FieldType; import org.apache.lucene.document.FieldType;
import org.apache.lucene.store.BaseDirectoryWrapper; import org.apache.lucene.store.MMapDirectory;
import org.apache.lucene.store.MockDirectoryWrapper; import org.apache.lucene.store.MockDirectoryWrapper;
import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.LuceneTestCase;
@ -41,11 +41,8 @@ public class Test4GBStoredFields extends LuceneTestCase {
@Nightly @Nightly
public void test() throws Exception { public void test() throws Exception {
BaseDirectoryWrapper dir = newFSDirectory(_TestUtil.getTempDir("4GBStoredFields")); MockDirectoryWrapper dir = new MockDirectoryWrapper(random(), new MMapDirectory(_TestUtil.getTempDir("4GBStoredFields")));
if (dir instanceof MockDirectoryWrapper) { dir.setThrottling(MockDirectoryWrapper.Throttling.NEVER);
((MockDirectoryWrapper)dir).setThrottling(MockDirectoryWrapper.Throttling.NEVER);
}
dir.setCheckIndexOnClose(false); // don't double-checkindex
IndexWriter w = new IndexWriter(dir, IndexWriter w = new IndexWriter(dir,
new IndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random())) new IndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random()))
@ -100,12 +97,6 @@ public class Test4GBStoredFields extends LuceneTestCase {
} }
} }
CheckIndex ci = new CheckIndex(dir);
if (VERBOSE) {
ci.setInfoStream(System.out);
}
ci.checkIndex();
DirectoryReader rd = DirectoryReader.open(dir); DirectoryReader rd = DirectoryReader.open(dir);
StoredDocument sd = rd.document(numDocs - 1); StoredDocument sd = rd.document(numDocs - 1);
assertNotNull(sd); assertNotNull(sd);