From 9ee1dcf40aa0a51099a97afdb3734c54944b1cdb Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Thu, 1 May 2014 12:04:38 +0000 Subject: [PATCH] LUCENE-5635: don't try to use CrankyTokenFilter in TestRandomChains git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1591629 13f79535-47bb-0310-9956-ffa450edef68 --- .../test/org/apache/lucene/analysis/core/TestRandomChains.java | 3 +++ .../src/java/org/apache/lucene/analysis/CrankyTokenFilter.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestRandomChains.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestRandomChains.java index 53427451510..06d80a2995d 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestRandomChains.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestRandomChains.java @@ -47,6 +47,7 @@ import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.BaseTokenStreamTestCase; import org.apache.lucene.analysis.CachingTokenFilter; import org.apache.lucene.analysis.CharFilter; +import org.apache.lucene.analysis.CrankyTokenFilter; import org.apache.lucene.analysis.MockGraphTokenFilter; import org.apache.lucene.analysis.MockRandomLookaheadTokenFilter; import org.apache.lucene.analysis.MockTokenFilter; @@ -141,6 +142,8 @@ public class TestRandomChains extends BaseTokenStreamTestCase { // offsets offenders? // doesn't actual reset itself! CachingTokenFilter.class, + // Not broken, simulates brokenness: + CrankyTokenFilter.class, // Not broken: we forcefully add this, so we shouldn't // also randomly pick it: ValidatingTokenFilter.class)) { diff --git a/lucene/test-framework/src/java/org/apache/lucene/analysis/CrankyTokenFilter.java b/lucene/test-framework/src/java/org/apache/lucene/analysis/CrankyTokenFilter.java index 873b21b4934..62fc6332e3b 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/analysis/CrankyTokenFilter.java +++ b/lucene/test-framework/src/java/org/apache/lucene/analysis/CrankyTokenFilter.java @@ -26,7 +26,7 @@ import java.util.Random; * This can be used to simulate a buggy analyzer in IndexWriter, * where we must delete the document but not abort everything in the buffer. */ -public class CrankyTokenFilter extends TokenFilter { +public final class CrankyTokenFilter extends TokenFilter { final Random random; int thingToDo;