Index: src/test/org/apache/lucene/store/TestDirectory.java =================================================================== --- src/test/org/apache/lucene/store/TestDirectory.java (revision 713425) +++ src/test/org/apache/lucene/store/TestDirectory.java (working copy) @@ -19,6 +19,8 @@ import org.apache.lucene.util.LuceneTestCase; +import java.io.File; + public class TestDirectory extends LuceneTestCase { public void testDetectClose() throws Throwable { @@ -38,5 +40,80 @@ } catch (AlreadyClosedException ace) { } } + + + // Test that different instances of FSDirectory can coexist on the same + // path, can read, write, and lock files. + public void testDirectInstantiation() throws Exception { + File path = new File(System.getProperty("tempDir")); + + int sz = 3; + Directory[] dirs = new Directory[sz]; + + dirs[0] = new FSDirectory(path, null); + dirs[1] = new NIOFSDirectory(path, null); + dirs[2] = new MMapDirectory(path, null); + + for (int i=0; i