XML Unit

XMLUnit provides assertions that help testing code that produces XML.

24 Recommendations
240 Downloads (This Week)
Last Update:
Download xmlunit-1.4-bin.zip
Browse All Files
Windows Mac Linux

Description

XMLUnit extends JUnit and NUnit to enable unit testing of XML. It compares a control XML document to a test document or the result of a transformation, validates documents, and compares the results of XPath expressions.

The Java version is currently way more mature than the .NET version.

XML Unit Web Site

Update Notifications





User Ratings

 
 
24
5
Write a Review

User Reviews

  • Posted by Brabenetz Harald 2012-04-25

    It Is very useful Library for my tests. The Error Messages (in case of variations) are detailed enough (in most cases i only need the XPath) I initizialize XMLUnit with: @BeforeClass public static void initXmlUnit() { XMLUnit.setIgnoreWhitespace(true); XMLUnit.setIgnoreAttributeOrder(true); XMLUnit.setIgnoreComments(true); XMLUnit.setIgnoreDiffBetweenTextAndCDATA(true); } And run my Tests with : Diff diff = XMLUnit.compareXML(createInputSource(controlXml), createInputSource(resultXml)); diff.overrideDifferenceListener(new MyDifferenceListener()); // Special Cases: ignore some nodes and validate some Nodes with BigDecimal or Date compare() diff.overrideElementQualifier(new MyElementQualifier()); // Special Cases: ignore the Element-order of maxOccure > 1 Elements. assertTrue("XML similar " + diff.toString(), diff.similar()); assertTrue("XML identical " + diff.toString(), diff.identical()); // Helper Method: protected InputSource createInputSource(final byte[] xml) { return new InputSource(new ByteArrayInputStream(xml)); } FAZIT: XML Unit is Easy to Use. BW: is there a release Plan for 1.4? In SVN there are nice new Helper Classes like "ElementSelectors". With friendly regards, Harald

  • Posted by Kevin Stein 2012-11-16

    Love its user-friendly interface. Definitely, there's nothing more I could ask for.

  • Posted by Jacob 2012-10-26

    simple and straight forward to use

  • Posted by Logan 2012-03-23

    Great app

Read more reviews

Additional Project Details

Languages

English

Intended Audience

Developers, Information Technology, Testers

Programming Language

C#, Java

Registered

2001-03-19

Icons must be PNG, GIF, or JPEG and less than 1 MiB in size. They will be displayed as 48x48 images.