xmvn/0001-Port-to-Xmlunit-2.6.2.patch
2019-04-19 11:03:42 +02:00

87 lines
3.2 KiB
Diff

From 7049d71ed85851fb5ca25b88c5e33b51cf3a5dac Mon Sep 17 00:00:00 2001
From: Marian Koncek <mkoncek@redhat.com>
Date: Fri, 19 Apr 2019 09:32:40 +0200
Subject: [PATCH] Port to Xmlunit 2.6.2
---
xmvn-parent/pom.xml | 10 +++++-----
.../xmvn/tools/install/impl/InstallerTest.java | 6 ++----
2 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/xmvn-parent/pom.xml b/xmvn-parent/pom.xml
index d4f9dda..5c21cfa 100644
--- a/xmvn-parent/pom.xml
+++ b/xmvn-parent/pom.xml
@@ -122,7 +122,7 @@
<sitePluginVersion>3.6</sitePluginVersion>
<sourcePluginVersion>3.0.1</sourcePluginVersion>
<surefireVersion>2.19.1</surefireVersion>
- <xmlunitVersion>1.6</xmlunitVersion>
+ <xmlunitVersion>2.6.2</xmlunitVersion>
</properties>
<dependencyManagement>
@@ -228,8 +228,8 @@
<version>${junitVersion}</version>
</dependency>
<dependency>
- <groupId>xmlunit</groupId>
- <artifactId>xmlunit</artifactId>
+ <groupId>org.xmlunit</groupId>
+ <artifactId>xmlunit-assertj</artifactId>
<version>${xmlunitVersion}</version>
</dependency>
<dependency>
@@ -336,8 +336,8 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>xmlunit</groupId>
- <artifactId>xmlunit</artifactId>
+ <groupId>org.xmlunit</groupId>
+ <artifactId>xmlunit-assertj</artifactId>
<scope>test</scope>
</dependency>
<dependency>
diff --git a/xmvn-tools/xmvn-install/src/test/java/org/fedoraproject/xmvn/tools/install/impl/InstallerTest.java b/xmvn-tools/xmvn-install/src/test/java/org/fedoraproject/xmvn/tools/install/impl/InstallerTest.java
index 9fb7d90..bece0b2 100644
--- a/xmvn-tools/xmvn-install/src/test/java/org/fedoraproject/xmvn/tools/install/impl/InstallerTest.java
+++ b/xmvn-tools/xmvn-install/src/test/java/org/fedoraproject/xmvn/tools/install/impl/InstallerTest.java
@@ -15,8 +15,6 @@
*/
package org.fedoraproject.xmvn.tools.install.impl;
-import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
-import static org.custommonkey.xmlunit.XMLUnit.setIgnoreWhitespace;
import static org.easymock.EasyMock.expect;
import static org.easymock.EasyMock.replay;
import static org.easymock.EasyMock.verify;
@@ -40,6 +38,7 @@ import org.junit.runner.RunWith;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
+import org.xmlunit.assertj.XmlAssert;
import org.fedoraproject.xmvn.artifact.DefaultArtifact;
import org.fedoraproject.xmvn.config.Artifact;
@@ -188,7 +187,6 @@ public class InstallerTest
protected void assertMetadataEqual( Path expected, Path actual )
throws Exception
{
- setIgnoreWhitespace( true );
assertTrue( Files.isRegularFile( actual ) );
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
@@ -208,7 +206,7 @@ public class InstallerTest
unifyUuids( expectedXml.getElementsByTagName( "uuid" ) );
unifyUuids( actualXml.getElementsByTagName( "uuid" ) );
- assertXMLEqual( expectedXml, actualXml );
+ XmlAssert.assertThat( expectedXml ).and( actualXml ).ignoreWhitespace().areSimilar();
}
@Test
--
2.20.1