@Test public void testXPathAttributeValueMatchingInXmlElement() throws Exception { String xml = "<a><b attr=\"abc\"></b></a>"; DocumentBuilderFactory f = DocumentBuilderFactory.newInstance(); f.setNamespaceAware(true); DocumentBuilder db = f.newDocumentBuilder(); Element xmlRootElement = db.parse( new InputSource(new ByteArrayInputStream(xml.getBytes("utf-8")))).getDocumentElement(); assertThat(xmlRootElement, hasXPath(" }
@Factory public static EvaluateXPathMatcher hasXPath(String xPath, Matcher<String> valueMatcher) { return new EvaluateXPathMatcher(xPath, valueMatcher); }
EvaluateXPathMatcher extends BaseMatcher<Object> { @Factory public static EvaluateXPathMatcher hasXPath(String xPath, Matcher<String> valueMatcher) { return new EvaluateXPathMatcher(xPath, valueMatcher); } }
EvaluateXPathMatcher extends BaseMatcher<Object> { @Factory public static EvaluateXPathMatcher hasXPath(String xPath, Matcher<String> valueMatcher) { return new EvaluateXPathMatcher(xPath, valueMatcher); } EvaluateXPathMatcher(String xPath, Matcher<String> valueMatcher); }
EvaluateXPathMatcher extends BaseMatcher<Object> { @Factory public static EvaluateXPathMatcher hasXPath(String xPath, Matcher<String> valueMatcher) { return new EvaluateXPathMatcher(xPath, valueMatcher); } EvaluateXPathMatcher(String xPath, Matcher<String> valueMatcher); @Factory static EvaluateXPathMatcher hasXPath(String xPath, Matcher<String> valueMatcher); EvaluateXPathMatcher withDocumentBuilderFactory(DocumentBuilderFactory f); EvaluateXPathMatcher withXPathFactory(XPathFactory f); @Override boolean matches(Object object); @Override void describeTo(Description description); @Override void describeMismatch(Object object, Description mismatchDescription); EvaluateXPathMatcher withNamespaceContext(Map<String, String> prefix2Uri); }
EvaluateXPathMatcher extends BaseMatcher<Object> { @Factory public static EvaluateXPathMatcher hasXPath(String xPath, Matcher<String> valueMatcher) { return new EvaluateXPathMatcher(xPath, valueMatcher); } EvaluateXPathMatcher(String xPath, Matcher<String> valueMatcher); @Factory static EvaluateXPathMatcher hasXPath(String xPath, Matcher<String> valueMatcher); EvaluateXPathMatcher withDocumentBuilderFactory(DocumentBuilderFactory f); EvaluateXPathMatcher withXPathFactory(XPathFactory f); @Override boolean matches(Object object); @Override void describeTo(Description description); @Override void describeMismatch(Object object, Description mismatchDescription); EvaluateXPathMatcher withNamespaceContext(Map<String, String> prefix2Uri);  }