lucene 4: fix TokenFilterTests
This commit is contained in:
parent
98eb97a1ff
commit
f8842d5a4f
|
@ -49,6 +49,7 @@ public class TruncateTokenFilterTests {
|
||||||
};
|
};
|
||||||
|
|
||||||
TokenStream test = analyzer.tokenStream("test", new StringReader("a bb ccc dddd eeeee"));
|
TokenStream test = analyzer.tokenStream("test", new StringReader("a bb ccc dddd eeeee"));
|
||||||
|
test.reset();
|
||||||
CharTermAttribute termAttribute = test.addAttribute(CharTermAttribute.class);
|
CharTermAttribute termAttribute = test.addAttribute(CharTermAttribute.class);
|
||||||
assertThat(test.incrementToken(), equalTo(true));
|
assertThat(test.incrementToken(), equalTo(true));
|
||||||
assertThat(termAttribute.toString(), equalTo("a"));
|
assertThat(termAttribute.toString(), equalTo("a"));
|
||||||
|
|
|
@ -49,6 +49,7 @@ public class UniqueTokenFilterTests {
|
||||||
};
|
};
|
||||||
|
|
||||||
TokenStream test = analyzer.tokenStream("test", new StringReader("this test with test"));
|
TokenStream test = analyzer.tokenStream("test", new StringReader("this test with test"));
|
||||||
|
test.reset();
|
||||||
CharTermAttribute termAttribute = test.addAttribute(CharTermAttribute.class);
|
CharTermAttribute termAttribute = test.addAttribute(CharTermAttribute.class);
|
||||||
assertThat(test.incrementToken(), equalTo(true));
|
assertThat(test.incrementToken(), equalTo(true));
|
||||||
assertThat(termAttribute.toString(), equalTo("this"));
|
assertThat(termAttribute.toString(), equalTo("this"));
|
||||||
|
|
Loading…
Reference in New Issue