TeStereo report
@Test public void testFindAllByTag() throws Exception {
Node dom=new HTMLFixture(copyResourceToTempFile("/microformats/hcard/02-multiple-class-names-on-vcard.html")).getDOM();
Assert.assertNotNull(dom);
List nodes=DomUtils.findAllByTag(dom,"SPAN");
NodeList nodeList=null;
try {
nodeList=(NodeList)xPathEngine.evaluate("./descendant-or-self::SPAN",dom,XPathConstants.NODESET);
}
catch ( XPathExpressionException e) {
Assert.fail(e.getMessage());
}
Assert.assertEquals("number of elements does not match",nodes.size(),nodeList.getLength());
for (int i=0; i < nodeList.getLength(); i++) {
Assert.assertTrue(nodes.contains(nodeList.item(i)));
}
}