From: Stefan B. <ste...@fr...> - 2015-01-02 15:29:14
|
Happy new year, On 2014-12-31, Harald Brabenetz wrote: > I moved the Maven-Changes to a branch (So i can work in master-branch on the Diff, DiffMatcher and CompareMatcher): > https://github.com/brabenetz/xmlunit/tree/2.0-maven-changes Good. > --------------------------- > Diff & DiffBuilder > --------------------------- >> Diff myDiff = DiffBuilder.compareControl(Input.fromMemory(myControlXML)) >> .withTest(Input.fromMemory(myTestXML)) >> .build(); >> assertTrue("XML similar " + myDiff.toString(), myDiff.isSimilar()); > Thanks! That's exactally what I have searched for :) I should be able to write down my design ideas in the wiki this coming weekend, feel free to comment there and show me where I went wrong while designing in some kind of a vacuum. :-) > I will try to implement the Diff and DiffBuilder in xmmlunit-core. > Can I move the isSimilar() method to the Builder (e.g.: DiffBuilder.checkForSimilar()). > In case of similar-compare I'm not interested in all the "[not identical] ..." messages from the toString() method (this was a little irritating from XmlUnit 1.x). Well, Diff doesn't have to be the same as it is in 1.x, quite the opposite. Right now I'd say an overall result (maybe accessible via isSimilar/isDifferent) and an Iterable of Differences found would be all it takes. I haven't thought about the toString implementation so far. > --------------------------- > Legacy-Code > --------------------------- > I will also implement some of the old methods from XmlUnit with code > like "new DiffBuilder().ignoreComments()". If you think they are useful, yes. Otherwise people could always wrap their inputs in a CommentLessSource. > Are my assumptions correct?: > XMLUnit.setIgnoreAttributeOrder() => 2.x will always ignore the > attribute order, right? > XMLUnit.setIgnoreComments() => use of "new CommentLessSource(...)" > XMLUnit.setIgnoreDiffBetweenTextAndCDATA() => in 2.x already marked with ComparisonType.NODE_TYPE with ComparisonResult.SIMILAR (another behaviour would require a custom DifferenceEvaluator) > XMLUnit.setIgnoreWhitespace() => use of "new WhitespaceStrippedSource(...)" > XMLUnit.setNormalizeWhitespace => use of "new WhitespaceNormalizedSource(...)" yes, this is what I planned. > --------------------------- > Documentation > --------------------------- > If I'm finished with it, I will start the Wiki Pages: Great, please use the wiki inside the userguide repository. It should be writable for everybody. Cheers Stefan |