I log the differences from my unit test like this :
XMLUnit.setIgnoreWhitespace(true);
Diff xmlDiff = new Diff(expectedXml, result);
DetailedDiff myDiff = new DetailedDiff(xmlDiff);
List<Difference> allDifferences = myDiff.getAllDifferences();
for(Difference d : allDifferences){
log.debug("difference : " + d);
}
The "result" string comes from a Groovy class using XmlSlurper. Also I usually generate "expectedXml" from a Groovy class.
No comments:
Post a Comment