the test for getFieldNames(boolean) was not correct

CVS: ----------------------------------------------------------------------
CVS: PR:
CVS:   If this change addresses a PR in the problem report tracking
CVS:   database, then enter the PR number(s) here.
CVS: Obtained from:
CVS:   If this change has been taken from another system, such as NCSA,
CVS:   then name the system in this line, otherwise delete it.
CVS: Submitted by:
CVS:   If this code has been contributed to Apache by someone else; i.e.,
CVS:   they sent us a patch or a new module, then include their name/email
CVS:   address here. If this is your work then delete this line.
CVS: Reviewed by:
CVS:   If we are doing pre-commit code reviews and someone else has
CVS:   reviewed your changes, include their name(s) here.
CVS:   If you have not had it reviewed then delete this line.


git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@150379 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Daniel Naber 2004-08-01 22:55:12 +00:00
parent 986934c44d
commit c5e21fb418
1 changed files with 11 additions and 8 deletions

View File

@ -83,6 +83,7 @@ public class TestIndexReader extends TestCase
// verify fields again
reader = IndexReader.open(d);
fieldNames = reader.getFieldNames();
assertEquals(9, fieldNames.size()); // the following fields + an empty one (bug?!)
assertTrue(fieldNames.contains("keyword"));
assertTrue(fieldNames.contains("text"));
assertTrue(fieldNames.contains("unindexed"));
@ -94,17 +95,19 @@ public class TestIndexReader extends TestCase
// verify that only indexed fields were returned
Collection indexedFieldNames = reader.getFieldNames(true);
assertTrue(fieldNames.contains("keyword"));
assertTrue(fieldNames.contains("text"));
assertTrue(fieldNames.contains("unstored"));
assertTrue(fieldNames.contains("keyword2"));
assertTrue(fieldNames.contains("text2"));
assertTrue(fieldNames.contains("unindexed2"));
assertTrue(fieldNames.contains("unstored2"));
assertEquals(6, indexedFieldNames.size());
assertTrue(indexedFieldNames.contains("keyword"));
assertTrue(indexedFieldNames.contains("text"));
assertTrue(indexedFieldNames.contains("unstored"));
assertTrue(indexedFieldNames.contains("keyword2"));
assertTrue(indexedFieldNames.contains("text2"));
assertTrue(indexedFieldNames.contains("unstored2"));
// verify that only unindexed fields were returned
Collection unindexedFieldNames = reader.getFieldNames(false);
assertTrue(fieldNames.contains("unindexed"));
assertEquals(3, unindexedFieldNames.size()); // the following fields + an empty one
assertTrue(unindexedFieldNames.contains("unindexed"));
assertTrue(unindexedFieldNames.contains("unindexed2"));
}