Class Overview
A collection of hamcrest matchers for objects in the org.w3c.dom package (such as Document and Element).
Summary
|
[Expand]
Inherited Methods |
From class
java.lang.Object
|
Object
|
clone()
|
|
boolean
|
equals(Object arg0)
|
|
void
|
finalize()
|
|
final
Class<?>
|
getClass()
|
|
int
|
hashCode()
|
|
final
void
|
notify()
|
|
final
void
|
notifyAll()
|
|
String
|
toString()
|
|
final
void
|
wait(long arg0, int arg1)
|
|
final
void
|
wait(long arg0)
|
|
final
void
|
wait()
|
|
Public Methods
public
static
Matcher<Document>
containingTextInBody
(String text)
Returns a matcher that matches Documents that have a body containing the given text.
public
static
Matcher<Document>
elementById
(String id, Matcher<Element> elementMatcher)
Matches Documents that have an Element with the given id that matches the given
element matcher.
| Parameters |
id |
String |
elementMatcher |
Matcher |
public
static
Matcher<Document>
elementByXPath
(String xpath, Matcher<Element> elementMatcher)
Matches a XPath and validates it against the first Element that it finds in the NodeList.
| Parameters |
xpath |
String |
elementMatcher |
Matcher |
public
static
Matcher<Document>
hasElementWithId
(String id)
Returns a matcher that matches Documents that have at least one element with the given
id.
public
static
Matcher<Document>
hasElementWithXpath
(String xpath)
Returns a matcher that matches Documents that have at least one element with the given
xpath.
public
static
Matcher<Document>
withBody
(Matcher<Element> bodyMatcher)
Returns a matcher that matches Documents with body that matches the given matcher.
| Parameters |
bodyMatcher |
Matcher |
public
static
Matcher<Element>
withTextContent
(String textContent)
Returns a matcher that matches Elements with the given textContent. Equivalent of
withTextContent(is(textContent)).
| Parameters |
textContent |
String |
public
static
Matcher<Element>
withTextContent
(Matcher<String> textContentMatcher)
Returns a matcher that matches Elements that have textContent matching the given
matcher.
| Parameters |
textContentMatcher |
Matcher |