You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by us...@apache.org on 2014/04/10 15:52:25 UTC
svn commit: r1586301 -
/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/junitcompat/TestFailOnFieldCacheInsanity.java
Author: uschindler
Date: Thu Apr 10 13:52:25 2014
New Revision: 1586301
URL: http://svn.apache.org/r1586301
Log:
Fix test that fails on Windows if it gets a FSDirectory (it intentionally does not close IW/IR). The new cleanup code then complains about inability to delete the index dir
Modified:
lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/junitcompat/TestFailOnFieldCacheInsanity.java
Modified: lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/junitcompat/TestFailOnFieldCacheInsanity.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/junitcompat/TestFailOnFieldCacheInsanity.java?rev=1586301&r1=1586300&r2=1586301&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/junitcompat/TestFailOnFieldCacheInsanity.java (original)
+++ lucene/dev/trunk/lucene/core/src/test/org/apache/lucene/util/junitcompat/TestFailOnFieldCacheInsanity.java Thu Apr 10 13:52:25 2014
@@ -24,6 +24,8 @@ import org.apache.lucene.index.IndexRead
import org.apache.lucene.index.RandomIndexWriter;
import org.apache.lucene.search.FieldCache;
import org.apache.lucene.store.Directory;
+import org.apache.lucene.store.MockDirectoryWrapper;
+import org.apache.lucene.store.RAMDirectory;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.JUnitCore;
@@ -41,8 +43,10 @@ public class TestFailOnFieldCacheInsanit
private AtomicReader subR;
private void makeIndex() throws Exception {
- d = newDirectory();
- RandomIndexWriter w = new RandomIndexWriter(random(), d);
+ // we use RAMDirectory here, because we dont want to stay on open files on Windows:
+ d = new MockDirectoryWrapper(random(), new RAMDirectory());
+ @SuppressWarnings("resource") RandomIndexWriter w =
+ new RandomIndexWriter(random(), d);
Document doc = new Document();
doc.add(newField("ints", "1", StringField.TYPE_NOT_STORED));
w.addDocument(doc);