From: Harald B. <bra...@gm...> - 2015-01-05 18:08:52
|
Hi, >> [even if it seems that your messages don't make it through, please keep the list in CC] sorry, I forgot. >> Input.fromUnknown(Object) It is in my branch: https://github.com/brabenetz/xmlunit/blob/master/src/main/java-core/org/xmlunit/builder/Input.java#L109 > I'll try to have a look and provide feedback soon. Thanks, today I will checkin the CompareMatcher implementation. > > Also I implemented the Method Input.fromJaxb(Object) .... > Ah, nice catch. Could you create a separate pull request just for the > missing JAXBSource part? difficult: I must create a separate branch and checkin the different features. I don't know how good the GIT-Merge of my master branch then works. Maybe I must copy manually all features to the new branch for there pull-requests. Maybe I can separate three Features/Pull-Requests: "Input.fromJaxb with JaxbBuilder", "Diff & DiffBuilder with ComparisonFormatter" (I used the DiffBuilder for the UnitTests of the ComparisonFormatter), "CompareMarshaller" Easier would be one pull request all together from my master branch. ------------- Nice Diff-View with org.junit.ComparisionFailure. ------------- Can I add junit 4 library to xmlunit-hamecrest? I think it's only optional: It will not throw a ClassCastException if the following feature (CompareMatcher.throwComparisonFailure()) is not used. I added a Sceencast and Screenshot as attachement. The CompareMatcher could also be used to throw an org.junit.ComparisionFailure. Eclipse can open a nice Diff-View of the two nodes (see Screencast). IntelliJ should also have this feature: https://youtrack.jetbrains.com/issue/IDEA-57880 Also NetBeans: http://wiki.netbeans.org/NewAndNoteWorthyNB67#JUnit_Integration The syntax is like: assertThat(testSource, CompareMatcher.isSimilar(controlSource).throwComparisonFailure()); with friendly regards, Harald > Gesendet: Montag, 05. Januar 2015 um 14:39 Uhr > Von: "Stefan Bodewig" <bo...@ap...> > An: "Harald Brabenetz" <bra...@gm...> > Cc: xml...@li... > Betreff: Re: xmlunit.org > > [even if it seems that your messages don't make it through, please keep > the list in CC] > > On 2015-01-04, Harald Brabenetz wrote: > > > I think the DiffBuilder is the right place, because CommentLessSource, > > WhitespaceStrippedSource, WhitespaceNormalizedSource makes mostly > > sense if they are used on Control- and Test-Source in the same way. > > "the right place" for specifying, that you want to ignore comments? The > argument that I'll have to treat boths inputs the same is compelling. > > > But the Input.Builder could have the same implementation (maybe by an > > AbstractBuilder implementation?). > > > ------------- > > Diff & DiffBuilder. > > ------------- > > I'm now finished with Diff & DiffBuilder. > > I'll try to have a look and provide feedback soon. > > > ------------- > > Input > > ------------- > > Valid inputs for control and test are all Objects supported by > > Input.fromUnknown(Object). > > From the sound of it I'm not fond of fromUnknown but will first look at > the code before commenting any further. > > > Also I implemented the Method Input.fromJaxb(Object) with the same > > default marshaller rules from javax.xml.bind.JAXB (but with the > > Input.Builder as Result). > > Ah, nice catch. Could you create a separate pull request just for the > missing JAXBSource part? > > > ------------- > > ComparisonFormatter => used in Diff.toString() > > ------------- > > Again, I'll have to defer commenting until I've found time to look at > the code. > > > I created UnitTestCases for each ComparisonType in > > ComparisonFormatterDefaultTest. Only > > ComparisonType.NO_NAMESPACE_SCHEMA_LOCATION I couldn't reproduce: I > > got only ComparisonType.ATTR_VALUE: > > Diff diff = DiffBuilder.compare( > > "<a xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " > > + "xsi:noNamspaceSchemaLocation=\"Book.xsd\"/>", > > there is a typo in the attribute name - a missing "e" in Nam*e*space. > > Cheers > > Stefan > |