LUCENE-2144

Warning about descripancy during invalid use of the TermDocs API.

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@889463 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Karl-Johan Wettin 2009-12-10 23:26:37 +00:00
parent 3501d927de
commit f975b84b16
1 changed files with 12 additions and 1 deletions

View File

@ -220,7 +220,18 @@ public class TestIndicesEquals extends TestCase {
// test seek default // test seek default
aprioriTermDocs = aprioriReader.termDocs(); aprioriTermDocs = aprioriReader.termDocs();
testTermDocs = testReader.termDocs(); testTermDocs = testReader.termDocs();
// todo consider seeking and skipping some too
// this is invalid use of the API,
// but if the response differs then it's an indication that something might have changed.
// in 2.9 and 3.0 the two TermDocs-implementations returned different values at this point.
assertEquals("Descripency during invalid use of the TermDocs API, see comments in test code for details.",
aprioriTermDocs.next(), testTermDocs.next());
// start using the API one is supposed to
t = new Term("", "");
aprioriTermDocs.seek(t);
testTermDocs.seek(t);
while (aprioriTermDocs.next()) { while (aprioriTermDocs.next()) {
assertTrue(testTermDocs.next()); assertTrue(testTermDocs.next());