public void testChildren() { Node[] children = XMLTools.children(this.rootNode); assertEquals(4, children.length); for (int i = 1; i < 4; i++) { assertEquals("element-" + i, children[i].getNodeName()); } }
public void testChildrenNamed() { Node element2Node = XMLTools.child(this.rootNode, "element-2"); Node[] children = XMLTools.children(element2Node, "element-2.0"); assertEquals(3, children.length); for (int i = 0; i < children.length; i++) { assertEquals("element-2.0", children[i].getNodeName()); } }