XMLUnit for Java
Provides two JUnit extension classes, XMLAssert and XMLTestCase, and a set of supporting classes (e.g. Diff, DetailedDiff,Transform,SimpleXpathEngine,Validator,NodeTest) that allow assertions to be made about:
- The differences between two pieces of XML
- The outcome of transforming a piece of XML using XSLT
- The evaluation of an XPath expression on a piece of XML
- The validity of a piece of XML
- Individual nodes in a piece of XML that are exposed by DOM Traversal
XMLUnit for Java can also treat HTML content (even badly-formed HTML) as valid XML to allow these assertions to be made about the content of web pages too.
XMLUnit for .Net
Provides NUnit extension classes written in C#, e.g. XmlAssertion and XmlDiff, that allow assertions to be made about the differences between two pieces of XML, the validity of a piece of XML, the evaluation of an XPath expression on a piece of XML, and the result of an XSL Transform.
XMLUnit 2.x is developed for Java and .NET.
XMLUnit 2.x is a complete rewrite and is based on the experience of XMLUnit for Java 1.x. It's main goals are:
- create .NET and Java versions that are compatible in design while trying to be idiomatic for each platform
- focus on the parts that are useful for testing:
- XPath
- (Schema) validation
- comparisons
- be test framework agnostic (this applies to the Java version more than to XMLUnit.NET)
- remove all static configuration (the old XMLUnit class setter methods)
The code has been split into separate git repositories for Java and .NET, but both share quite a bit of history.