@Test public void textXPathAttributeIsFound() throws Exception { String xml = "<a><b attr=\"abc\"></b></a>"; assertThat(xml, hasXPath(" try { assertThat(xml, hasXPath(" Assert.fail("Should throw AssertionError"); }catch(AssertionError e){ assertThat(e.getMessage(), containsString("XPath returned no results")); } }
@Factory public static HasXPathMatcher hasXPath(String xPath) { return new HasXPathMatcher(xPath); }
HasXPathMatcher extends BaseMatcher<Object> { @Factory public static HasXPathMatcher hasXPath(String xPath) { return new HasXPathMatcher(xPath); } }
HasXPathMatcher extends BaseMatcher<Object> { @Factory public static HasXPathMatcher hasXPath(String xPath) { return new HasXPathMatcher(xPath); } HasXPathMatcher(String xPath); }
HasXPathMatcher extends BaseMatcher<Object> { @Factory public static HasXPathMatcher hasXPath(String xPath) { return new HasXPathMatcher(xPath); } HasXPathMatcher(String xPath); HasXPathMatcher withDocumentBuilderFactory(DocumentBuilderFactory f); HasXPathMatcher withXPathFactory(XPathFactory f); @Override boolean matches(Object object); @Override void describeTo(Description description); @Override void describeMismatch(Object item, Description mismatchDescription); @Factory static HasXPathMatcher hasXPath(String xPath); HasXPathMatcher withNamespaceContext(Map<String, String> prefix2Uri); }
HasXPathMatcher extends BaseMatcher<Object> { @Factory public static HasXPathMatcher hasXPath(String xPath) { return new HasXPathMatcher(xPath); } HasXPathMatcher(String xPath); HasXPathMatcher withDocumentBuilderFactory(DocumentBuilderFactory f); HasXPathMatcher withXPathFactory(XPathFactory f); @Override boolean matches(Object object); @Override void describeTo(Description description); @Override void describeMismatch(Object item, Description mismatchDescription); @Factory static HasXPathMatcher hasXPath(String xPath); HasXPathMatcher withNamespaceContext(Map<String, String> prefix2Uri);  }