org.apache.commons.jelly.tags.xmlunit
Class AssertDocumentsEqualTag
java.lang.Object
org.apache.commons.jelly.TagSupport
org.apache.commons.jelly.xpath.XPathTagSupport
org.apache.commons.jelly.tags.junit.AssertTagSupport
org.apache.commons.jelly.tags.xmlunit.XMLUnitTagSupport
org.apache.commons.jelly.tags.xmlunit.AssertDocumentsEqualTag
- All Implemented Interfaces:
- org.apache.commons.jelly.Tag
- public class AssertDocumentsEqualTag
- extends XMLUnitTagSupport
Compares two XML documents using XMLUnit (http://xmlunit.sourceforge.net/).
If they are different an exception will be thrown.
Fields inherited from class org.apache.commons.jelly.TagSupport |
body, context, hasTrimmed, parent, shouldTrim |
Method Summary |
protected org.dom4j.io.SAXReader |
createSAXReader()
Factory method to create a new SAXReader |
void |
doTag(org.apache.commons.jelly.XMLOutput output)
|
void |
setActual(java.lang.Object actual)
Sets the actual XML document which is either a Document, String (of an
URI), URI, Reader, or InputStream. |
void |
setExpected(java.lang.Object expected)
Sets the expected XML document which is either a Document, String (of an
URI), URI, Reader, or InputStream. |
void |
setIgnoreWhitespace(boolean ignoreWhitespace)
Controls whether whitespace differences should be interpreted as
differences or not. |
Methods inherited from class org.apache.commons.jelly.tags.junit.AssertTagSupport |
fail, fail, failNotEquals |
Methods inherited from class org.apache.commons.jelly.xpath.XPathTagSupport |
getXPathContext |
Methods inherited from class org.apache.commons.jelly.TagSupport |
findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, getBody, getBodyText, getBodyText, getContext, getParent, invokeBody, isTrim, setBody, setContext, setParent, setTrim, trimBody |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
actual
private java.lang.Object actual
actualDocument
private org.dom4j.Document actualDocument
expected
private java.lang.Object expected
expectedDocument
private org.dom4j.Document expectedDocument
ignoreWhitespace
private boolean ignoreWhitespace
- Controls whether whitespace differences are reported as differences.
Defaults to
false
, so if trim
is set to
false
whitespace differences are detected.
AssertDocumentsEqualTag
public AssertDocumentsEqualTag()
doTag
public void doTag(org.apache.commons.jelly.XMLOutput output)
throws org.apache.commons.jelly.JellyTagException
- Throws:
org.apache.commons.jelly.JellyTagException
setActual
public void setActual(java.lang.Object actual)
- Sets the actual XML document which is either a Document, String (of an
URI), URI, Reader, or InputStream.
setExpected
public void setExpected(java.lang.Object expected)
- Sets the expected XML document which is either a Document, String (of an
URI), URI, Reader, or InputStream.
setIgnoreWhitespace
public void setIgnoreWhitespace(boolean ignoreWhitespace)
- Controls whether whitespace differences should be interpreted as
differences or not. The default is
false
. Note that the
use of the trim
attribute is crucial here.
createSAXReader
protected org.dom4j.io.SAXReader createSAXReader()
- Description copied from class:
XMLUnitTagSupport
- Factory method to create a new SAXReader
- Specified by:
createSAXReader
in class XMLUnitTagSupport