The "/Xming-fonts/7.5.0.8..ts-7-5-0-8-setup.exe" file could not be found or is not available. Please select another file.

XML Unit

10 Recommendations
184 Downloads (This Week)
Download xmlunit-1.3-bin.zip
Browse All Files

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.

XML Unit Web Site

User Ratings

 
 
10
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 Logan 2012-03-23

    Great app

  • Posted by z_kvn 2012-01-12

    I find XMLUnit pretty good althouth I did spot some minor bugs. @lazyberezovsky: Documentation available here http://xmlunit.sourceforge.net/userguide/XMLUnit-Java.pdf

  • Posted by lazyberezovsky 2010-07-06

    Well, I didn't use it a lot, but I have an opinion already. 1) API - why not to copy Java version? Is it very comfortable to create new XmlDiff AND always call Compare method? Similar and Identical much more descriptive than Equals and Identical. BTW where is .Net naming (IsIdentical, IsSimilar)? 2) About features - if attributes placed in different order, xml is not identical. If there is a white space, xml is not identical. It was enough for me, to stop using this XmlUnit version. Also I didn't find difference in behavior between Equal and Identical. 3) There is no xml documentation. Why should I spend time reviewing all your classes and guessing what they are doing? So, I didn't find any advantages of .Net XmlUnit - comparing strings gives same result, but saves your time. P.S. I found, that DiffConfiguration can set validation of attriubutes order and white spaces. But anyway, output of xmlunit is still awful - no tag name of error, no char position. It is more useless, than string comparision, because last one shows WHAT is wrong. Not just difference Id and red line. Completely useless library.

Read more reviews

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