assertEquals(false, e.isValid());
assertEquals(true, r.getFirstChild() != c);
}
public void testRemoveSubtree() {
Tree tree = GraphLib.getBalancedTree(3,3);
int size = tree.getNodeCount();
Node r = tree.getRoot();
Node c = r.getFirstChild();
Node[] nodes = new Node[13];
Edge[] edges = new Edge[13];
Iterator iter = new TreeNodeIterator(c);
for ( int i=0; iter.hasNext(); ++i ) {
nodes[i] = (Node)iter.next();
edges[i] = (Edge)nodes[i].getParentEdge();
}
assertEquals(true, tree.removeChild(c));
assertEquals(tree.getNodeCount(), size-13);
assertEquals(true, r.getFirstChild() != c);
for ( int i=0; i<nodes.length; ++i ) {
assertEquals(false, nodes[i].isValid());
assertEquals(false, edges[i].isValid());
}
assertEquals(true, tree.isValidTree());
}