From f8842d5a4f2e0871a9991a71a87a9bb99e0e0d2a Mon Sep 17 00:00:00 2001 From: Igor Motov Date: Mon, 5 Nov 2012 08:05:17 -0500 Subject: [PATCH] lucene 4: fix TokenFilterTests --- .../lucene/analysis/miscellaneous/TruncateTokenFilterTests.java | 1 + .../lucene/analysis/miscellaneous/UniqueTokenFilterTests.java | 1 + 2 files changed, 2 insertions(+) diff --git a/src/test/java/org/apache/lucene/analysis/miscellaneous/TruncateTokenFilterTests.java b/src/test/java/org/apache/lucene/analysis/miscellaneous/TruncateTokenFilterTests.java index e7552e30456..9a78a8a07f2 100644 --- a/src/test/java/org/apache/lucene/analysis/miscellaneous/TruncateTokenFilterTests.java +++ b/src/test/java/org/apache/lucene/analysis/miscellaneous/TruncateTokenFilterTests.java @@ -49,6 +49,7 @@ public class TruncateTokenFilterTests { }; TokenStream test = analyzer.tokenStream("test", new StringReader("a bb ccc dddd eeeee")); + test.reset(); CharTermAttribute termAttribute = test.addAttribute(CharTermAttribute.class); assertThat(test.incrementToken(), equalTo(true)); assertThat(termAttribute.toString(), equalTo("a")); diff --git a/src/test/java/org/apache/lucene/analysis/miscellaneous/UniqueTokenFilterTests.java b/src/test/java/org/apache/lucene/analysis/miscellaneous/UniqueTokenFilterTests.java index 97d5b027367..6ea69a6f43f 100644 --- a/src/test/java/org/apache/lucene/analysis/miscellaneous/UniqueTokenFilterTests.java +++ b/src/test/java/org/apache/lucene/analysis/miscellaneous/UniqueTokenFilterTests.java @@ -49,6 +49,7 @@ public class UniqueTokenFilterTests { }; TokenStream test = analyzer.tokenStream("test", new StringReader("this test with test")); + test.reset(); CharTermAttribute termAttribute = test.addAttribute(CharTermAttribute.class); assertThat(test.incrementToken(), equalTo(true)); assertThat(termAttribute.toString(), equalTo("this"));