|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.custommonkey.xmlunit.XMLUnit
public final class XMLUnit
Allows access to project control parameters such as which Parser to use and
provides some convenience methods for building Documents from Strings etc.
Examples and more at xmlunit.sourceforge.net
Method Summary | |
---|---|
static org.w3c.dom.Document |
buildControlDocument(org.xml.sax.InputSource fromSource)
Utility method to build a Document using the control DocumentBuilder and the specified InputSource |
static org.w3c.dom.Document |
buildControlDocument(java.lang.String fromXML)
Utility method to build a Document using the control DocumentBuilder to parse the specified String. |
static org.w3c.dom.Document |
buildDocument(javax.xml.parsers.DocumentBuilder withBuilder,
org.xml.sax.InputSource fromSource)
Utility method to build a Document using a specific DocumentBuilder and a specific InputSource |
static org.w3c.dom.Document |
buildDocument(javax.xml.parsers.DocumentBuilder withBuilder,
java.io.Reader fromReader)
Utility method to build a Document using a specific DocumentBuilder and reading characters from a specific Reader. |
static org.w3c.dom.Document |
buildTestDocument(org.xml.sax.InputSource fromSource)
Utility method to build a Document using the test DocumentBuilder and the specified InputSource |
static org.w3c.dom.Document |
buildTestDocument(java.lang.String fromXML)
Utility method to build a Document using the test DocumentBuilder to parse the specified String. |
static Diff |
compare(org.xml.sax.InputSource control,
org.xml.sax.InputSource test)
Deprecated. use Diff constructor directly |
static Diff |
compare(java.io.Reader control,
java.io.Reader test)
Deprecated. use Diff constructor directly |
static Diff |
compare(java.io.Reader control,
java.lang.String test)
Deprecated. use Diff constructor directly |
static Diff |
compare(java.lang.String control,
java.io.Reader test)
Deprecated. use Diff constructor directly |
static Diff |
compare(java.lang.String control,
java.lang.String test)
Deprecated. use Diff constructor directly |
static Diff |
compareXML(org.w3c.dom.Document control,
org.w3c.dom.Document test)
Compare two XML documents provided as strings |
static Diff |
compareXML(java.io.Reader control,
java.io.Reader test)
Compare XML documents provided by two Reader classes |
static Diff |
compareXML(java.io.Reader control,
java.lang.String test)
Compare XML documents provided by two Reader classes |
static Diff |
compareXML(java.lang.String control,
java.io.Reader test)
Compare XML documents provided by two Reader classes |
static Diff |
compareXML(java.lang.String control,
java.lang.String test)
Compare two XML documents provided as strings |
static javax.xml.parsers.DocumentBuilderFactory |
getControlDocumentBuilderFactory()
Get the DocumentBuilderFactory instance used to instantiate
parsers for the control XML in an XMLTestCase. |
static javax.xml.parsers.DocumentBuilder |
getControlParser()
Get the DocumentBuilder instance used to parse the control
XML in an XMLTestCase. |
static boolean |
getIgnoreWhitespace()
Whether to ignore whitespace when comparing node values. |
static javax.xml.parsers.SAXParserFactory |
getSAXParserFactory()
Get the SAX parser to use in tests. |
static Transform |
getStripWhitespaceTransform(org.w3c.dom.Document forDocument)
Obtain the transformation that will strip whitespace from a DOM containing empty Text nodes |
static javax.xml.parsers.DocumentBuilderFactory |
getTestDocumentBuilderFactory()
Get the DocumentBuilderFactory instance used to instantiate
parsers for the test XML in an XMLTestCase. |
static javax.xml.parsers.DocumentBuilder |
getTestParser()
Get the DocumentBuilder instance used to parse the test XML
in an XMLTestCase. |
static javax.xml.transform.TransformerFactory |
getTransformerFactory()
Get the transformer to use for XSLT transformations (and by implication serialization and XPaths). |
static java.lang.String |
getVersion()
Place holder for current version info. |
static void |
setControlDocumentBuilderFactory(javax.xml.parsers.DocumentBuilderFactory factory)
Override the DocumentBuilderFactory used to instantiate
parsers for the control XML in an XMLTestCase. |
static void |
setControlParser(java.lang.String className)
Overide the DocumentBuilder to use to parse control documents. |
static void |
setIgnoreWhitespace(boolean ignore)
Whether to ignore whitespace when comparing node values. |
static void |
setSAXParserFactory(java.lang.String className)
Override the SAX parser to use in tests. |
static void |
setTestDocumentBuilderFactory(javax.xml.parsers.DocumentBuilderFactory factory)
Override the DocumentBuilderFactory used to instantiate
parsers for the test XML in an XMLTestCase. |
static void |
setTestParser(java.lang.String className)
Overide the DocumentBuilder to use to parser test documents. |
static void |
setTransformerFactory(java.lang.String className)
Overide the transformer to use for XSLT transformations (and by implication serialization and XPaths). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void setControlParser(java.lang.String className) throws javax.xml.parsers.FactoryConfigurationError
javax.xml.parsers.FactoryConfigurationError
public static javax.xml.parsers.DocumentBuilder getControlParser() throws javax.xml.parsers.ParserConfigurationException
DocumentBuilder
instance used to parse the control
XML in an XMLTestCase.
javax.xml.parsers.ParserConfigurationException
public static javax.xml.parsers.DocumentBuilderFactory getControlDocumentBuilderFactory()
DocumentBuilderFactory
instance used to instantiate
parsers for the control XML in an XMLTestCase.
public static void setControlDocumentBuilderFactory(javax.xml.parsers.DocumentBuilderFactory factory)
DocumentBuilderFactory
used to instantiate
parsers for the control XML in an XMLTestCase.
public static void setTestParser(java.lang.String className) throws javax.xml.parsers.FactoryConfigurationError
javax.xml.parsers.FactoryConfigurationError
public static javax.xml.parsers.DocumentBuilder getTestParser() throws javax.xml.parsers.ParserConfigurationException
DocumentBuilder
instance used to parse the test XML
in an XMLTestCase.
javax.xml.parsers.ParserConfigurationException
public static javax.xml.parsers.DocumentBuilderFactory getTestDocumentBuilderFactory()
DocumentBuilderFactory
instance used to instantiate
parsers for the test XML in an XMLTestCase.
public static void setTestDocumentBuilderFactory(javax.xml.parsers.DocumentBuilderFactory factory)
DocumentBuilderFactory
used to instantiate
parsers for the test XML in an XMLTestCase.
public static void setIgnoreWhitespace(boolean ignore)
setIgnoringElementContentWhitespace()
on the underlying control AND test document builder factories.
public static boolean getIgnoreWhitespace()
public static Diff compare(java.io.Reader control, java.io.Reader test) throws org.xml.sax.SAXException, java.io.IOException, javax.xml.parsers.ParserConfigurationException
control
- Control documenttest
- Document to test
org.xml.sax.SAXException
java.io.IOException
javax.xml.parsers.ParserConfigurationException
public static Diff compare(org.xml.sax.InputSource control, org.xml.sax.InputSource test) throws org.xml.sax.SAXException, java.io.IOException, javax.xml.parsers.ParserConfigurationException
InputSources
control
- Control documenttest
- Document to test
org.xml.sax.SAXException
java.io.IOException
javax.xml.parsers.ParserConfigurationException
public static Diff compare(java.lang.String control, java.io.Reader test) throws org.xml.sax.SAXException, java.io.IOException, javax.xml.parsers.ParserConfigurationException
control
- Control documenttest
- Document to test
org.xml.sax.SAXException
java.io.IOException
javax.xml.parsers.ParserConfigurationException
public static Diff compare(java.io.Reader control, java.lang.String test) throws org.xml.sax.SAXException, java.io.IOException, javax.xml.parsers.ParserConfigurationException
control
- Control documenttest
- Document to test
org.xml.sax.SAXException
java.io.IOException
javax.xml.parsers.ParserConfigurationException
public static Diff compare(java.lang.String control, java.lang.String test) throws org.xml.sax.SAXException, java.io.IOException, javax.xml.parsers.ParserConfigurationException
control
- Control documenttest
- Document to test
org.xml.sax.SAXException
java.io.IOException
javax.xml.parsers.ParserConfigurationException
public static org.w3c.dom.Document buildControlDocument(java.lang.String fromXML) throws org.xml.sax.SAXException, java.io.IOException, javax.xml.parsers.ParserConfigurationException
fromXML
-
org.xml.sax.SAXException
java.io.IOException
javax.xml.parsers.ParserConfigurationException
public static org.w3c.dom.Document buildControlDocument(org.xml.sax.InputSource fromSource) throws java.io.IOException, org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationException
fromSource
-
org.xml.sax.SAXException
java.io.IOException
javax.xml.parsers.ParserConfigurationException
public static org.w3c.dom.Document buildTestDocument(java.lang.String fromXML) throws org.xml.sax.SAXException, java.io.IOException, javax.xml.parsers.ParserConfigurationException
fromXML
-
org.xml.sax.SAXException
java.io.IOException
javax.xml.parsers.ParserConfigurationException
public static org.w3c.dom.Document buildTestDocument(org.xml.sax.InputSource fromSource) throws java.io.IOException, org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationException
fromSource
-
org.xml.sax.SAXException
java.io.IOException
javax.xml.parsers.ParserConfigurationException
public static org.w3c.dom.Document buildDocument(javax.xml.parsers.DocumentBuilder withBuilder, java.io.Reader fromReader) throws org.xml.sax.SAXException, java.io.IOException
withBuilder
- fromReader
-
org.xml.sax.SAXException
java.io.IOException
public static org.w3c.dom.Document buildDocument(javax.xml.parsers.DocumentBuilder withBuilder, org.xml.sax.InputSource fromSource) throws java.io.IOException, org.xml.sax.SAXException
withBuilder
- fromSource
-
org.xml.sax.SAXException
java.io.IOException
public static void setTransformerFactory(java.lang.String className) throws javax.xml.transform.TransformerFactoryConfigurationError
javax.xml.transform.TransformerFactoryConfigurationError
public static javax.xml.transform.TransformerFactory getTransformerFactory() throws javax.xml.transform.TransformerFactoryConfigurationError
javax.xml.transform.TransformerFactoryConfigurationError
- if unable to construct
a new instance of the default transformer factory
javax.xml.transform.TransformerFactoryConfigurationError
public static void setSAXParserFactory(java.lang.String className)
Validator class
className
- public static javax.xml.parsers.SAXParserFactory getSAXParserFactory()
Validator
to perform DTD validationpublic static Transform getStripWhitespaceTransform(org.w3c.dom.Document forDocument) throws javax.xml.transform.TransformerConfigurationException
forDocument
-
Transform
to do the whitespace stripping
javax.xml.transform.TransformerConfigurationException
public static java.lang.String getVersion()
public static Diff compareXML(java.io.Reader control, java.io.Reader test) throws org.xml.sax.SAXException, java.io.IOException, javax.xml.parsers.ParserConfigurationException
control
- Control documenttest
- Document to test
org.xml.sax.SAXException
java.io.IOException
javax.xml.parsers.ParserConfigurationException
public static Diff compareXML(java.lang.String control, java.io.Reader test) throws org.xml.sax.SAXException, java.io.IOException, javax.xml.parsers.ParserConfigurationException
control
- Control documenttest
- Document to test
org.xml.sax.SAXException
java.io.IOException
javax.xml.parsers.ParserConfigurationException
public static Diff compareXML(java.io.Reader control, java.lang.String test) throws org.xml.sax.SAXException, java.io.IOException, javax.xml.parsers.ParserConfigurationException
control
- Control documenttest
- Document to test
org.xml.sax.SAXException
java.io.IOException
javax.xml.parsers.ParserConfigurationException
public static Diff compareXML(java.lang.String control, java.lang.String test) throws org.xml.sax.SAXException, java.io.IOException, javax.xml.parsers.ParserConfigurationException
control
- Control documenttest
- Document to test
org.xml.sax.SAXException
java.io.IOException
javax.xml.parsers.ParserConfigurationException
public static Diff compareXML(org.w3c.dom.Document control, org.w3c.dom.Document test)
control
- Control documenttest
- Document to test
|
XMLUnit is hosted by sourceforge.net |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |