From 728ade8c617ece2ae48d91f0a54797540133e527 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Fri, 5 May 2023 13:28:00 +1000 Subject: [PATCH] use xml unit to compare xml content Signed-off-by: Olivier Lamy --- pom.xml | 13 +++++++++++++ src/it/ISSUE-80/postbuild.groovy | 9 ++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 583773200..e8f7694b5 100644 --- a/pom.xml +++ b/pom.xml @@ -301,6 +301,18 @@ junit test + + + org.xmlunit + xmlunit-core + 2.9.1 + + + org.xmlunit + xmlunit-legacy + 2.9.1 + + @@ -512,6 +524,7 @@ download-licenses-basic/pom.xml download-licenses-force/pom.xml + true diff --git a/src/it/ISSUE-80/postbuild.groovy b/src/it/ISSUE-80/postbuild.groovy index 9419f31c3..bc5be5978 100644 --- a/src/it/ISSUE-80/postbuild.groovy +++ b/src/it/ISSUE-80/postbuild.groovy @@ -20,7 +20,14 @@ * #L% */ +import org.custommonkey.xmlunit.* +XMLUnit.setIgnoreWhitespace(true) + file = new File(basedir, 'target/licenses.xml'); expectedFile = new File(basedir, 'expected_licenses.xml'); -assert expectedFile.text.equals(file.text); + +def xmlDiff = new Diff(file.text, expectedFile.text) +assert xmlDiff.similar() +assert xmlDiff.identical() + return true; \ No newline at end of file