}
nonTopLevelPaths[i] = new CategoryPath(components);
taxonomy.addCategory(nonTopLevelPaths[i]);
}
// check ordinal policy
PathPolicy pathPolicy = new NonTopLevelPathPolicy();
assertFalse("top level path policy should not match root",
pathPolicy.shouldAdd(new CategoryPath()));
for (int i = 0; i < 10; i++) {
assertFalse("top level path policy should not match "
+ topLevelPaths[i],
pathPolicy.shouldAdd(topLevelPaths[i]));
}
for (int i = 0; i < 300; i++) {
assertTrue("top level path policy should match "
+ nonTopLevelPaths[i],
pathPolicy.shouldAdd(nonTopLevelPaths[i]));
}
taxonomy.close();
dir.close();
}