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
areSimilar() function support in Java8+ #161
Comments
I'm not sure but it could be related to https://bugs.openjdk.java.net/browse/JDK-8215543 |
Yes, it looks quite a bit like the test failure I've fixed with 23336de - it seems to affect any version of Java post Java8. Back then I didn't find the time to investigate the root cause. but the issue you link is a likely candidate ( |
Here http://java9.wtf/xml-transformer/ I found more info about the issue. |
Interesting. Unfortunately it only confirms the behavior has changed but I still don't see what XMLUnit could do to make Java9+ behave the way we'd want it to. |
Yes, It's true. In order to use the similar() function, I processed the transformer output with a regex to delete the extra lines, like replaceAll("(?m)^[ \t]*\r?\n", "") In StackOverflow mentions a similar workaround for the CDATA tags, related to another bug with the JDK (It solved in JDK 14). https://stackoverflow.com/questions/55853220/handling-change-in-newlines-by-xml-transformation-for-cdata-from-java-8-to-java |
It may be a good idea to collect issues like this in the Wiki. Do you think you could add a blurb on some new kind of "know issues" page or something like that? |
Sure, I like the idea. |
I create here https://github.com/xmlunit/xmlunit/wiki/XMLUnit-with-Java-9-and-above. I hope it helps |
Many thanks! When I said "the wiki" I meant the "user guide", sorry for not being clear about it. I've copied your page to https://github.com/xmlunit/user-guide/wiki/XMLUnit-with-Java-9-and-above |
Hi Guys
BTW Thank you for this project, It's very good and time saver.
I was using it for testing and I was an issue with the areSimilar() function when I use in Java 11+ (In Java 8 works great).
I isolated the sample code here https://github.com/earth001/jaxp-example. I configure a Travis pipeline where you can find the logs https://travis-ci.org/earth001/jaxp-example/builds/556292262 (Only pass in Java 8).
This is the log (It looks like a problem with newlines):
Have you experienced something like this before?
Please let me know if this info is enough or if I could bring something additional.
The text was updated successfully, but these errors were encountered: