Class XPathRegexAssert
- java.lang.Object
-
- org.custommonkey.xmlunit.examples.XPathRegexAssert
-
public class XPathRegexAssert extends java.lang.Object
Example demonstrating how to use the XPath API of XMLUnit in conjunction with regular expressions (as provided by the java.util.regex package of JDK 1.4+).
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
EXPECTED_VALUE_TO_MATCH
-
Constructor Summary
Constructors Modifier Constructor Description private
XPathRegexAssert()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
assertXPathMatches(java.lang.String regex, java.lang.String xpath, java.io.Reader reader)
Asserts result of applying an XPath expression to a document matches a regular expression.static void
assertXPathMatches(java.lang.String regex, java.lang.String xpath, java.lang.String xml)
Asserts result of applying an XPath expression to a document matches a regular expression.static void
assertXPathMatches(java.lang.String message, java.lang.String regex, java.lang.String xpath, java.io.Reader reader)
Asserts result of applying an XPath expression to a document matches a regular expression.static void
assertXPathMatches(java.lang.String message, java.lang.String regex, java.lang.String xpath, java.lang.String xml)
Asserts result of applying an XPath expression to a document matches a regular expression.static void
assertXPathMatches(java.lang.String message, java.lang.String regex, java.lang.String xpath, org.w3c.dom.Document doc)
Asserts result of applying an XPath expression to a document matches a regular expression.static void
assertXPathMatches(java.lang.String regex, java.lang.String xpath, org.w3c.dom.Document doc)
Asserts result of applying an XPath expression to a document matches a regular expression.
-
-
-
Field Detail
-
EXPECTED_VALUE_TO_MATCH
private static final java.lang.String EXPECTED_VALUE_TO_MATCH
- See Also:
- Constant Field Values
-
-
Method Detail
-
assertXPathMatches
public static void assertXPathMatches(java.lang.String message, java.lang.String regex, java.lang.String xpath, org.w3c.dom.Document doc) throws XpathException
Asserts result of applying an XPath expression to a document matches a regular expression.- Parameters:
message
- assertion messageregex
- regular expressionxpath
- XPath expressiondoc
- document to apply XPath expression to- Throws:
XpathException
- if XPath construction fails
-
assertXPathMatches
public static void assertXPathMatches(java.lang.String message, java.lang.String regex, java.lang.String xpath, java.lang.String xml) throws XpathException, org.xml.sax.SAXException, java.io.IOException
Asserts result of applying an XPath expression to a document matches a regular expression.- Parameters:
message
- assertion messageregex
- regular expressionxpath
- XPath expressionxml
- document to apply XPath expression to- Throws:
XpathException
- if XPath construction failsorg.xml.sax.SAXException
- if the parser says sojava.io.IOException
- on I/O errors
-
assertXPathMatches
public static void assertXPathMatches(java.lang.String message, java.lang.String regex, java.lang.String xpath, java.io.Reader reader) throws XpathException, org.xml.sax.SAXException, java.io.IOException
Asserts result of applying an XPath expression to a document matches a regular expression.- Parameters:
message
- assertion messageregex
- regular expressionxpath
- XPath expressionreader
- document to apply XPath expression to- Throws:
XpathException
- if XPath construction failsorg.xml.sax.SAXException
- if the parser says sojava.io.IOException
- on I/O errors
-
assertXPathMatches
public static void assertXPathMatches(java.lang.String regex, java.lang.String xpath, org.w3c.dom.Document doc) throws XpathException
Asserts result of applying an XPath expression to a document matches a regular expression.- Parameters:
regex
- regular expressionxpath
- XPath expressiondoc
- document to apply XPath expression to- Throws:
XpathException
- if XPath construction fails
-
assertXPathMatches
public static void assertXPathMatches(java.lang.String regex, java.lang.String xpath, java.lang.String xml) throws XpathException, org.xml.sax.SAXException, java.io.IOException
Asserts result of applying an XPath expression to a document matches a regular expression.- Parameters:
regex
- regular expressionxpath
- XPath expressionxml
- document to apply XPath expression to- Throws:
XpathException
- if XPath construction failsorg.xml.sax.SAXException
- if the parser says sojava.io.IOException
- on I/O errors
-
assertXPathMatches
public static void assertXPathMatches(java.lang.String regex, java.lang.String xpath, java.io.Reader reader) throws XpathException, org.xml.sax.SAXException, java.io.IOException
Asserts result of applying an XPath expression to a document matches a regular expression.- Parameters:
regex
- regular expressionxpath
- XPath expressionreader
- document to apply XPath expression to- Throws:
XpathException
- if XPath construction failsorg.xml.sax.SAXException
- if the parser says sojava.io.IOException
- on I/O errors
-
-