}
assertEquals(expected, actual);
}
public void testAllowsValueToBeReadWithoutDisturbingChildren() throws Exception {
HierarchicalStreamReader xmlReader
= createReader("<root><child></child><sibling>text2</sibling></root>"); // at: /root
assertEquals("root", xmlReader.getNodeName());
assertEquals("", xmlReader.getValue());
assertTrue(xmlReader.hasMoreChildren());
xmlReader.moveDown(); // at: /root/child
assertEquals("child", xmlReader.getNodeName());
assertEquals(null, xmlReader.getAttribute("something"));
assertEquals("", xmlReader.getValue());
assertFalse(xmlReader.hasMoreChildren()); // <--- This is an awkward one for pull parsers
xmlReader.moveUp(); // at: /root
assertTrue(xmlReader.hasMoreChildren());
xmlReader.moveDown(); // at: /root/sibling
assertEquals("sibling", xmlReader.getNodeName());
assertEquals("text2", xmlReader.getValue());
assertFalse(xmlReader.hasMoreChildren());
xmlReader.moveUp(); // at: /root
assertFalse(xmlReader.hasMoreChildren());
}