Remove support for JAXB

This commit is contained in:
Mikolaj Izdebski 2019-11-05 12:15:57 +01:00
parent 9d1266911e
commit c66208b50d
5 changed files with 76 additions and 38 deletions

View File

@ -1,7 +1,7 @@
From 72b14aa3c437984f15e026aeb3976de978e19436 Mon Sep 17 00:00:00 2001
From 73abcb06636217e52a9d56b4dc3c69bd37141d44 Mon Sep 17 00:00:00 2001
From: Marian Koncek <mkoncek@redhat.com>
Date: Mon, 4 Mar 2019 14:52:59 +0100
Subject: [PATCH] Disable tests requiring network access
Subject: [PATCH 1/4] Disable tests requiring network access
---
.../assertj/XmlAssertNodesByXPathTest.java | 8 ---
@ -142,5 +142,5 @@ index 793e26a..eb4e9fa 100644
public void shouldThrowOnBrokenInstanceWithoutExplicitSchemaSource() {
assertThat(new StreamSource(new File("../test-resources/invalidBook.xml")),
--
2.20.1
2.21.0

View File

@ -1,7 +1,7 @@
From 34381040944bd88047f6fc230cf8b72b23304692 Mon Sep 17 00:00:00 2001
From c81eb91d7b9aa9728dfc83d68a881b4e2a0fa8d2 Mon Sep 17 00:00:00 2001
From: Marian Koncek <mkoncek@redhat.com>
Date: Thu, 29 Aug 2019 13:58:24 +0200
Subject: [PATCH] Port to hamcrest 2.1
Subject: [PATCH 2/4] Port to hamcrest 2.1
---
.../src/main/java/org/xmlunit/matchers/CompareMatcher.java | 3 ---

View File

@ -1,14 +1,14 @@
From e03f1786054c239e8562e0af4d1239970862e581 Mon Sep 17 00:00:00 2001
From 2aa7002c9ff0d6226ff75048dd3cee15a180dd99 Mon Sep 17 00:00:00 2001
From: Marian Koncek <mkoncek@redhat.com>
Date: Wed, 16 Oct 2019 09:32:19 +0200
Subject: [PATCH] Fix test failure
Subject: [PATCH 3/4] Fix test failure
---
.../src/test/java/org/xmlunit/assertj/ValueAssertTest.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/xmlunit-assertj/src/test/java/org/xmlunit/assertj/ValueAssertTest.java b/xmlunit-assertj/src/test/java/org/xmlunit/assertj/ValueAssertTest.java
index d1e3545..87f77ee 100644
index d1e3545..5078360 100644
--- a/xmlunit-assertj/src/test/java/org/xmlunit/assertj/ValueAssertTest.java
+++ b/xmlunit-assertj/src/test/java/org/xmlunit/assertj/ValueAssertTest.java
@@ -224,7 +224,7 @@ public class ValueAssertTest {

View File

@ -0,0 +1,60 @@
From 9866f331db726db0ac6af64649c308b01b34ea56 Mon Sep 17 00:00:00 2001
From: Mikolaj Izdebski <mizdebsk@redhat.com>
Date: Tue, 5 Nov 2019 12:14:08 +0100
Subject: [PATCH 4/4] Drop support for JAXB
---
xmlunit-core/src/main/java/org/xmlunit/builder/Input.java | 4 ++--
.../src/test/java/org/xmlunit/builder/InputTest.java | 7 -------
2 files changed, 2 insertions(+), 9 deletions(-)
diff --git a/xmlunit-core/src/main/java/org/xmlunit/builder/Input.java b/xmlunit-core/src/main/java/org/xmlunit/builder/Input.java
index 5321ff7..2b13cac 100644
--- a/xmlunit-core/src/main/java/org/xmlunit/builder/Input.java
+++ b/xmlunit-core/src/main/java/org/xmlunit/builder/Input.java
@@ -150,8 +150,8 @@ public class Input {
/**
* Build a Source from a Jaxb-Object.
*/
- public static JaxbBuilder fromJaxb(Object jaxbObject) {
- return new JaxbBuilder(jaxbObject);
+ public static Builder fromJaxb(Object jaxbObject) {
+ throw new RuntimeException("This implementation has JAXB support removed");
}
/**
diff --git a/xmlunit-core/src/test/java/org/xmlunit/builder/InputTest.java b/xmlunit-core/src/test/java/org/xmlunit/builder/InputTest.java
index 83ff38a..fac270d 100644
--- a/xmlunit-core/src/test/java/org/xmlunit/builder/InputTest.java
+++ b/xmlunit-core/src/test/java/org/xmlunit/builder/InputTest.java
@@ -31,7 +31,6 @@ import org.w3c.dom.Document;
import org.xmlunit.NullNode;
import org.xmlunit.TestResources;
import org.xmlunit.XMLUnitException;
-import org.xmlunit.builder.jaxb.ComplexNode;
import org.xmlunit.util.Convert;
import org.xmlunit.xpath.JAXPXPathEngine;
@@ -148,10 +147,6 @@ public class InputTest {
allIsWellFor(s, "furry");
}
- @Test public void shouldParseJaxbObject() throws Exception {
- allIsWellFor(Input.fromJaxb(new ComplexNode()).build(), "complexNode");
- }
-
@Test public void shouldParseUnknownToSource() throws Exception {
// from Source
allIsWellFor(Input.from(Input.fromByteArray(readTestFile()).build()).build());
@@ -169,8 +164,6 @@ public class InputTest {
allIsWellFor(Input.from(new URI("file:" + TestResources.ANIMAL_FILE)).build());
// from URL
allIsWellFor(Input.from(new URL("file:" + TestResources.ANIMAL_FILE)).build());
- // from Jaxb-Object
- allIsWellFor(Input.from(new ComplexNode()).build(), "complexNode");
// from InputStream
FileInputStream is = null;
try {
--
2.21.0

View File

@ -1,33 +1,3 @@
# Copyright (c) 2000-2007, JPackage Project
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the
# distribution.
# 3. Neither the name of the JPackage Project nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
Name: xmlunit
Version: 2.6.3
Release: 1%{?dist}
@ -40,6 +10,7 @@ URL: https://www.xmlunit.org/
Patch1: 0001-Disable-tests-requiring-network-access.patch
Patch2: 0002-Port-to-hamcrest-2.1.patch
Patch3: 0003-Fix-test-failure.patch
Patch4: 0004-Drop-support-for-JAXB.patch
BuildRequires: maven-local
BuildRequires: mvn(junit:junit)
@ -101,12 +72,19 @@ This package provides %{summary}.
# This test failure showed up after updating mockito to 3.X, but the error
# message clearly points to assertj-core
%patch3 -p1
%patch4 -p1
%pom_remove_plugin org.codehaus.mojo:buildnumber-maven-plugin
%pom_remove_plugin :maven-assembly-plugin
%mvn_alias "org.xmlunit:xmlunit-legacy" "xmlunit:xmlunit"
# JAXB and JAF are not available in JDK11
%pom_remove_dep javax.activation:* xmlunit-core
%pom_remove_dep javax.xml.bind:* xmlunit-core
%pom_remove_dep com.sun.xml.bind:* xmlunit-core
rm -rf xmlunit-core/src/{main,test}/java/org/xmlunit/builder/{jaxb/,JaxbBuilder.java,JaxbBuilderTest.java}
%build
%mvn_build -s