logger.log(Level.INFO, "Trying shutdown...");
shutdown(0);
logger.log(Level.INFO, "success, restarting");
}
logger.log(Level.INFO, "Starting to delete entries using iterator");
AdminIterator i;
JavaSpaceAdmin admin;
admin = (JavaSpaceAdmin) ((Administrable) space).getAdmin();
admin =
(JavaSpaceAdmin) getConfig().prepare("test.outriggerAdminPreparer",
admin);
i = admin.contents(aEntry, null, blockingFactor);
int j = 0;
while (next(i) != null) {
delete(i);
j++;
if (j % dotInterval == dotInterval - 1) {
logger.log(Level.INFO, ".");
}
}
if (j < numberToWrite) {
String msg = "\nCould not delete the number of entries we "
+ "wrote, only deleted " + j + " entries";
throw new TestException(msg);
} else if (j > numberToWrite) {
String msg = "\nDeleted more entries than we wrote, deleted "
+ j + " entries";
throw new TestException(msg);
}
logger.log(Level.INFO, "\nFinished deleting, closing iterator");
i.close();
logger.log(Level.INFO,
"Opening new iterator to make sure space is empty");
i = admin.contents(aEntry, null, blockingFactor);
j = 0;
while (next(i) != null) {
j++;
if (j % dotInterval == dotInterval - 1) {
logger.log(Level.INFO, ".");
}
}
if (j != 0) {
String msg = "\n" + j
+ " entries were left after we deleted all of them";
throw new TestException(msg);
}
logger.log(Level.INFO,
"\nFinished checking emptiness, closing iterator");
i.close();
}