LUCENE-1926: Add an extra clearAttributes in assertTokenStreamContents

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@818913 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2009-09-25 16:34:22 +00:00
parent 6ab7c91c83
commit b0706ed6b6
1 changed files with 2 additions and 0 deletions

View File

@ -111,6 +111,7 @@ public abstract class BaseTokenStreamTestCase extends LuceneTestCase {
ts.reset();
for (int i = 0; i < output.length; i++) {
ts.clearAttributes(); // extra safety to enforce, that the state is not preserved
assertTrue("token "+i+" exists", ts.incrementToken());
assertEquals("term "+i, output[i], termAtt.term());
if (startOffsets != null)
@ -123,6 +124,7 @@ public abstract class BaseTokenStreamTestCase extends LuceneTestCase {
assertEquals("posIncrement "+i, posIncrements[i], posIncrAtt.getPositionIncrement());
}
assertFalse("end of stream", ts.incrementToken());
ts.end();
ts.close();
}