-
bumped xmlunit-assertj3's dependency on assert to 3.27.7.
This is to make people aware of https://github.com/assertj/assertj/security/advisories/GHSA-rqfh-9r24-8c9r
XMLUnit itself does not use the affected code in AssertJ so the upgrade is not strictly necessary - and this is why the xmlunit-assertj module is not updated. In fact the assertions provided by xmlunit-assertj3 are the recommended upgrade path for users of AssertJ 4.x.
-
the
xmlunit-jakarta-jaxb-implno longer depends onorg.glassfish.jaxb:jaxb-runtimedirectly. Issue #313 PR #314This is a breaking change and may force you to add an explicit dependency if you are using the module and rely on XMLUnit to provide the JAXB implementation.
- marked OSGi
Import-Packageoptional for javax.xml.bind packages in xmlunit-core. Also fixed theExport-Packageheader of the legacy module. Issue #300 PR #301
- the published POM of xmlunit-legacy lacked the dependency on xmlunit-core. Issue #296
-
placeholders can now also be used inside of the local part of
xsi:typeattributes. PR #293 -
PlaceholderDifferenceEvaluator would cause ClassCastException for documents with differences in
xsi:typeattributes. Issue #276 -
updated a bunch of Maven plugins, in particular we now create CylcloneDX files using version 1.6 of the schema. PR #292
-
updated bytebuddy dependency of xmlunit-assertj to 2.12.23 in order to support Java 17 properly
-
Migrated form TravisCI to CircleCI Issue #289
-
Migrated to Sonatype's Central Portal Issue #287
-
added a new BOM artifact xmlunit-bom Issue #269
-
Comparisonhas earned a new convenience constructor. PR #280 by @hiufung-kwok -
Input.fromnow detectsReaderarguments and usesfromReader. PR #281 by @SThomasP
-
add a new
ElementSelectors.byNameAndAllAttributesvariant that filters attributes before deciding whether elements can be compared. Inspired by Issue #259 -
By default the
TransformerFactorys created will now try to disable extension functions. If you need extension functions for your transformations you may want to pass in your own instance ofTransformerFactoryandTransformerFactoryConfigurermay help with that. Inspired by Issue #264 This is tracked as CVE-2024-31573. -
JAXPXPathEnginewill now try to disable the execution of extension functions by default but usesXPathFactory#setPropertywhich is not available prior to Java 18. You may want to enable secure processing on anXPathFactoryinstance you pass toJAXPXPathEngineinstead - andXPathFactoryConfigurermay help with that.
-
fixed some AssertJ tests that didn't work on Windows. Issue #252 and PR #253 by @Boiarshinov
-
added overloads to
ElementSelectors.byXPaththat accept aXPathEngineargument. Issue #255 -
added Cyclone DX SBOMs to release artifacts
-
added a new module
xmlunit-jakarta-jaxb-implthat makesInput.fromJaxbusejakarta.xml.bindrather thanjavax.xml.bind. For more details see the User's Guide.This change is not fully backwards compatible. The
JaxbBuilderclass has become abstract and thewithMarshallermethod has changed its signature. For most cases the change will not be noticed and for almost all other cases it should be enough to re-compile your code against XMLUnit 2.9.x. -
added
NodeFilters#satisfiesAllandsatifiesAnymethods to make it easier to combine multiple node filters. added to simplify the use case of #249
- improved comparison performance for documents with many siblings based on a suggestion by @gerpres made in #236
-
added a new
fullDescriptionmethod toDiffthat provides a string-representation of all differences - not just the first one liketoStringdoes. PR #235 fixing #232 by @Boiarshinov -
made sure AssertJ's methods to override the assertion message like
withFailMessageare honored. #225 -
adjusted unit tests so they pass when AssertJ 3.19.0 is used. PR #212 by mmathesius
CompareAssertinside the AssertJ3 module swapped the expected and actual parameters when creating the assertion error. #210 by @f-lopes
-
added a new xmlunit-assertj3 module that requires AssertJ 3.18.1 or later.
This module no longer uses AssertJ internal classes that are not exported to OSGi environments and thus fixes issue #203.
The module (like AssertJ 3.x itself) requires Java 8 at runtime and is similar to xmlunit-assertj but is no drop-in replacement. It uses a different Java package from xmlunit-assertj and
CompareAssertwill no longer throw a JUnit 4.xComparisonExceptionbut an opentest4jAssertionFailedErrorinstead.The existing xmlunit-assertj module will still be supported in future releases but expect AssertJ 3.x specific changes to only get applied to xmlunit-assertj3.
Many thanks to @Zegveld, @scordio and @joel-costigliola.
-
changed optional JAXB dependency to use Jakarta XML Binding API PR #186 by @endrejeges
-
bumped the bytebuddy dependency to 1.10.10 for the AssertJ module in the hope it would help with #188
- and change its scope from provided to compile time, which should finally fix the issue.
-
added a new
extractingTextmethod toMultipleNodeAssertto make it possible to write AssertJ assertions against the textual content of nodes more easily. Issue #192 and PR #193 by @keesvandieren -
changed the minimum Java version required from Java 6 to Java 7 for all modules (it has already been Java 7 for the AssertJ module before).
-
DefaultNodeMatcherwith multipleElementSelectors could fail to find the best matches as the order ofElementSelectors should select them. #197 -
Inputbuilder now supportsjava.nio.file.Path#196 -
It is now possible to specify a custom
TransformerFactoryforDefaultComparisonFormatter. #195
This version contains a backwards incompatible change to the
PlaceholderHandler interface that is part of the experimental
placeholders module: The evaluate method now receives a variable
number of string arguments in addition to the textual content of the
element/attribute. This allows placeholders like
${xmlunit.matchesRegex(some\s*regex)}.
-
the AssertJ tests now pass on non-English locales as well Issue #180
-
added a workaround for a binary incompatible change in AssertJ that caused xmlunit-assertj to be incompatible with AssertJ 3.15.0 Issue #181
-
added a new
${xmlunit.matchesRegex(regex)}placeholder PR #178 by @Jazzyekim. -
add a new
${xmlunit.isDateTime}placeholder inspired by #xmlunit.net/31 and #xmlunit.net/32 by MilkyWare Issue #174 -
avoid unnecessary creation of
DocumentBuilderFactoryinDOMDifferenceEnginewhen a custom factory has been provided toDiffBuilder. Issue #182
-
the dependencies on JAXB implementation and its transitive dependencies has been promoted from test scope to optional for Java 9 and later Issue #162
-
added
containsAnyNodeHavingXPath,containsAllNodesHavingXPathandhasXPathassertions to xmlunit-assertj. -
added
extractingAttributemethod to xmlunit-assertj. -
removed some redundant
instanceofchecks. PR #171 by @PascalSchumacher. -
xmlunit-assertj should now work with AssertJ-Core 3.13.x Issue #166
-
the XPath values for comparisons resulting in
CHILD_LOOKUPdifferences could be wrong whenNodeFilters were present. XMLUnit.NET Issue xmlunit.net/#29 -
xmlunit-legacy will now use
NewDifferenceEngineeven when anElementQualifierdifferent from the built-in ones is used.
-
add a new
${xmlunit.isNumber}placeholder Issue #153 via PR #154 by @NathanAtClarity. -
the XPath values of a comparison should not be affected by any
NodeFilterbeing in effect. Issue #156
-
xmlunit-assertj can now be used with AssertJ 3.9.1+ as well as 2.9.x. Issue #135.
-
added a new
TypeMatcherto the xmlunit-matchers module that can be used to conveniently translate XPath result strings into numbers or booleans and verify they match type safe assertions. Issue #133 via PR #137. -
fixed the
Automatic-Module-Nameof all modules to be valid Java identifiers. Issue #136.
-
add a new module with AssertJ support. This module requires Java7 at runtime. Issue #117 via PRs #120, #126, #128, and #129 by @krystiankaluzny.
-
The
XPathFactoryused by the XPath related Hamcrest matchers is now configurable. Issue #131 via PRs #132
-
add a new experimental project xmlunit-placeholders which aims to use
${xmlunit.FOO}expressions inside of the control document to allow for a DSL-like approach of defining more complex tests. This initial seed only supports${xmlunit.ignore}which can be used to make XMLUnit ignore the element containing this text. PR #105 by @zheng-wang. -
added
withDocumentBuilderFactorymethods toHasXPathMatcherandEvaluateXPathMatcherto allow explicit configuration of theDocumentBuilderFactoryused. Issue #108. -
the
DocmentBuilderFactoryandTransformerFactoryinstances used by XMLUnit are now configured to not load any external DTDs or parse external entities. They are now configured according to the OWASP recommendations for XML eXternal Entity injection preventions. TheTransformerFactoryused by theorg.xmlunit.transform.Transformationclass is still configured to load external stylesheets, though.For the
legacypackage XXE prevention has to be enabled viaXMLUnit.enableXXEProtectionexplicitly.This is a breaking change and you may need to provide
DocmentBuilderFactoryorTransformerFactoryinstances of your own if you need to load external entities.The
SAXParserFactoryandSchemaFactoryinstances used inside of thevalidationpackage have not been changed as their use is likely to require loading of external DTDs or schemas.Issue #91.
-
the configured
NodeFilteris now applied before comparingDocumentTypenodes.This change breaks backwards compatibility as the old behavior was to ignore
DocumentTypewhen counting the children of theDocumentnode but not when actually comparing theDocumentType. Prior to this change if one document had a document type declaration but the other didn't, aHAS_DOCTYPE_DECLARATIONdifference was detected, this will no longer be the case now. If you want to detect this difference, you need to use a more lenientNodeFilterthanNodeFilters.Default(i.e.NodeFilters.AcceptAll) but then you will see an additionalCHILD_NODELIST_LENGTHdifference.The legacy package has been adapted and will behave as before even when using
NewDifferenceEngine.Issue #116.
-
added a new
SourceimplementationElementContentWhitespaceStrippedSourcewhich is similar toWhitespaceStrippedSourcebut only affects text nodes that solely consist of whitespace and doesn't affect any other text nodes. Also added convenienceignoreElementContentWhitespacemethods toDiffBuilderandCompareMatcher. Issue #119.
-
Made Travis build work with OpenJDK6 again. PR #101 by @PascalSchumacher.
-
CompareMatcher'sdescribeTomethod threw an exception if the comparison yielded no differences. Issue #107.
CommentLessSource,DiffBuilder#ignoreCommentsandCompareMatcher#ignoreCommentsnow all use XSLT version 2.0 stylesheets in order to strip comments. New constructors and methods have been added if you need a different version of XSLT (in particular if you need 1.0 which used to be the default up to XMLUnit 2.4.0). Issue #99.
- made
DefaultComparisonFormattermore subclass friendly. Issue #93.
-
JAXPValidatorandValidationMatchernow accept usingSchemainstances for the schema when validating instance documents. Issue #89. -
updated test dependency to Mockito 2.1.0 PR #87 by @PascalSchumacher.
- The
DocumentBuilderFactoryset onDiffBuilderwasn't used properly whenignoreWhitespaceornormalizeWhitespacehas been set. Issue #86.
-
Input.fromByteArrayandInput.fromStringnow returnSources that can be used multiple times. Issue #84. -
The
DocumentBuilderFactoryused byDOMDifferenceEngineis now configurable. Issue #83.
-
various code style fixes PR #74, PR #75, PR #78, PR #79, PR #80 by @georgekankava.
-
CompareMatcherandValidationMatcherthrewNullPointerExceptions when combined with another failingMatcher. Issue #81.
-
fixed swapped constant assignments in
DifferenceEvaluatorsPR #53 by @cboehme. -
added
CompareMatcher#withNamespaceContextPR #54 by @cboehme. -
DiffBuilder#withNamespaceContextfalsely claimed the map would pass prefixes to URIs rather than the other way around. PR #62 and issue #52 by @mariusneo. -
various code style fixes PR #64, PR #65, PR #67, PR #68, PR #69, PR #70 and PR #71 by @georgekankava.
-
new
hasXPathmatchers that check for the existence of an XPath inside of a piece of XML or verify additional assertions on the XPath's stringified result. PR #63 and PR #66 by @mariusneo. -
added new implementations inside
DifferenceEvaluatorsfor common tasks like changing the outcome for specific differences or ignoring changes inside the XML prolog. -
DiffBuilder.withComparisonFormatternow also fully applies to theDifferences contained within theDiff. Issue #55
- implemented
DiffBuilder.withComparisonFormattermentioned in user guide. Issue #51 - eliminated dead-stores. PR #52 by @georgekankava.
- the
schemaURIinValidatorhas been pushed down toParsingValidatorsince it is only used inside this class. - the mapping of
DifferenceEngine#setNamespaceContexthas been inverted from prefix -> URI to URI -> prefix in order to be consistent with the same concept inXPathEngine. CommentLessSourceuses an XSLT stylesheet internally which lacked the requiredversionattribute. PR #47 by @phbenisc.Comparisonnow also contains the XPath of the parent of the compared nodes or attributes which is most useful in cases of missing nodes/attributes because the XPath on one side isnullin these cases. Issue #48 implemented via PR #50 by @eguib.
- the xmlunit-parent POM no longer uses the deprecated
org.sonatype.oss:oss-parentas its parent. - added new overloads to
XPathEngine - fixed the XPath context used by the
byXPathelement selector so that "." now refers to the current element. Issue #39 ElementSelectors#conditionalBuildernow stops at the first predicate returningtrue, even if the associatedElementSelectorreturns false. Issue #40
This is the initial alpha release of XMLUnit.NET. We expect the API to change for the next release based on user feedback.