Phew, I finally made it. And just in time.

Around Christmas last year I estimated to have XMLUnit 1.1 in a releasable state for a beta in the first and for the final release in the second quarter of this year. Obviously I overestimated the time I'd have available to work on any open source stuff - and I underestimated the amount of work the new user's guide would take. But it still is the second quarter of this year. 8-)

XMLUnit for Java is a library that supports testing of generated XML content. It supports comparison of XML snippets, DTD and Schema validation, XPath queries and programmatic tests. XMLUnit offers strong integration with JUnit but can be used stand-alone or with other test frameworks as well. See the user's guide for way more information.

XMLUnit 1.1 fixes all known issues with XMLUnit 1.0 and should be backwards compatible except for some border cases. It vastly improves XPath support by using JAXP 1.3 where available, and supports XML Schema validation for any JAXP compliant parser.

You can download XMLUnit as binary and source ZIPs (the source archive contains the user's guide as well since I don't expect you to have the DocBook and dblatex tool chain installed). Please use the OpenPGP signatures found in http://xmlunit.sourceforge.net/checksums/ to verify the integrity of the released files.

I'll figure out, how to file an upload request, so the release should become available via a Maven repository soon as well. (Update: request filed)

The next steps will be improving the validation subsystem by using JAXP 1.4 features, thinking of a more human readable API and aligning XMLUnit for .NET with the Java version. If you want to help out, please subscribe to the mailing list and jump in. You are more than welcome.

path: /en/oss/XMLUnit | #

InfoQ has published an article of mine titled Unit-Testing XML.

In this article I describe the four major use-cases for XMLUnit (my subjective view, YMMV): validation (against DTD or XSD), comparing XML snippets, XPath tests and programmatic validations. I don't cover testing HTML at all.

The article is written for XMLUnit 1.1 which is due to see its final release pretty soon (we released our second beta about two weeks ago). All examples of the article focus on using XMLUnit via its API, so it should be pretty easy to adapt them to use TestNG, JUnit 4 or whatever else you use to run your tests.

I could only touch on some of the more advanced issues, in particular I briefly show how to fine tune the inner workings of the difference engine by providing DifferenceListeners or ElementQualifiers.

path: /en/oss/XMLUnit | #