Skip to content

SWS-1035 - XMLUnit migration from 1.5 to 2.6.2 #122

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from

Conversation

leaqui
Copy link
Contributor

@leaqui leaqui commented Oct 18, 2018

Basically I replaced the use of

org.custommonkey.xmlunit.XMLAssert.assertXMLEqual()

with

org.xmlunit.assertj.XmlAssert.assertThat(x).and(y).areSimilar()

following the example in https://github.com/xmlunit/xmlunit#comparing-two-documents using AssertJ.

I also corrected an error at

https://github.com/spring-projects/spring-ws/compare/master...leaqui:SWS-1035?expand=1#diff-267dffc46eb1bcd24a2daf06428aff1eL59

there, the assertXMLSimilar() method, was wrong. It returns the opposite of what is needed. The error resides in the false argument of

org.custommonkey.xmlunit.XMLAssert.assertXMLEqual(compareXML(expectedDocument, resultDocument), false)

Also, I have to change the order of some tags at

https://github.com/spring-projects/spring-ws/compare/master...leaqui:SWS-1035?expand=1#diff-66472375685665e43f5a84d2d94670e9

https://github.com/spring-projects/spring-ws/compare/master...leaqui:SWS-1035?expand=1#diff-e7691ec6d1c488508fb11504c2940815

https://github.com/spring-projects/spring-ws/compare/master...leaqui:SWS-1035?expand=1#diff-57144daa10fc56222a5673f414b4d6bd

https://github.com/spring-projects/spring-ws/compare/master...leaqui:SWS-1035?expand=1#diff-74695df9f89dcef0db6c8590fde8c1e3

https://github.com/spring-projects/spring-ws/compare/master...leaqui:SWS-1035?expand=1#diff-539160ae71b2fb6cb54315dfee3c7bcc

https://github.com/spring-projects/spring-ws/compare/master...leaqui:SWS-1035?expand=1#diff-f52c5ff62d1a2592fed7ae4b710d5a91

because by default element order is significant in XMLUnit 2.x

Migration of spring-ws-test didn´t need for a major refactor. The biggest changes are at:

https://github.com/spring-projects/spring-ws/compare/master...leaqui:SWS-1035?expand=1#diff-741b860aab67e4e1290d660e6bd57210

https://github.com/spring-projects/spring-ws/compare/master...leaqui:SWS-1035?expand=1#diff-9b4789291a43675fa7cb8a7d64d622f7

@@ -179,6 +179,12 @@
<artifactId>xmlunit-assertj</artifactId>
<version>${xmlunit.version}</version>
<scope>test</scope>
<exclusions>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added because:

Dependency convergence error for org.assertj:assertj-core:2.9.0 paths to dependency are:
+-org.springframework.ws:spring-ws:3.0.4.BUILD-SNAPSHOT
  +-org.xmlunit:xmlunit-assertj:2.6.2
    +-org.assertj:assertj-core:2.9.0
and
+-org.springframework.ws:spring-ws:3.0.4.BUILD-SNAPSHOT
  +-org.assertj:assertj-core:3.9.0

@gregturn
Copy link
Contributor

gregturn commented Dec 1, 2020

Resolved via #1159.

@gregturn gregturn closed this Dec 1, 2020
@gregturn gregturn self-assigned this Dec 1, 2020
@gregturn gregturn added in: test status: duplicate A duplicate of another issue labels Dec 1, 2020
@gregturn gregturn added this to the 3.1.0-M1 milestone Dec 1, 2020
@gregturn
Copy link
Contributor

gregturn commented Dec 1, 2020

Thanks @leaqui for your efforts, but I made the same changes recently when I found time to ALSO migrate the project to JUnit 5 + AssertJ.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants