store.openAndNewAccessSession(true/* removeFiles */, true/*
* exclusive
* access
* session
*/);
ForTestVisitedModified root = new ForTestVisitedModified();
store.setRoot(root);
store.save(false, false);
Map<String, MutableInteger> wroteSet = store.getWroteObjectSet();
Set<String> visitedObjectSet = store.getVisitedObjectSet();
logVisitedAndWrote(wroteSet, visitedObjectSet);
int nbModified = store.getNumberOfModified();
assertEquals("bad number of modified", 2, nbModified);
int nbVisited = store.getNumberOfVisitedForSave();
assertEquals("bad number of visited", 2, nbVisited);
root = (ForTestVisitedModified) store.getRoot();
root.add("key", "value");
store.save(false, false);
wroteSet = store.getWroteObjectSet();
visitedObjectSet = store.getVisitedObjectSet();
logVisitedAndWrote(wroteSet, visitedObjectSet);
nbModified = store.getNumberOfModified();
assertEquals("bad number of modified", 4, nbModified);
nbVisited = store.getNumberOfVisitedForSave();
assertEquals("bad number of visited", 5, nbVisited);
root = (ForTestVisitedModified) store.getRoot();
assertEquals("bad value", "value", root.get("key"));
store.save(true, false);
wroteSet = store.getWroteObjectSet();
visitedObjectSet = store.getVisitedObjectSet();
logVisitedAndWrote(wroteSet, visitedObjectSet);
nbModified = store.getNumberOfModified();