From 102ece7710eab541afa68c7614151f361a3692fa Mon Sep 17 00:00:00 2001 From: Uwe Schindler Date: Mon, 9 Apr 2012 15:32:08 +0000 Subject: [PATCH] LUCENE-3969: More cleanups git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene3969@1311282 13f79535-47bb-0310-9956-ffa450edef68 --- .../analysis/core/TestRandomChains.java | 42 +++++++++++-------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestRandomChains.java b/modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestRandomChains.java index 9b9b630d882..31fb5f24797 100644 --- a/modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestRandomChains.java +++ b/modules/analysis/common/src/test/org/apache/lucene/analysis/core/TestRandomChains.java @@ -88,6 +88,29 @@ public class TestRandomChains extends BaseTokenStreamTestCase { static List> tokenfilters; static List> charfilters; + // TODO: fix those and remove + private static final Set> brokenComponents = Collections.newSetFromMap(new IdentityHashMap,Boolean>()); + static { + Collections.>addAll(brokenComponents, + // TODO: fix basetokenstreamtestcase not to trip because this one has no CharTermAtt + EmptyTokenizer.class, + // doesn't actual reset itself! + CachingTokenFilter.class, + // nocommit: corrumpts graphs (offset consistency check) + PositionFilter.class, + // doesn't consume whole stream! + LimitTokenCountFilter.class, + // broken! + NGramTokenizer.class, + // broken! + NGramTokenFilter.class, + // broken! + EdgeNGramTokenizer.class, + // broken! + EdgeNGramTokenFilter.class + ); + } + @BeforeClass public static void beforeClass() throws Exception { List> analysisClasses = new ArrayList>(); @@ -103,22 +126,7 @@ public class TestRandomChains extends BaseTokenStreamTestCase { || c.isAnnotationPresent(Deprecated.class) || c.isSynthetic() || c.isAnonymousClass() || c.isMemberClass() || c.isInterface() || !(Tokenizer.class.isAssignableFrom(c) || TokenFilter.class.isAssignableFrom(c) || CharStream.class.isAssignableFrom(c)) - // TODO: fix basetokenstreamtestcase not to trip because this one has no CharTermAtt - || c == EmptyTokenizer.class - // doesn't actual reset itself! - || c == CachingTokenFilter.class - // nocommit: corrumpts graphs (offset consistency check) - || c == PositionFilter.class - // doesn't consume whole stream! - || c == LimitTokenCountFilter.class - // broken! - || c == NGramTokenizer.class - // broken! - || c == NGramTokenFilter.class - // broken! - || c == EdgeNGramTokenizer.class - // broken! - || c == EdgeNGramTokenFilter.class + || brokenComponents.contains(c) ) { continue; } @@ -657,7 +665,7 @@ public class TestRandomChains extends BaseTokenStreamTestCase { int numIterations = atLeast(20); for (int i = 0; i < numIterations; i++) { MockRandomAnalyzer a = new MockRandomAnalyzer(random.nextLong()); - if (true || VERBOSE) { + if (VERBOSE) { System.out.println("Creating random analyzer:" + a); } try {