assertEquals(false, cache.removeNode(fqn));
}
private void assertStructure(TreeCache tc, String fqnStr) {
// make sure structure nodes are properly built and maintained
AtomicMapCache c = (AtomicMapCache) tc.getCache();
Fqn fqn = Fqn.fromString(fqnStr);
// loop thru the Fqn, starting at its root, and make sure all of its children exist in proper NodeKeys
for (int i = 0; i < fqn.size(); i++) {
Fqn parent = fqn.getSubFqn(0, i);
Object childName = fqn.get(i);
// make sure a data key exists in the cache
assert c.containsKey(new NodeKey(parent, NodeKey.Type.DATA)) : "Node [" + parent + "] does not have a Data atomic map!";
assert c.containsKey(new NodeKey(parent, NodeKey.Type.STRUCTURE)) : "Node [" + parent + "] does not have a Structure atomic map!";
AtomicMap am = c.getAtomicMap(new NodeKey(parent, NodeKey.Type.STRUCTURE));
boolean hasChild = am.containsKey(childName);
assert hasChild : "Node [" + parent + "] does not have a child [" + childName + "] in its Structure atomic map!";
}
}