find me on
-
-
Tags
agile alt.net antiagile BDD bile build automation build automation C# cool Craftsmanship DDD financial flex Google J2ME Java javascript kaizen kanban Lean Mac maven OOD pomodoro process Project Management Project Management Rage rest Ruby Scrum Selenium servicemix Smile Speech spring testing That's Cool! That's Cool! ThoughtWorks timeboxing tweets web Web 2.0 XP-


















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.