1 package org.apache.lucene.index.store; 2 3 import junit.framework.TestCase; 4 import org.apache.lucene.store.FSDirectory; 5 import java.io.IOException ; 6 7 abstract public class FSDirectoryTestCase extends TestCase { 8 private FSDirectory directory; 9 10 protected final FSDirectory getDirectory() throws IOException { 11 return getDirectory(false); 12 } 13 14 protected final FSDirectory getDirectory(boolean create) throws IOException { 15 if (directory == null) { 16 directory = FSDirectory.getDirectory(System.getProperty("test.index.dir"), create); 17 } 18 19 return directory; 20 } 21 } 22 | Popular Tags |