mirror of https://github.com/apache/lucene.git
use TEST_VERSION_CURRENT instead of 4_0 in test
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1229523 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f19317d318
commit
3b8458f6de
|
@ -1,6 +1,6 @@
|
|||
package org.apache.lucene.analysis.hunspell;
|
||||
|
||||
/*
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
|
@ -17,6 +17,7 @@ package org.apache.lucene.analysis.hunspell;
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import org.apache.lucene.util.LuceneTestCase;
|
||||
import org.apache.lucene.util.Version;
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -26,14 +27,14 @@ import java.text.ParseException;
|
|||
|
||||
import static junit.framework.Assert.assertEquals;
|
||||
|
||||
public class HunspellDictionaryTest {
|
||||
public class HunspellDictionaryTest extends LuceneTestCase {
|
||||
|
||||
@Test
|
||||
public void testHunspellDictionary_loadDicAff() throws IOException, ParseException {
|
||||
InputStream affixStream = getClass().getResourceAsStream("test.aff");
|
||||
InputStream dictStream = getClass().getResourceAsStream("test.dic");
|
||||
|
||||
HunspellDictionary dictionary = new HunspellDictionary(affixStream, dictStream, Version.LUCENE_40);
|
||||
HunspellDictionary dictionary = new HunspellDictionary(affixStream, dictStream, TEST_VERSION_CURRENT);
|
||||
assertEquals(3, dictionary.lookupSuffix(new char[]{'e'}, 0, 1).size());
|
||||
assertEquals(1, dictionary.lookupPrefix(new char[]{'s'}, 0, 1).size());
|
||||
assertEquals(1, dictionary.lookupWord(new char[]{'o', 'l', 'r'}, 0, 3).size());
|
||||
|
|
|
@ -26,7 +26,6 @@ import org.apache.lucene.analysis.BaseTokenStreamTestCase;
|
|||
import org.apache.lucene.analysis.MockTokenizer;
|
||||
import org.apache.lucene.analysis.miscellaneous.KeywordMarkerFilter;
|
||||
import org.apache.lucene.analysis.util.CharArraySet;
|
||||
import org.apache.lucene.util.Version;
|
||||
import org.junit.BeforeClass;
|
||||
|
||||
public class HunspellStemFilterTest extends BaseTokenStreamTestCase {
|
||||
|
@ -40,7 +39,7 @@ public class HunspellStemFilterTest extends BaseTokenStreamTestCase {
|
|||
InputStream affixStream = HunspellStemmerTest.class.getResourceAsStream("test.aff");
|
||||
InputStream dictStream = HunspellStemmerTest.class.getResourceAsStream("test.dic");
|
||||
|
||||
return new HunspellDictionary(affixStream, dictStream, Version.LUCENE_40, ignoreCase);
|
||||
return new HunspellDictionary(affixStream, dictStream, TEST_VERSION_CURRENT, ignoreCase);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package org.apache.lucene.analysis.hunspell;
|
||||
|
||||
/*
|
||||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
|
@ -17,6 +17,7 @@ package org.apache.lucene.analysis.hunspell;
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import org.apache.lucene.util.LuceneTestCase;
|
||||
import org.apache.lucene.util.Version;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
|
@ -28,7 +29,7 @@ import java.util.List;
|
|||
|
||||
import static junit.framework.Assert.assertEquals;
|
||||
|
||||
public class HunspellStemmerTest {
|
||||
public class HunspellStemmerTest extends LuceneTestCase {
|
||||
|
||||
private static HunspellStemmer stemmer;
|
||||
|
||||
|
@ -116,7 +117,7 @@ public class HunspellStemmerTest {
|
|||
InputStream affixStream = HunspellStemmerTest.class.getResourceAsStream("test.aff");
|
||||
InputStream dictStream = HunspellStemmerTest.class.getResourceAsStream("test.dic");
|
||||
|
||||
HunspellDictionary dictionary = new HunspellDictionary(affixStream, dictStream, Version.LUCENE_40, ignoreCase);
|
||||
HunspellDictionary dictionary = new HunspellDictionary(affixStream, dictStream, TEST_VERSION_CURRENT, ignoreCase);
|
||||
stemmer = new HunspellStemmer(dictionary);
|
||||
|
||||
affixStream.close();
|
||||
|
|
Loading…
Reference in New Issue