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:55:59 UTC

svn commit: r1586303 - in /lucene/dev/branches/branch_4x: ./ lucene/ lucene/core/ lucene/core/src/test/org/apache/lucene/util/junitcompat/TestFailOnFieldCacheInsanity.java

Author: uschindler
Date: Thu Apr 10 13:55:59 2014
New Revision: 1586303

URL: http://svn.apache.org/r1586303
Log:
Merged revision(s) 1586301 from lucene/dev/trunk:
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/branches/branch_4x/   (props changed)
    lucene/dev/branches/branch_4x/lucene/   (props changed)
    lucene/dev/branches/branch_4x/lucene/core/   (props changed)
    lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/util/junitcompat/TestFailOnFieldCacheInsanity.java

Modified: lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/util/junitcompat/TestFailOnFieldCacheInsanity.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/util/junitcompat/TestFailOnFieldCacheInsanity.java?rev=1586303&r1=1586302&r2=1586303&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/util/junitcompat/TestFailOnFieldCacheInsanity.java (original)
+++ lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/util/junitcompat/TestFailOnFieldCacheInsanity.java Thu Apr 10 13:55:59 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);