Skip to content

Apache Lucene open-source search software

test case cleanup

Erik Hatcherf8ab04f44e66
diff --git a/sandbox/contributions/ant/src/test/org/apache/lucene/ant/IndexTaskTest.java b/sandbox/contributions/ant/src/test/org/apache/lucene/ant/IndexTaskTest.java
index 8357c92c962..a8bc52d1df5 100644
--- a/sandbox/contributions/ant/src/test/org/apache/lucene/ant/IndexTaskTest.java
+++ b/sandbox/contributions/ant/src/test/org/apache/lucene/ant/IndexTaskTest.java
@@ -8,7 +8,6 @@ import junit.framework.TestCase;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.StopAnalyzer;
-import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.queryParser.QueryParser;
import org.apache.lucene.search.Hits;
import org.apache.lucene.search.IndexSearcher;
@@ -30,27 +29,17 @@ public class IndexTaskTest extends TestCase {
private String docsDir = System.getProperty("docs.dir");
private String indexDir = System.getProperty("index.dir");
-
+
private Searcher searcher;
private Analyzer analyzer;
- /**
- * Constructor for the IndexTaskTest object
- *
- *@param name Description of Parameter
- */
- public IndexTaskTest(String name) {
- super(name);
- }
-
-
/**
* The JUnit setup method
*
*@exception IOException Description of Exception
*/
- public void setUp() throws IOException {
+ public void setUp() throws Exception {
Project project = new Project();
IndexTask task = new IndexTask();
@@ -68,16 +57,11 @@ public class IndexTaskTest extends TestCase {
}
- /**
- * A unit test for JUnit
- */
- public void testSearch() throws IOException, ParseException {
- System.out.println("sysout");
- System.err.println("syserr");
+ public void testSearch() throws Exception {
Query query = QueryParser.parse("test", "contents", analyzer);
Hits hits = searcher.search(query);
-
+
assertEquals("Find document(s)", 2, hits.length());
}