*
* @throws FacetException
*/
@Test
public void testAddCategoryAttributeWithProperty() throws FacetException {
CategoryAttribute newCA = new CategoryAttributeImpl(new CategoryPath(
"seven", "eight"));
newCA.addProperty(new DummyProperty());
categoryContainer.addCategory(newCA);
Iterator<CategoryAttribute> iterator = categoryContainer.iterator();
// count the number of tokens, and check there is one DummyAttribute
int nCategories;
int nProperties = 0;
for (nCategories = 0; iterator.hasNext(); nCategories++) {
CategoryAttribute attribute = iterator.next();
if (attribute.getProperty(DummyProperty.class) != null) {
nProperties++;
}
}
assertEquals("Wrong number of tokens", 4, nCategories);
assertEquals("Wrong number of tokens with properties", 1, nProperties);