Thursday, August 23, 2007

 

Comparing XML

Got a bit of a refactoring job done. I wrote my own xml doc compare routine for my JUnit tests. In this unit test I create a XML fragment with JAXB and compare this against another XML fragment created out of a string. I was not completely happy with this routine and googled for a java diff library. I quickly stumbled upon XMLUnit, a xml compare extension for JUnit. Unfortunately it doesn't support JUnit 4.0 :-( Hmmm, junit testing without annotations is just so....90s ;-P. Posted a message on their forums asking for JUnit 4.0 support, but I don't expect to much in the near future since they only did a release a month ago. One good thing though, they have a lot of routines for comparing XML, Specifically the Diff class, which I'm using now and cleans up my code a lot :-)

Comments: Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?