Skip to content
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

fixed flakiness in JacksonXmlHandlerTest.java #500

Merged
merged 5 commits into from
Nov 2, 2021

Conversation

FanYuliang
Copy link
Contributor

Hi,

By running the following command:
mvn -pl plugins/rest/ edu.illinois:nondex-maven-plugin:1.1.2:nondex -Dtest=org.apache.struts2.rest.handler.JacksonXmlHandlerTest ,

testObjectToXml method will fail sometimes. This is because fromObject() method of JacksonXmlHandler uses com.fasterxml.jackson.dataformat.xml.XmlMapper, whose marshal strategy that serializes the object is non-deterministic. Thus, the output of toString() method of the serialized xml object is non-deterministic. I fixed the bug by checking the output contains all components of the xml object and the expected length.

@lukaszlenart lukaszlenart merged commit a368cb6 into apache:master Nov 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants