XmlUnit

<XmlUnit/>
XMLUnit – JUnit and NUnit testing for XML

For those of you who’ve got into it you’ll know that test driven development is great. It gives you the confidence to change code safe in the knowledge that if something breaks you’ll know about it. Except for those bits you don’t know how to test. Until now XML has been one of them. Oh sure you can use “<stuff></stuff>”.equals(“<stuff></stuff>”); but is that really gonna work when some joker decides to output a <stuff/>? — damned right it’s not ;-)

XML can be used for just about anything so deciding if two documents are equal to each other isn’t as easy as a character for character match. Sometimes

<stuff-doc>
<stuff>
Stuff Stuff Stuff
</stuff>
<more-stuff>
Some More Stuff
</more-stuff>
</stuff-doc>

equals

<stuff-doc>
<more-stuff>
Some More Stuff</more-stuff>
<stuff>Stuff Stuff Stuff</stuff>
</stuff-doc>

and sometimes it doesn’t… With XMLUnit you get the control, and you get to decide.

This entry was posted in Uncategorized and tagged . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>