migrate away from legacy xmlunit API
Description
Environment
is related to
Activity
Ian Young March 13, 2018 at 12:50 PM
The -multi
test for the master
branch passes; this includes Windows and both Java 8 and Java 9.
As I don't think there's any worth to back-porting this to the maint-0.9
branch (where Java 7 would also be implicated) I think we're done here.
Ian Young March 13, 2018 at 12:11 PM
Done, master
branch commit d0da9d1675c2a8c070f117c77c67f5f712446477.
This took a bit longer than expected because during the conversion I found that some of the existing tests, and parts of the accumulated test framework, had a bit of a bad smell. Commit comment:
Rework assertXMLIdentical to use new XMLUnit API.
assertXMLIdentical now compares the provided nodes, not their associated documents.
Replace assertXMLEqual with assertXMLIdentical.
XML parser pool used to load test resources no longer drops comments and white space.
Added explicit tests for BaseDOMTest itself to nail down some of its less obvious behaviour.
Adjusted tests and test resources as appropriate.
Some of this is specific to the MDA (which cares more about some odd cases than code that just deals with SAML) but there are parts that should be borne in mind when migrating other things.
Another note in passing: our SerializeSupport.nodeToString
utility method inherits a bug from the underlying Java serializer in that it puts prolog comments after the document element rather than before, which makes debugging of anything to do with XML prologs quite hard. It probably doesn't come up in the IdP stack. The underlying bug is fixed in Java 9, where they did some work bringing in bug fixes from a decade or so ago, and also consolidated the serialisers that were used in Xalan and Xerces to just one.
I'm going to run a -multi
test on this before declaring victory, due to paranoia about Windows and XML declarations.
This project's tests depend on the
xmlunit-legacy
API. It should be migrated to use thexmlunit-core
/xmlunit-matchers
APIs instead.