mirror of https://github.com/apache/lucene.git
small cleanup only: imports; no need for try...catch(...) { fail(); } in a test case
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@543216 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
11dfdad8ab
commit
42c3d11f07
|
@ -1,22 +1,23 @@
|
|||
package org.apache.lucene.search.spell;
|
||||
|
||||
|
||||
import junit.framework.*;
|
||||
import org.apache.lucene.store.RAMDirectory;
|
||||
import org.apache.lucene.index.IndexWriter;
|
||||
import org.apache.lucene.analysis.SimpleAnalyzer;
|
||||
import org.apache.lucene.document.Document;
|
||||
import org.apache.lucene.util.English;
|
||||
import org.apache.lucene.document.Field;
|
||||
import org.apache.lucene.index.IndexReader;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.apache.lucene.analysis.SimpleAnalyzer;
|
||||
import org.apache.lucene.document.Document;
|
||||
import org.apache.lucene.document.Field;
|
||||
import org.apache.lucene.index.CorruptIndexException;
|
||||
import org.apache.lucene.index.IndexReader;
|
||||
import org.apache.lucene.index.IndexWriter;
|
||||
import org.apache.lucene.store.Directory;
|
||||
import org.apache.lucene.store.RAMDirectory;
|
||||
import org.apache.lucene.util.English;
|
||||
|
||||
|
||||
/**
|
||||
* Test case
|
||||
* Spell checker test case
|
||||
*
|
||||
* @author Nicolas Maisonneuve
|
||||
*/
|
||||
|
@ -45,8 +46,7 @@ public class TestSpellChecker extends TestCase {
|
|||
}
|
||||
|
||||
|
||||
public void testBuild() {
|
||||
try {
|
||||
public void testBuild() throws CorruptIndexException, IOException {
|
||||
IndexReader r = IndexReader.open(userindex);
|
||||
|
||||
spellChecker.clearIndex();
|
||||
|
@ -93,12 +93,7 @@ public class TestSpellChecker extends TestCase {
|
|||
|
||||
similar = spellChecker.suggestSimilar("tousand", 10, r, "field2", false);
|
||||
assertEquals(1, similar.length); // there is the term thousand in the field field2
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
fail();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void addwords(IndexReader r, String field) throws IOException {
|
||||
long time = System.currentTimeMillis();
|
||||
|
@ -115,4 +110,5 @@ public class TestSpellChecker extends TestCase {
|
|||
rs.close();
|
||||
return num;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue