The following test case fails which I think it shouldn't:
@Before
public void setUp() throws Exception {
xml = parse("<root><something/></root>");
}
@Test
public void testAppliesMatcherToXPathInDocument() throws Exception {
assertThat(xml, hasXPath("//something"));
}
This can be solved with followinf change to HasXPath.matchesSafely
try {
if (valueMatcher == null) {
Boolean result = (Boolean) compiledXPath.evaluate(item,
XPathConstants.BOOLEAN);
return result == null ? false : result.booleanValue();
} else {
String result = (String) compiledXPath.evaluate(item,
XPathConstants.STRING);
if (result == null) {
return false;
} else {
return valueMatcher.matches(result);
}
}
} catch (XPathExpressionException e) {
return false;
}
Original issue reported on code.google.com by jepp...@gmail.com on 29 Jul 2008 at 10:26
Original issue reported on code.google.com by
jepp...@gmail.com
on 29 Jul 2008 at 10:26