store.save(true, false);
for (int index = 0; index < 10; index++) {
try {
treeSupport = (TreeSupport<IntegerContainer>) store
.readAndGetRoot();
treeSupport.add(new IntegerContainer(index));// NOPMD
store.save(true, false);
} catch (final RuntimeException exception) {
logger.fatal(ADDING + index);
throw exception;
} catch (final StoreException exception) {
logger.fatal(ADDING + index);
throw exception;
}
}
treeSupport = (TreeSupport<IntegerContainer>) store.readAndGetRoot();
for (int index = 0; index < 10; index++) {
try {
assertNotNull("must have record for key " + index,
treeSupport.search(new IntegerContainer(index)));// NOPMD
} catch (final RuntimeException exception) {
logger.fatal("searching " + index);
throw exception;
}
}
treeSupport = (TreeSupport<IntegerContainer>) store.readAndGetRoot();
for (int index = 0; index < 10; index++) {
try {
assertNotNull("must have element",
treeSupport.remove(new IntegerContainer(index)));// NOPMD
} catch (final RuntimeException exception) {
logger.fatal("removing " + index);
throw exception;
}
}