diff --git a/modules/analysis/common/src/test/org/apache/lucene/analysis/th/TestThaiAnalyzer.java b/modules/analysis/common/src/test/org/apache/lucene/analysis/th/TestThaiAnalyzer.java index 73fa1e324de..185749cc7fd 100644 --- a/modules/analysis/common/src/test/org/apache/lucene/analysis/th/TestThaiAnalyzer.java +++ b/modules/analysis/common/src/test/org/apache/lucene/analysis/th/TestThaiAnalyzer.java @@ -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[] { "", "", @@ -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[] { "", "", "", @@ -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("ภาษาไทย"));