Skip to content

Commit f8842d5

Browse files
imotovkimchy
authored andcommitted
lucene 4: fix TokenFilterTests
1 parent 98eb97a commit f8842d5

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/test/java/org/apache/lucene/analysis/miscellaneous/TruncateTokenFilterTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ protected TokenStreamComponents createComponents(String fieldName,
4949
};
5050

5151
TokenStream test = analyzer.tokenStream("test", new StringReader("a bb ccc dddd eeeee"));
52+
test.reset();
5253
CharTermAttribute termAttribute = test.addAttribute(CharTermAttribute.class);
5354
assertThat(test.incrementToken(), equalTo(true));
5455
assertThat(termAttribute.toString(), equalTo("a"));

src/test/java/org/apache/lucene/analysis/miscellaneous/UniqueTokenFilterTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ protected TokenStreamComponents createComponents(String fieldName,
4949
};
5050

5151
TokenStream test = analyzer.tokenStream("test", new StringReader("this test with test"));
52+
test.reset();
5253
CharTermAttribute termAttribute = test.addAttribute(CharTermAttribute.class);
5354
assertThat(test.incrementToken(), equalTo(true));
5455
assertThat(termAttribute.toString(), equalTo("this"));

0 commit comments

Comments
 (0)