mirror of https://github.com/apache/lucene.git
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:
parent
6ab7c91c83
commit
b0706ed6b6
|
@ -111,6 +111,7 @@ public abstract class BaseTokenStreamTestCase extends LuceneTestCase {
|
||||||
|
|
||||||
ts.reset();
|
ts.reset();
|
||||||
for (int i = 0; i < output.length; i++) {
|
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());
|
assertTrue("token "+i+" exists", ts.incrementToken());
|
||||||
assertEquals("term "+i, output[i], termAtt.term());
|
assertEquals("term "+i, output[i], termAtt.term());
|
||||||
if (startOffsets != null)
|
if (startOffsets != null)
|
||||||
|
@ -123,6 +124,7 @@ public abstract class BaseTokenStreamTestCase extends LuceneTestCase {
|
||||||
assertEquals("posIncrement "+i, posIncrements[i], posIncrAtt.getPositionIncrement());
|
assertEquals("posIncrement "+i, posIncrements[i], posIncrAtt.getPositionIncrement());
|
||||||
}
|
}
|
||||||
assertFalse("end of stream", ts.incrementToken());
|
assertFalse("end of stream", ts.incrementToken());
|
||||||
|
ts.end();
|
||||||
ts.close();
|
ts.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue