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:
Simon Willnauer 2012-01-10 12:46:38 +00:00
parent f19317d318
commit 3b8458f6de
3 changed files with 9 additions and 8 deletions

View File

@ -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());

View File

@ -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);
}
/**

View File

@ -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();