KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > lucene > index > store > FSDirectoryTestCase


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 JavaDoc;
6
7 abstract public class FSDirectoryTestCase extends TestCase {
8   private FSDirectory directory;
9
10   protected final FSDirectory getDirectory() throws IOException JavaDoc {
11     return getDirectory(false);
12   }
13
14   protected final FSDirectory getDirectory(boolean create) throws IOException JavaDoc {
15     if (directory == null) {
16       directory = FSDirectory.getDirectory(System.getProperty("test.index.dir"), create);
17     }
18
19     return directory;
20   }
21 }
22
Popular Tags