You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bo...@apache.org on 2026/07/15 19:59:12 UTC

(ant-ivy) branch ivy-1670-use-modern-xmlunit updated (1c6afbce -> 19ecc647)

This is an automated email from the ASF dual-hosted git repository.

asf-gitbox-commits pushed a change to branch ivy-1670-use-modern-xmlunit
in repository https://gitbox.apache.org/repos/asf/ant-ivy.git


 discard 1c6afbce [IVY-1670] use a more modern version of XMLUnit
     new 19ecc647 [IVY-1670] use a more modern version of XMLUnit

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (1c6afbce)
            \
             N -- N -- N   refs/heads/ivy-1670-use-modern-xmlunit (19ecc647)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../ivy/plugins/parser/xml/XmlModuleDescriptorWriterTest.java | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)


(ant-ivy) 01/01: [IVY-1670] use a more modern version of XMLUnit

Posted by bo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

asf-gitbox-commits pushed a commit to branch ivy-1670-use-modern-xmlunit
in repository https://gitbox.apache.org/repos/asf/ant-ivy.git

commit 19ecc647efc6ff92c6fdeb1ebdd76705c12f2420
Author: Stefan Bodewig <bo...@apache.org>
AuthorDate: Wed Jul 15 21:35:38 2026 +0200

    [IVY-1670] use a more modern version of XMLUnit
---
 asciidoc/release-notes.adoc                              |  2 ++
 ivy.xml                                                  |  3 ++-
 .../parser/xml/XmlModuleDescriptorWriterTest.java        | 16 ++++++++++------
 version.properties                                       |  2 +-
 4 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/asciidoc/release-notes.adoc b/asciidoc/release-notes.adoc
index f5006e0e..c053b31e 100644
--- a/asciidoc/release-notes.adoc
+++ b/asciidoc/release-notes.adoc
@@ -52,6 +52,8 @@ Note, if you have resolved dependencies with version of Ivy prior to 2.6.1, you
 - DOCUMENTATION: bla bla bla (jira:IVY-1234[]) (Thanks to Jane Doe)
 ////
 
+- IMPROVEMENT: switched to using XMLUnit 2.x in tests (jira:IVY-1670[])
+
 == Committers and Contributors
 
 Here is the list of people who have contributed source code and documentation up to this release. Many thanks to all of them, and also to the whole IvyDE community contributing ideas and feedback, and promoting the use of Apache Ivy !
diff --git a/ivy.xml b/ivy.xml
index 2841c3b0..9856f6ee 100644
--- a/ivy.xml
+++ b/ivy.xml
@@ -69,7 +69,8 @@
         <dependency org="org.apache.ant" name="ant-junit" rev="${apache-ant.version}" conf="test" transitive="false"/>
         <dependency org="org.apache.ant" name="ant-junit4" rev="${apache-ant.version}" conf="test" transitive="false"/>
         <dependency org="ant-contrib" name="ant-contrib" rev="${ant-contrib.version}" conf="test" transitive="false"/>
-        <dependency org="xmlunit" name="xmlunit" rev="${xmlunit.version}" conf="test" transitive="false"/>
+        <dependency org="org.xmlunit" name="xmlunit-core" rev="${xmlunit.version}" conf="test" transitive="false"/>
+        <dependency org="org.xmlunit" name="xmlunit-matchers" rev="${xmlunit.version}" conf="test" transitive="false"/>
 
         <!-- Global excludes -->
         <exclude org="junit" module="junit" conf="core,default,httpclient,oro,vfs,sftp,pack200,standalone,ant"/>
diff --git a/test/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorWriterTest.java b/test/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorWriterTest.java
index 74d8a869..87fae12c 100644
--- a/test/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorWriterTest.java
+++ b/test/java/org/apache/ivy/plugins/parser/xml/XmlModuleDescriptorWriterTest.java
@@ -38,12 +38,15 @@ import org.apache.ivy.util.FileUtil;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
+import org.xmlunit.diff.DefaultNodeMatcher;
 
 import static org.apache.ivy.core.module.descriptor.Configuration.Visibility.PUBLIC;
-import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
+import static org.hamcrest.MatcherAssert.assertThat;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
+import static org.xmlunit.matchers.CompareMatcher.isSimilarTo;
+import static org.xmlunit.diff.ElementSelectors.byNameAndAllAttributes;
 
 public class XmlModuleDescriptorWriterTest {
     private static String LICENSE;
@@ -162,14 +165,15 @@ public class XmlModuleDescriptorWriterTest {
         XmlModuleDescriptorWriter.write(md, LICENSE, dest);
 
         assertTrue(dest.exists());
-        String wrote = FileUtil.readEntirely(new BufferedReader(new FileReader(dest)))
-                .replaceAll("\r\n", "\n").replace('\r', '\n');
+        String wrote = FileUtil.readEntirely(new BufferedReader(new FileReader(dest)));
         wrote = wrote.replaceFirst("publication=\"([0-9])*\"", "publication=\"20140429153143\"");
         System.out.println(wrote);
 
-        String expected = readEntirely("test-write-extrainfo-from-maven.xml").replaceAll("\r\n",
-            "\n").replace('\r', '\n');
-        assertXMLEqual(expected, wrote);
+        String expected = readEntirely("test-write-extrainfo-from-maven.xml");
+        assertThat(wrote,
+                   isSimilarTo(expected)
+                   .withNodeMatcher(new DefaultNodeMatcher(byNameAndAllAttributes))
+                   .ignoreWhitespace());
     }
 
     @Test
diff --git a/version.properties b/version.properties
index 65341c01..1268790b 100644
--- a/version.properties
+++ b/version.properties
@@ -43,4 +43,4 @@ jsch.agentproxy.version=0.0.9
 jsch.version=0.1.55
 junit.version=4.13.2
 oro.version=2.0.8
-xmlunit.version=1.6
+xmlunit.version=2.12.0