List<CategoryPath> longCategory = new ArrayList<CategoryPath>();
longCategory.add(new CategoryPath("one", "two", "three", "four",
"five", "six", "seven"));
DefaultFacetIndexingParams indexingParams = new DefaultFacetIndexingParams();
CategoryTokenizer tokenizer = new CategoryTokenizer(
new CategoryAttributesStream(new CategoryAttributesIterable(
longCategory)), indexingParams);
// count the number of tokens
String categoryTerm = longCategory.get(0).toString(
indexingParams.getFacetDelimChar());
assertTrue("Missing token", tokenizer.incrementToken());
if (!categoryTerm.equals(tokenizer.termAttribute.toString())) {
fail("Unexpected term: " + tokenizer.termAttribute.toString());
}
assertFalse("Unexpected token", tokenizer.incrementToken());
taxonomyWriter.close();
directory.close();
}