LUCENE-2398: allow this test to work from eclipse too, simplify build some more

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@935048 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2010-04-16 19:16:31 +00:00
parent 605656e960
commit 90a0edacca
2 changed files with 3 additions and 7 deletions

View File

@ -441,10 +441,6 @@
<sysproperty key="lucene.version" value="${dev.version}"/> <sysproperty key="lucene.version" value="${dev.version}"/>
<!-- contrib/ant IndexTaskTest needs these two system properties -->
<sysproperty key="docs.dir" file="src/test"/>
<sysproperty key="index.dir" file="${build.dir}/test/index"/>
<!-- contrib/benchmark uses this system property to locate docs data and defined tasks --> <!-- contrib/benchmark uses this system property to locate docs data and defined tasks -->
<sysproperty key="tasks.dir" file="${build.dir}/classes/java/org/apache/lucene/benchmark/byTask/tasks"/> <sysproperty key="tasks.dir" file="${build.dir}/classes/java/org/apache/lucene/benchmark/byTask/tasks"/>
<sysproperty key="benchmark.work.dir" file="@{tempDir}/@{pattern}"/> <sysproperty key="benchmark.work.dir" file="@{tempDir}/@{pattern}"/>

View File

@ -39,9 +39,6 @@ public class IndexTaskTest extends LuceneTestCase {
private final static String docHandler = private final static String docHandler =
"org.apache.lucene.ant.FileExtensionDocumentHandler"; "org.apache.lucene.ant.FileExtensionDocumentHandler";
private String docsDir = System.getProperty("docs.dir");
private File indexDir = new File(System.getProperty("index.dir"));
private Searcher searcher; private Searcher searcher;
private Analyzer analyzer; private Analyzer analyzer;
private FSDirectory dir; private FSDirectory dir;
@ -55,6 +52,9 @@ public class IndexTaskTest extends LuceneTestCase {
@Override @Override
protected void setUp() throws Exception { protected void setUp() throws Exception {
super.setUp(); super.setUp();
// slightly hackish way to get the src/test dir
String docsDir = getDataFile("test.txt").getParent();
File indexDir = TEMP_DIR;
Project project = new Project(); Project project = new Project();
IndexTask task = new IndexTask(); IndexTask task = new IndexTask();