xmlunit/0003-Drop-support-for-JAXB.patch

66 lines
2.6 KiB
Diff
Raw Normal View History

From 4b30dd33332f79c71697c8a9bdbf39d74fb06c4a Mon Sep 17 00:00:00 2001
2019-11-05 11:15:57 +00:00
From: Mikolaj Izdebski <mizdebsk@redhat.com>
Date: Tue, 5 Nov 2019 12:14:08 +0100
Subject: [PATCH 3/3] Drop support for JAXB
2019-11-05 11:15:57 +00:00
---
2022-08-31 06:36:52 +00:00
xmlunit-core/src/main/java/org/xmlunit/builder/Input.java | 6 +++---
2019-11-05 11:15:57 +00:00
.../src/test/java/org/xmlunit/builder/InputTest.java | 7 -------
2022-08-31 06:36:52 +00:00
2 files changed, 3 insertions(+), 10 deletions(-)
2019-11-05 11:15:57 +00:00
diff --git a/xmlunit-core/src/main/java/org/xmlunit/builder/Input.java b/xmlunit-core/src/main/java/org/xmlunit/builder/Input.java
2022-08-31 06:36:52 +00:00
index 157aa7d..d158141 100644
2019-11-05 11:15:57 +00:00
--- a/xmlunit-core/src/main/java/org/xmlunit/builder/Input.java
+++ b/xmlunit-core/src/main/java/org/xmlunit/builder/Input.java
2022-08-31 06:36:52 +00:00
@@ -149,12 +149,12 @@ public class Input {
}
return xml;
}
-
+
2019-11-05 11:15:57 +00:00
/**
* Build a Source from a Jaxb-Object.
*/
- public static JaxbBuilder fromJaxb(Object jaxbObject) {
2022-08-31 06:36:52 +00:00
- return JaxbBuilderFactoryLocator.getFactory().create(jaxbObject);
2019-11-05 11:15:57 +00:00
+ 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
2021-01-28 14:00:57 +00:00
index e767f38..98e3fe7 100644
2019-11-05 11:15:57 +00:00
--- a/xmlunit-core/src/test/java/org/xmlunit/builder/InputTest.java
+++ b/xmlunit-core/src/test/java/org/xmlunit/builder/InputTest.java
2022-08-31 06:36:52 +00:00
@@ -31,7 +31,6 @@ import org.w3c.dom.Document;
2019-11-05 11:15:57 +00:00
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;
2022-08-31 06:36:52 +00:00
@@ -132,10 +131,6 @@ public class InputTest {
2019-11-05 11:15:57 +00:00
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());
2022-08-31 06:36:52 +00:00
@@ -153,8 +148,6 @@ public class InputTest {
2019-11-05 11:15:57 +00:00
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
2021-01-28 14:00:57 +00:00
try (FileInputStream is = new FileInputStream(TestResources.ANIMAL_FILE)) {
allIsWellFor(Input.from(is).build());
2019-11-05 11:15:57 +00:00
--
2022-08-31 06:36:52 +00:00
2.37.2
2019-11-05 11:15:57 +00:00