public void testRollback() throws Exception {
// Verifies that if callback is called, DTW is closed.
Directory dir = newDirectory();
DirectoryTaxonomyWriter dtw = new DirectoryTaxonomyWriter(dir);
dtw.addCategory(new CategoryPath("a"));
dtw.rollback();
try {
dtw.addCategory(new CategoryPath("a"));
fail("should not have succeeded to add a category following rollback.");
} catch (AlreadyClosedException e) {
// expected