consolidate assumes in ThaiAnalyzer test so we don't miss it for individual tests

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1212141 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2011-12-08 21:47:12 +00:00
parent 6a205c57ff
commit 9b15b1d3b0
1 changed files with 5 additions and 8 deletions

View File

@ -31,11 +31,15 @@ import org.apache.lucene.util.Version;
public class TestThaiAnalyzer extends BaseTokenStreamTestCase {
@Override
public void setUp() throws Exception {
super.setUp();
assumeTrue("JRE does not support Thai dictionary-based BreakIterator", ThaiWordFilter.DBBI_AVAILABLE);
}
/*
* testcase for offsets
*/
public void testOffsets() throws Exception {
assumeTrue("JRE does not support Thai dictionary-based BreakIterator", ThaiWordFilter.DBBI_AVAILABLE);
assertAnalyzesTo(new ThaiAnalyzer(TEST_VERSION_CURRENT), "การที่ได้ต้องแสดงว่างานดี",
new String[] { "การ", "ที่", "ได้", "ต้อง", "แสดง", "ว่า", "งาน", "ดี" },
new int[] { 0, 3, 6, 9, 13, 17, 20, 23 },
@ -43,7 +47,6 @@ public class TestThaiAnalyzer extends BaseTokenStreamTestCase {
}
public void testTokenType() throws Exception {
assumeTrue("JRE does not support Thai dictionary-based BreakIterator", ThaiWordFilter.DBBI_AVAILABLE);
assertAnalyzesTo(new ThaiAnalyzer(TEST_VERSION_CURRENT), "การที่ได้ต้องแสดงว่างานดี ๑๒๓",
new String[] { "การ", "ที่", "ได้", "ต้อง", "แสดง", "ว่า", "งาน", "ดี", "๑๒๓" },
new String[] { "<SOUTHEAST_ASIAN>", "<SOUTHEAST_ASIAN>",
@ -59,7 +62,6 @@ public class TestThaiAnalyzer extends BaseTokenStreamTestCase {
*/
@Deprecated
public void testBuggyTokenType30() throws Exception {
assumeTrue("JRE does not support Thai dictionary-based BreakIterator", ThaiWordFilter.DBBI_AVAILABLE);
assertAnalyzesTo(new ThaiAnalyzer(Version.LUCENE_30), "การที่ได้ต้องแสดงว่างานดี ๑๒๓",
new String[] { "การ", "ที่", "ได้", "ต้อง", "แสดง", "ว่า", "งาน", "ดี", "๑๒๓" },
new String[] { "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>",
@ -70,7 +72,6 @@ public class TestThaiAnalyzer extends BaseTokenStreamTestCase {
/** @deprecated (3.1) testing backwards behavior */
@Deprecated
public void testAnalyzer30() throws Exception {
assumeTrue("JRE does not support Thai dictionary-based BreakIterator", ThaiWordFilter.DBBI_AVAILABLE);
ThaiAnalyzer analyzer = new ThaiAnalyzer(Version.LUCENE_30);
assertAnalyzesTo(analyzer, "", new String[] {});
@ -96,7 +97,6 @@ public class TestThaiAnalyzer extends BaseTokenStreamTestCase {
* Test that position increments are adjusted correctly for stopwords.
*/
public void testPositionIncrements() throws Exception {
assumeTrue("JRE does not support Thai dictionary-based BreakIterator", ThaiWordFilter.DBBI_AVAILABLE);
final ThaiAnalyzer analyzer = new ThaiAnalyzer(TEST_VERSION_CURRENT);
assertAnalyzesTo(analyzer, "การที่ได้ต้อง the แสดงว่างานดี",
new String[] { "การ", "ที่", "ได้", "ต้อง", "แสดง", "ว่า", "งาน", "ดี" },
@ -113,7 +113,6 @@ public class TestThaiAnalyzer extends BaseTokenStreamTestCase {
}
public void testReusableTokenStream() throws Exception {
assumeTrue("JRE does not support Thai dictionary-based BreakIterator", ThaiWordFilter.DBBI_AVAILABLE);
ThaiAnalyzer analyzer = new ThaiAnalyzer(TEST_VERSION_CURRENT);
assertAnalyzesToReuse(analyzer, "", new String[] {});
@ -131,7 +130,6 @@ public class TestThaiAnalyzer extends BaseTokenStreamTestCase {
/** @deprecated (3.1) for version back compat */
@Deprecated
public void testReusableTokenStream30() throws Exception {
assumeTrue("JRE does not support Thai dictionary-based BreakIterator", ThaiWordFilter.DBBI_AVAILABLE);
ThaiAnalyzer analyzer = new ThaiAnalyzer(Version.LUCENE_30);
assertAnalyzesToReuse(analyzer, "", new String[] {});
@ -153,7 +151,6 @@ public class TestThaiAnalyzer extends BaseTokenStreamTestCase {
// LUCENE-3044
public void testAttributeReuse() throws Exception {
assumeTrue("JRE does not support Thai dictionary-based BreakIterator", ThaiWordFilter.DBBI_AVAILABLE);
ThaiAnalyzer analyzer = new ThaiAnalyzer(Version.LUCENE_30);
// just consume
TokenStream ts = analyzer.tokenStream("dummy", new StringReader("ภาษาไทย"));