groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hamami <>
Subject Groovy : Compare SOAP Response with XML file
Date Tue, 22 Nov 2016 11:16:56 GMT
 0down votefavorite	I want to compare in groovy code my Soap Response with
xml file ignoring order :Here is my code :import
org.custommonkey.xmlunit.Stuffimport org.xmlunit.Stuff//ExpectedString is my
xml converted to text, same for ResponseStringDiff diff =           .withTest(ResponseString)          
.ignoreComments()           .ignoreWhitespace()           .checkForSimilar()          
.withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byName))          
.build();assertFalse("XML similar " + diff.toString(),
diff.hasDifferences())So, as you can see, I used DefaultNodeMatcher, I used
XMLUnit2.0 ... with no result (even not ignoring order or having exception
error while comparing)Is there a solution ? to resolve thisAs I'm desperate
to find a direct one, can I sort my xml and my soap response so i can have a
simple diff ? is there a way to sort it line by line alphabetically ? If
yes, how ?Thank you guys !

View this message in context:
Sent from the Groovy Dev mailing list archive at
View raw message