@Test
public void testNoRetainableAttributes() throws IOException, FacetException {
Directory directory = newDirectory();
TaxonomyWriter taxonomyWriter = new DirectoryTaxonomyWriter(directory);
new CategoryParentsStream(new CategoryAttributesStream(categoryContainer),
taxonomyWriter, new DefaultFacetIndexingParams());
// add DummyAttribute, but do not retain, only one expected
categoryContainer.addCategory(initialCatgeories[0], new DummyProperty());
CategoryParentsStream stream = new CategoryParentsStream(new CategoryAttributesStream(
categoryContainer), taxonomyWriter,
new DefaultFacetIndexingParams());
int nAttributes = 0;
while (stream.incrementToken()) {
if (stream.categoryAttribute.getProperty(DummyProperty.class) != null) {
nAttributes++;
}
}
assertEquals("Wrong number of tokens with attributes", 1, nAttributes);