diff --git a/.gitignore b/.gitignore index e902fd1..ccc8b67 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/xmlunit-2.6.3-src.tar.gz +SOURCES/xmlunit-2.10.0.tar.gz diff --git a/.xmlunit.metadata b/.xmlunit.metadata index eccd584..bb05feb 100644 --- a/.xmlunit.metadata +++ b/.xmlunit.metadata @@ -1 +1 @@ -19d9c8df1d4645d59e15a27e978370964fd45030 SOURCES/xmlunit-2.6.3-src.tar.gz +8bade5ec2888fa9b7adee610311ae2839f83b11a SOURCES/xmlunit-2.10.0.tar.gz diff --git a/SOURCES/0001-Disable-tests-requiring-network-access.patch b/SOURCES/0001-Disable-tests-requiring-network-access.patch index e3abb0f..85b4f05 100644 --- a/SOURCES/0001-Disable-tests-requiring-network-access.patch +++ b/SOURCES/0001-Disable-tests-requiring-network-access.patch @@ -1,146 +1,67 @@ -From 73abcb06636217e52a9d56b4dc3c69bd37141d44 Mon Sep 17 00:00:00 2001 +From e481d5b31aadaf8c9fc20280665b13ebd74c7d79 Mon Sep 17 00:00:00 2001 From: Marian Koncek -Date: Mon, 4 Mar 2019 14:52:59 +0100 +Date: Fri, 9 Sep 2022 15:08:45 +0200 Subject: [PATCH 1/4] Disable tests requiring network access --- - .../assertj/XmlAssertNodesByXPathTest.java | 8 --- - .../assertj/XmlAssertValidationTest.java | 51 ------------------- - .../assertj/XmlAssertValueByXPathTest.java | 8 --- - .../matchers/ValidationMatcherTest.java | 13 ----- - 4 files changed, 80 deletions(-) + .../java/org/custommonkey/xmlunit/test_AbstractNodeTester.java | 2 +- + .../java/org/custommonkey/xmlunit/test_DifferenceEngine.java | 2 +- + .../java/org/custommonkey/xmlunit/test_NewDifferenceEngine.java | 2 +- + .../src/test/java/org/custommonkey/xmlunit/test_Validator.java | 2 +- + 4 files changed, 4 insertions(+), 4 deletions(-) -diff --git a/xmlunit-assertj/src/test/java/org/xmlunit/assertj/XmlAssertNodesByXPathTest.java b/xmlunit-assertj/src/test/java/org/xmlunit/assertj/XmlAssertNodesByXPathTest.java -index 6499f67..71267c3 100644 ---- a/xmlunit-assertj/src/test/java/org/xmlunit/assertj/XmlAssertNodesByXPathTest.java -+++ b/xmlunit-assertj/src/test/java/org/xmlunit/assertj/XmlAssertNodesByXPathTest.java -@@ -42,14 +42,6 @@ public class XmlAssertNodesByXPathTest { - assertThat(null).nodesByXPath("//foo"); +diff --git a/xmlunit-legacy/src/test/java/org/custommonkey/xmlunit/test_AbstractNodeTester.java b/xmlunit-legacy/src/test/java/org/custommonkey/xmlunit/test_AbstractNodeTester.java +index 3a8ac80..df02659 100644 +--- a/xmlunit-legacy/src/test/java/org/custommonkey/xmlunit/test_AbstractNodeTester.java ++++ b/xmlunit-legacy/src/test/java/org/custommonkey/xmlunit/test_AbstractNodeTester.java +@@ -176,7 +176,7 @@ public class test_AbstractNodeTester extends TestCase { } -- @Test -- public void testNodesByXPath_withNull_shouldFailed() { -- -- thrown.expectAssertionError(format("%nExpecting not blank but was:")); -- -- assertThat("").nodesByXPath(null); -- } -- - @Test - public void testNodesByXPath_withWhitespacesOnly_shouldFailed() { - -diff --git a/xmlunit-assertj/src/test/java/org/xmlunit/assertj/XmlAssertValidationTest.java b/xmlunit-assertj/src/test/java/org/xmlunit/assertj/XmlAssertValidationTest.java -index cfa46ce..8031ede 100644 ---- a/xmlunit-assertj/src/test/java/org/xmlunit/assertj/XmlAssertValidationTest.java -+++ b/xmlunit-assertj/src/test/java/org/xmlunit/assertj/XmlAssertValidationTest.java -@@ -82,47 +82,6 @@ public class XmlAssertValidationTest { - assertThat(xml).isValidAgainst(xsd); + // never called as NodeTest directly jumps to the document element +- public void testDocumentType() throws Exception { ++ public void no_testDocumentType() throws Exception { + AbstractNodeTester t = new AbstractNodeTester() { }; + DocumentType n = XMLUnit + .buildControlDocument("" +diff --git a/xmlunit-legacy/src/test/java/org/custommonkey/xmlunit/test_DifferenceEngine.java b/xmlunit-legacy/src/test/java/org/custommonkey/xmlunit/test_DifferenceEngine.java +index 344d66c..35220b8 100644 +--- a/xmlunit-legacy/src/test/java/org/custommonkey/xmlunit/test_DifferenceEngine.java ++++ b/xmlunit-legacy/src/test/java/org/custommonkey/xmlunit/test_DifferenceEngine.java +@@ -1020,7 +1020,7 @@ public class test_DifferenceEngine extends TestCase implements DifferenceConstan + listener.different); } -- @Test -- public void testIsValidAgainst_withEmptySourcesArray_shouldPass() { -- -- StreamSource xml = new StreamSource(new File("../test-resources/BookXsdGenerated.xml")); -- -- assertThat(xml).isValidAgainst(); -- assertThat(xml).isValidAgainst(new Object[0]); -- } -- -- @Test -- public void testIsValidAgainst_withBrokenXmlAndEmptySourcesArray_shouldFailed() { -- -- thrown.expectAssertionError("1. line=9; column=8; type=ERROR;" + -- " message=cvc-complex-type.2.4.b: The content of element 'Book' is not complete." + -- " One of '{\"https://www.xmlunit.org/publishing\":Publisher}' is expected."); -- -- StreamSource xml = new StreamSource(new File("../test-resources/invalidBook.xml")); -- -- assertThat(xml).isValidAgainst(); -- } -- -- @Test -- public void testIsValid_shouldPass() { -- -- StreamSource xml = new StreamSource(new File("../test-resources/BookXsdGenerated.xml")); -- -- assertThat(xml).isValid(); -- } -- -- @Test -- public void testIsValid_withBrokenXml_shouldPass() { -- -- thrown.expectAssertionError("1. line=9; column=8; type=ERROR;" + -- " message=cvc-complex-type.2.4.b: The content of element 'Book' is not complete." + -- " One of '{\"https://www.xmlunit.org/publishing\":Publisher}' is expected."); -- -- StreamSource xml = new StreamSource(new File("../test-resources/invalidBook.xml")); -- -- assertThat(xml).isValid(); -- } -- - @Test - public void testIsInvalid_withBrokenXml_shouldPass() { - -@@ -131,16 +90,6 @@ public class XmlAssertValidationTest { - assertThat(xml).isInvalid(); +- public void testDoctypeDifferences() throws Exception { ++ public void no_testDoctypeDifferences() throws Exception { + String control = "" + + "" + + ""; +diff --git a/xmlunit-legacy/src/test/java/org/custommonkey/xmlunit/test_NewDifferenceEngine.java b/xmlunit-legacy/src/test/java/org/custommonkey/xmlunit/test_NewDifferenceEngine.java +index 0e23767..526be89 100644 +--- a/xmlunit-legacy/src/test/java/org/custommonkey/xmlunit/test_NewDifferenceEngine.java ++++ b/xmlunit-legacy/src/test/java/org/custommonkey/xmlunit/test_NewDifferenceEngine.java +@@ -567,7 +567,7 @@ public class test_NewDifferenceEngine extends TestCase implements DifferenceCons + listener.different); } -- @Test -- public void testIsInvalid_shouldField() { -- -- thrown.expectAssertionErrorPattern("^\\nExpecting:\\n <.*\\.\\.\\/test-resources\\/BookXsdGenerated.xml>\\nto be invalid"); -- -- StreamSource xml = new StreamSource(new File("../test-resources/BookXsdGenerated.xml")); -- -- assertThat(xml).isInvalid(); -- } -- - @Test - public void testIsValidAgainst_withNullSchemaSources_shouldFailed() { +- public void testDoctypeDifferences() throws Exception { ++ public void no_testDoctypeDifferences() throws Exception { + String control = "" + + "" + + ""; +diff --git a/xmlunit-legacy/src/test/java/org/custommonkey/xmlunit/test_Validator.java b/xmlunit-legacy/src/test/java/org/custommonkey/xmlunit/test_Validator.java +index ad63592..cfcc5e2 100644 +--- a/xmlunit-legacy/src/test/java/org/custommonkey/xmlunit/test_Validator.java ++++ b/xmlunit-legacy/src/test/java/org/custommonkey/xmlunit/test_Validator.java +@@ -57,7 +57,7 @@ public class test_Validator extends XMLTestCase { + private Validator validator; + private File tempDTDFile; -diff --git a/xmlunit-assertj/src/test/java/org/xmlunit/assertj/XmlAssertValueByXPathTest.java b/xmlunit-assertj/src/test/java/org/xmlunit/assertj/XmlAssertValueByXPathTest.java -index 4aaf96b..d3a9cdd 100644 ---- a/xmlunit-assertj/src/test/java/org/xmlunit/assertj/XmlAssertValueByXPathTest.java -+++ b/xmlunit-assertj/src/test/java/org/xmlunit/assertj/XmlAssertValueByXPathTest.java -@@ -25,14 +25,6 @@ public class XmlAssertValueByXPathTest { - @Rule - public ExpectedException thrown = none(); - -- @Test -- public void testValueByXPath_withNull_shouldFailed() { -- -- thrown.expectAssertionError(format("%nExpecting not blank but was:")); -- -- assertThat("").valueByXPath(null); -- } -- - @Test - public void testValueByXPath_withWhitespacesOnly_shouldFailed() { - -diff --git a/xmlunit-matchers/src/test/java/org/xmlunit/matchers/ValidationMatcherTest.java b/xmlunit-matchers/src/test/java/org/xmlunit/matchers/ValidationMatcherTest.java -index 793e26a..eb4e9fa 100644 ---- a/xmlunit-matchers/src/test/java/org/xmlunit/matchers/ValidationMatcherTest.java -+++ b/xmlunit-matchers/src/test/java/org/xmlunit/matchers/ValidationMatcherTest.java -@@ -76,19 +76,6 @@ public class ValidationMatcherTest { - is(valid(new StreamSource(new File("../test-resources/Book.xsd"))))); - } - -- @Test -- public void shouldSuccessfullyValidateInstanceWithoutExplicitSchemaSource() { -- try { -- Class.forName("java.nio.file.FileSystem"); -- } catch (Throwable t) { -- assumeTrue("Skipping on Java6 as it doesn't like xmlunit.org's certificate", -- false); -- } -- assertThat(new StreamSource(new File("../test-resources/BookXsdGenerated.xml")), -- is(new ValidationMatcher())); -- -- } -- - @Test(expected = AssertionError.class) - public void shouldThrowOnBrokenInstanceWithoutExplicitSchemaSource() { - assertThat(new StreamSource(new File("../test-resources/invalidBook.xml")), +- public void testXSchema() throws Exception{ ++ public void no_testXSchema() throws Exception{ + File xsdFile = new File(test_Constants.TEST_RESOURCE_DIR + "Book.xsd"); + assertTrue("xsdFile " + xsdFile.getAbsolutePath() + " exists", + xsdFile.exists()); -- -2.21.0 +2.46.0 diff --git a/SOURCES/0002-Port-to-hamcrest-2.1.patch b/SOURCES/0002-Port-to-hamcrest-2.1.patch deleted file mode 100644 index 70336f6..0000000 --- a/SOURCES/0002-Port-to-hamcrest-2.1.patch +++ /dev/null @@ -1,156 +0,0 @@ -From c81eb91d7b9aa9728dfc83d68a881b4e2a0fa8d2 Mon Sep 17 00:00:00 2001 -From: Marian Koncek -Date: Thu, 29 Aug 2019 13:58:24 +0200 -Subject: [PATCH 2/4] Port to hamcrest 2.1 - ---- - .../src/main/java/org/xmlunit/matchers/CompareMatcher.java | 3 --- - .../main/java/org/xmlunit/matchers/EvaluateXPathMatcher.java | 2 -- - .../src/main/java/org/xmlunit/matchers/HasXPathMatcher.java | 2 -- - .../src/main/java/org/xmlunit/matchers/TypeMatcher.java | 5 ----- - .../main/java/org/xmlunit/matchers/ValidationMatcher.java | 3 --- - 5 files changed, 15 deletions(-) - -diff --git a/xmlunit-matchers/src/main/java/org/xmlunit/matchers/CompareMatcher.java b/xmlunit-matchers/src/main/java/org/xmlunit/matchers/CompareMatcher.java -index 6452081..226399c 100644 ---- a/xmlunit-matchers/src/main/java/org/xmlunit/matchers/CompareMatcher.java -+++ b/xmlunit-matchers/src/main/java/org/xmlunit/matchers/CompareMatcher.java -@@ -33,7 +33,6 @@ import org.xmlunit.util.Predicate; - - import org.hamcrest.BaseMatcher; - import org.hamcrest.Description; --import org.hamcrest.Factory; - import org.hamcrest.Matcher; - - import java.lang.reflect.Constructor; -@@ -112,7 +111,6 @@ public final class CompareMatcher extends BaseMatcher - *

- * As input all types are supported which are supported by {@link Input#from(Object)}. - */ -- @Factory - public static CompareMatcher isIdenticalTo(final Object control) { - return new CompareMatcher(control).checkForIdentical(); - } -@@ -128,7 +126,6 @@ public final class CompareMatcher extends BaseMatcher - *

- * As input all types are supported which are supported by {@link Input#from(Object)}. - */ -- @Factory - public static CompareMatcher isSimilarTo(final Object control) { - return new CompareMatcher(control).checkForSimilar(); - } -diff --git a/xmlunit-matchers/src/main/java/org/xmlunit/matchers/EvaluateXPathMatcher.java b/xmlunit-matchers/src/main/java/org/xmlunit/matchers/EvaluateXPathMatcher.java -index 6eb23e5..1e9b8b5 100644 ---- a/xmlunit-matchers/src/main/java/org/xmlunit/matchers/EvaluateXPathMatcher.java -+++ b/xmlunit-matchers/src/main/java/org/xmlunit/matchers/EvaluateXPathMatcher.java -@@ -16,7 +16,6 @@ package org.xmlunit.matchers; - - import org.hamcrest.BaseMatcher; - import org.hamcrest.Description; --import org.hamcrest.Factory; - import org.hamcrest.Matcher; - import org.w3c.dom.Node; - import org.xmlunit.builder.Input; -@@ -93,7 +92,6 @@ public class EvaluateXPathMatcher extends BaseMatcher { - * @param valueMatcher matcher for the value at the specified xpath - * @return the xpath matcher - */ -- @Factory - public static EvaluateXPathMatcher hasXPath(String xPath, Matcher valueMatcher) { - return new EvaluateXPathMatcher(xPath, valueMatcher); - } -diff --git a/xmlunit-matchers/src/main/java/org/xmlunit/matchers/HasXPathMatcher.java b/xmlunit-matchers/src/main/java/org/xmlunit/matchers/HasXPathMatcher.java -index 08325cd..6fbf0ac 100644 ---- a/xmlunit-matchers/src/main/java/org/xmlunit/matchers/HasXPathMatcher.java -+++ b/xmlunit-matchers/src/main/java/org/xmlunit/matchers/HasXPathMatcher.java -@@ -16,7 +16,6 @@ package org.xmlunit.matchers; - - import org.hamcrest.BaseMatcher; - import org.hamcrest.Description; --import org.hamcrest.Factory; - import org.hamcrest.Matcher; - import org.w3c.dom.Node; - import org.xmlunit.builder.Input; -@@ -135,7 +134,6 @@ public class HasXPathMatcher extends BaseMatcher { - * @param xPath the target xpath - * @return the xpath matcher - */ -- @Factory - public static HasXPathMatcher hasXPath(String xPath) { - return new HasXPathMatcher(xPath); - } -diff --git a/xmlunit-matchers/src/main/java/org/xmlunit/matchers/TypeMatcher.java b/xmlunit-matchers/src/main/java/org/xmlunit/matchers/TypeMatcher.java -index b9002a1..7cd6843 100644 ---- a/xmlunit-matchers/src/main/java/org/xmlunit/matchers/TypeMatcher.java -+++ b/xmlunit-matchers/src/main/java/org/xmlunit/matchers/TypeMatcher.java -@@ -15,7 +15,6 @@ - package org.xmlunit.matchers; - - import org.hamcrest.Description; --import org.hamcrest.Factory; - import org.hamcrest.Matcher; - import org.hamcrest.TypeSafeMatcher; - -@@ -128,7 +127,6 @@ public abstract class TypeMatcher extends TypeSafeMatcher { - * @param valueMatcher valueMatcher for the converted value - * @return the BigDecimal matcher - */ -- @Factory - public static TypeMatcher asBigDecimal(Matcher valueMatcher) { - return new BigDecimalTypeMatcher(valueMatcher); - } -@@ -146,7 +144,6 @@ public abstract class TypeMatcher extends TypeSafeMatcher { - * @param valueMatcher valueMatcher for the converted value - * @return the Double matcher - */ -- @Factory - public static TypeMatcher asDouble(Matcher valueMatcher) { - return new DoubleTypeMatcher(valueMatcher); - } -@@ -164,7 +161,6 @@ public abstract class TypeMatcher extends TypeSafeMatcher { - * @param valueMatcher valueMatcher for the converted value - * @return the Integer matcher - */ -- @Factory - public static TypeMatcher asInt(Matcher valueMatcher) { - return new IntegerTypeMatcher(valueMatcher); - } -@@ -182,7 +178,6 @@ public abstract class TypeMatcher extends TypeSafeMatcher { - * @param valueMatcher valueMatcher for the converted value - * @return the Boolean matcher - */ -- @Factory - public static TypeMatcher asBoolean(Matcher valueMatcher) { - return new BooleanTypeMatcher(valueMatcher); - } -diff --git a/xmlunit-matchers/src/main/java/org/xmlunit/matchers/ValidationMatcher.java b/xmlunit-matchers/src/main/java/org/xmlunit/matchers/ValidationMatcher.java -index 3126349..51f58ec 100644 ---- a/xmlunit-matchers/src/main/java/org/xmlunit/matchers/ValidationMatcher.java -+++ b/xmlunit-matchers/src/main/java/org/xmlunit/matchers/ValidationMatcher.java -@@ -27,7 +27,6 @@ import org.xmlunit.validation.ValidationProblem; - import org.xmlunit.validation.ValidationResult; - import org.hamcrest.BaseMatcher; - import org.hamcrest.Description; --import org.hamcrest.Factory; - - import javax.xml.transform.Source; - import javax.xml.validation.Schema; -@@ -121,7 +120,6 @@ public class ValidationMatcher extends BaseMatcher { - } - } - -- @Factory - public static ValidationMatcher valid(final Object schemaSource) { - return new ValidationMatcher(schemaSource); - } -@@ -129,7 +127,6 @@ public class ValidationMatcher extends BaseMatcher { - /** - * @since XMLUnit 2.3.0 - */ -- @Factory - public static ValidationMatcher valid(final Schema schema) { - return new ValidationMatcher(schema); - } --- -2.21.0 - diff --git a/SOURCES/0002-Use-local-schema.patch b/SOURCES/0002-Use-local-schema.patch new file mode 100644 index 0000000..603a1c8 --- /dev/null +++ b/SOURCES/0002-Use-local-schema.patch @@ -0,0 +1,50 @@ +From b5dfe90a1f5ccc2a49d24bbb327c549b5fb85080 Mon Sep 17 00:00:00 2001 +From: Marian Koncek +Date: Mon, 26 Sep 2022 12:28:11 +0200 +Subject: [PATCH 2/4] Use local schema + +--- + test-resources/BookXsdGenerated.xml | 2 +- + test-resources/BookXsdGeneratedWithComment.xml | 2 +- + test-resources/invalidBook.xml | 4 ++-- + 3 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/test-resources/BookXsdGenerated.xml b/test-resources/BookXsdGenerated.xml +index 1f55b93..2f09a58 100644 +--- a/test-resources/BookXsdGenerated.xml ++++ b/test-resources/BookXsdGenerated.xml +@@ -1,5 +1,5 @@ + +- ++ + Chicken Soup for the Soul + Jack Canfield + Mark Victor Hansen +diff --git a/test-resources/BookXsdGeneratedWithComment.xml b/test-resources/BookXsdGeneratedWithComment.xml +index e6f0364..d64500d 100644 +--- a/test-resources/BookXsdGeneratedWithComment.xml ++++ b/test-resources/BookXsdGeneratedWithComment.xml +@@ -1,6 +1,6 @@ + + +- ++ + Chicken Soup for the Soul + Jack Canfield + Mark Victor Hansen +diff --git a/test-resources/invalidBook.xml b/test-resources/invalidBook.xml +index 1d50d5c..5858d00 100644 +--- a/test-resources/invalidBook.xml ++++ b/test-resources/invalidBook.xml +@@ -1,6 +1,6 @@ + +- ++ + Chicken Soup for the Soul + Jack Canfield + Mark Victor Hansen +-- +2.46.0 + diff --git a/SOURCES/0004-Drop-support-for-JAXB.patch b/SOURCES/0003-Drop-support-for-JAXB.patch similarity index 77% rename from SOURCES/0004-Drop-support-for-JAXB.patch rename to SOURCES/0003-Drop-support-for-JAXB.patch index 0f90202..4ae2f94 100644 --- a/SOURCES/0004-Drop-support-for-JAXB.patch +++ b/SOURCES/0003-Drop-support-for-JAXB.patch @@ -1,7 +1,7 @@ -From 9866f331db726db0ac6af64649c308b01b34ea56 Mon Sep 17 00:00:00 2001 +From 34dc88688ce38468746d1e190a75931225ace80b Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Tue, 5 Nov 2019 12:14:08 +0100 -Subject: [PATCH 4/4] Drop support for JAXB +Subject: [PATCH 3/4] Drop support for JAXB --- xmlunit-core/src/main/java/org/xmlunit/builder/Input.java | 4 ++-- @@ -9,22 +9,22 @@ Subject: [PATCH 4/4] Drop support for JAXB 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 +index a7a23ee..6f91f32 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. +@@ -162,8 +162,8 @@ public class Input { + * @param jaxbObject the object to use as source + * @return a new builder */ - public static JaxbBuilder fromJaxb(Object jaxbObject) { -- return new JaxbBuilder(jaxbObject); +- return JaxbBuilderFactoryLocator.getFactory().create(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 +index e767f38..98e3fe7 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; @@ -35,7 +35,7 @@ index 83ff38a..fac270d 100644 import org.xmlunit.util.Convert; import org.xmlunit.xpath.JAXPXPathEngine; -@@ -148,10 +147,6 @@ public class InputTest { +@@ -132,10 +131,6 @@ public class InputTest { allIsWellFor(s, "furry"); } @@ -46,15 +46,15 @@ index 83ff38a..fac270d 100644 @Test public void shouldParseUnknownToSource() throws Exception { // from Source allIsWellFor(Input.from(Input.fromByteArray(readTestFile()).build()).build()); -@@ -169,8 +164,6 @@ public class InputTest { +@@ -153,8 +148,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 { + try (FileInputStream is = new FileInputStream(TestResources.ANIMAL_FILE)) { + allIsWellFor(Input.from(is).build()); -- -2.21.0 +2.46.0 diff --git a/SOURCES/0003-Fix-test-failure.patch b/SOURCES/0003-Fix-test-failure.patch deleted file mode 100644 index afa0caa..0000000 --- a/SOURCES/0003-Fix-test-failure.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 2aa7002c9ff0d6226ff75048dd3cee15a180dd99 Mon Sep 17 00:00:00 2001 -From: Marian Koncek -Date: Wed, 16 Oct 2019 09:32:19 +0200 -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..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 { - @Test - public void testIsEqualTo_withAttributeValueExpression_shouldFailed() { - -- thrown.expectAssertionError("expected:<\"[something]\"> but was:<\"[abc]\">"); -+ thrown.expectAssertionError("Expecting:\n <\"abc\">\nto be equal to:\n <\"something\">\nbut was not."); - - String xml = ""; - --- -2.21.0 - diff --git a/SOURCES/0004-Port-to-assertj-core-3.patch b/SOURCES/0004-Port-to-assertj-core-3.patch new file mode 100644 index 0000000..4cf654e --- /dev/null +++ b/SOURCES/0004-Port-to-assertj-core-3.patch @@ -0,0 +1,31 @@ +From a5449bbe527fcafa8a5a8b31a30724a7a2122d96 Mon Sep 17 00:00:00 2001 +From: Marian Koncek +Date: Mon, 26 Sep 2022 13:53:53 +0200 +Subject: [PATCH 4/4] Port to assertj-core 3 + +--- + .../src/test/java/org/xmlunit/assertj3/ValueAssertTest.java | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/xmlunit-assertj3/src/test/java/org/xmlunit/assertj3/ValueAssertTest.java b/xmlunit-assertj3/src/test/java/org/xmlunit/assertj3/ValueAssertTest.java +index fa12a7f..6e7bb55 100644 +--- a/xmlunit-assertj3/src/test/java/org/xmlunit/assertj3/ValueAssertTest.java ++++ b/xmlunit-assertj3/src/test/java/org/xmlunit/assertj3/ValueAssertTest.java +@@ -283,10 +283,13 @@ public class ValueAssertTest { + + thrown.expectAssertionErrorPattern(".*(" + // AssertJ 3.18.1 +- + Pattern.quote("expected:<\"[something]\"> but was:<\"[abc]\">") ++ + Pattern.quote("expected: \"something\"\nbut was : \"abc\"") + + "|" + // AssertJ 3.19.0+ + + Pattern.quote("Expecting:\n <\"abc\">\nto be equal to:\n <\"something\">\nbut was not.") ++ + "|" ++ // AssertJ 3.23.0+ ++ + Pattern.quote("[XPath \"//a/b/@attr\" evaluated to value] \nexpected: \"something\"\n but was: \"abc\"") + + ")"); + + String xml = ""; +-- +2.46.0 + diff --git a/SOURCES/generate-tarball.sh b/SOURCES/generate-tarball.sh new file mode 100755 index 0000000..5b8b1ff --- /dev/null +++ b/SOURCES/generate-tarball.sh @@ -0,0 +1,20 @@ +#!/bin/bash +set -e + +name=xmlunit +version="$(sed -n 's/Version:\s*//p' *.spec)" + +# RETRIEVE +wget "https://github.com/xmlunit/xmlunit/releases/download/v${version}/${name}-${version}-src.tar.gz" -O "${name}-${version}.orig.tar.gz" + +rm -rf tarball-tmp +mkdir tarball-tmp +pushd tarball-tmp +tar -xf "../${name}-${version}.orig.tar.gz" + +# CLEAN TARBALL +rm */GPATH */GRTAGS */GTAGS + +tar -czf "../${name}-${version}.tar.gz" * +popd +rm -r tarball-tmp "${name}-${version}.orig.tar.gz" diff --git a/SPECS/xmlunit.spec b/SPECS/xmlunit.spec index c96425a..2b95892 100644 --- a/SPECS/xmlunit.spec +++ b/SPECS/xmlunit.spec @@ -1,92 +1,114 @@ +%bcond_with bootstrap + Name: xmlunit -Version: 2.6.3 -Release: 2%{?dist} +Version: 2.10.0 +Release: 5%{?dist} Summary: Provides classes to do asserts on xml # The whole package is ASL 2.0 except for xmlunit-legacy which is BSD -License: ASL 2.0 and BSD -Source0: https://github.com/xmlunit/xmlunit/releases/download/v%{version}/%{name}-%{version}-src.tar.gz +License: Apache-2.0 URL: https://www.xmlunit.org/ +BuildArch: noarch +ExclusiveArch: %{java_arches} noarch -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 +# ./generate-tarball.sh +Source0: %{name}-%{version}.tar.gz +# Remove bundled binaries which cannot be easily verified for licensing +Source1: generate-tarball.sh +Patch: 0001-Disable-tests-requiring-network-access.patch +# This also solves the problem of tests requiring network. The files that would +# be fetched are identical to the local file +Patch: 0002-Use-local-schema.patch +Patch: 0003-Drop-support-for-JAXB.patch +Patch: 0004-Port-to-assertj-core-3.patch + +BuildRequires: jurand +%if %{with bootstrap} +BuildRequires: javapackages-bootstrap +%else BuildRequires: maven-local BuildRequires: mvn(junit:junit) BuildRequires: mvn(org.apache.felix:maven-bundle-plugin) -BuildRequires: mvn(org.apache.maven.plugins:maven-shade-plugin) BuildRequires: mvn(org.assertj:assertj-core) BuildRequires: mvn(org.hamcrest:hamcrest-core) BuildRequires: mvn(org.hamcrest:hamcrest-library) BuildRequires: mvn(org.mockito:mockito-core) - -BuildArch: noarch +%endif %description XMLUnit provides you with the tools to verify the XML you emit is the one you want to create. It provides helpers to validate against an XML Schema, assert the values of XPath queries or compare XML documents against expected outcomes. -%package javadoc -Summary: Javadoc for %{name} +%package javadoc +Summary: API documentation for %{name} -%description javadoc -Javadoc for %{name} +%description javadoc +API documentation for %{name}. -%package assertj +%package assertj Summary: Assertj for %{name} -%description assertj +%description assertj This package provides %{summary}. -%package core +%package core Summary: Core package for %{name} -%description core +%description core This package provides %{summary}. -%package legacy +%package legacy Summary: Legacy package for %{name} +License: BSD-3-Clause -%description legacy +%description legacy This package provides %{summary}. -%package matchers +%package matchers Summary: Matchers for %{name} -%description matchers +%description matchers This package provides %{summary}. -%package placeholders +%package placeholders Summary: Placeholders for %{name} -%description placeholders +%description placeholders This package provides %{summary}. %prep -%setup -q -n %{name}-%{version}-src +%autosetup -p1 -n %{name}-%{version}-src -%patch1 -p1 -%patch2 -p1 -# This test failure showed up after updating mockito to 3.X, but the error -# message clearly points to assertj-core -%patch3 -p1 -%patch4 -p1 + +rm -r xmlunit-core/src/main/java/org/xmlunit/builder/javax_jaxb\ + xmlunit-core/src/main/java/org/xmlunit/builder/JaxbBuilderFactory.java\ + xmlunit-core/src/main/java/org/xmlunit/builder/JaxbBuilderFactoryLocator.java\ + xmlunit-core/src/test/java/org/xmlunit/builder/javax_jaxb\ +; + + +# Port to hamcrest 2.1 +%java_remove_annotations xmlunit-matchers -p org[.]hamcrest[.]Factory + +%pom_disable_module xmlunit-assertj +%pom_disable_module xmlunit-jakarta-jaxb-impl %pom_remove_plugin org.codehaus.mojo:buildnumber-maven-plugin %pom_remove_plugin :maven-assembly-plugin +%pom_remove_plugin -r :maven-shade-plugin +%pom_remove_plugin -r org.cyclonedx:cyclonedx-maven-plugin -%mvn_alias "org.xmlunit:xmlunit-legacy" "xmlunit:xmlunit" +%mvn_alias org.xmlunit:xmlunit-legacy xmlunit:xmlunit +%mvn_alias org.xmlunit:xmlunit-assertj3 org.xmlunit:xmlunit-assertj # 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 +%pom_remove_dep org.glassfish.jaxb: xmlunit-core +%pom_remove_dep jakarta.xml.bind: xmlunit-core rm -rf xmlunit-core/src/{main,test}/java/org/xmlunit/builder/{jaxb/,JaxbBuilder.java,JaxbBuilderTest.java} %build -%mvn_build -s +%mvn_build -s -- -Dmaven.compile.source=1.8 -Dmaven.compile.target=1.8 %install %mvn_install @@ -96,16 +118,127 @@ rm -rf xmlunit-core/src/{main,test}/java/org/xmlunit/builder/{jaxb/,JaxbBuilder. %license LICENSE %files javadoc -f .mfiles-javadoc -%files assertj -f .mfiles-xmlunit-assertj + +%files assertj -f .mfiles-xmlunit-assertj3 + %files core -f .mfiles-xmlunit-core + %files legacy -f .mfiles-xmlunit-legacy + %files matchers -f .mfiles-xmlunit-matchers + %files placeholders -f .mfiles-xmlunit-placeholders %changelog +* Fri Nov 29 2024 Mikolaj Izdebski - 2.10.0-2 +- Update javapackages test plan to f42 + +* Fri Aug 23 2024 Mikolaj Izdebski - 2.10.0-1 +- Update to upstream version 2.10.0 +- Resolves: rhbz#2277615 + +* Sat Jul 20 2024 Fedora Release Engineering - 2.9.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Mon Apr 08 2024 Marian Koncek - 2.9.1-1 +- Update to upstream version 2.9.1 + +* Sat Mar 02 2024 Jiri Vanek - 2.9.0-11 +- bump of release for for java-21-openjdk as system jdk + +* Tue Feb 27 2024 Jiri Vanek - 2.9.0-10 +- Rebuilt for java-21-openjdk as system jdk + +* Fri Feb 23 2024 Jiri Vanek - 2.9.0-9 +- bump of release for for java-21-openjdk as system jdk + +* Tue Feb 20 2024 Marian Koncek - 2.9.0-8 +- Update Java source/target to 1.8 + +* Sat Jan 27 2024 Fedora Release Engineering - 2.9.0-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Fri Sep 01 2023 Mikolaj Izdebski - 2.9.0-6 +- Convert License tag to SPDX format + +* Wed Aug 30 2023 Mikolaj Izdebski - 2.9.0-5 +- Build with Jurand instead of deprecated javapackages-extra + +* Sat Jul 22 2023 Fedora Release Engineering - 2.9.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Sat Jan 21 2023 Fedora Release Engineering - 2.9.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Tue Oct 04 2022 Mikolaj Izdebski - 2.9.0-2 +- Fix BuildRequires on javapackages-extra + +* Fri Sep 09 2022 Marian Koncek - 2.9.0-1 +- Update to upstream version 2.9.0 + +* Sat Jul 23 2022 Fedora Release Engineering - 2.8.2-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Fri Apr 22 2022 Mikolaj Izdebski - 2.8.2-7 +- Disable more tests that require network access + +* Sat Feb 05 2022 Jiri Vanek - 2.8.2-6 +- Rebuilt for java-17-openjdk as system jdk + +* Sat Jan 22 2022 Fedora Release Engineering - 2.8.2-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Fri Jul 23 2021 Fedora Release Engineering - 2.8.2-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Fri Jun 18 2021 Mikolaj Izdebski - 2.8.2-3 +- Clean tarball from content with questionable licensing +- Resolves: rhbz#1973721 + +* Mon May 17 2021 Mikolaj Izdebski - 2.8.2-2 +- Bootstrap build +- Non-bootstrap build + +* Thu Feb 04 2021 Merlin Mathesius - 0:2.7.0-7 +- Update previous patch to use improved version that was merged upstream + +* Fri Jan 29 2021 Merlin Mathesius - 0:2.7.0-6 +- Fix FTBFS by patching ValueAssertTest to adjust for changed format of + mismatched string exception + +* Thu Jan 28 2021 Fedora Release Engineering - 0:2.7.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Tue Jan 26 2021 Marian Koncek - 2.8.2-1 +- Update to upstream version 2.8.2 + +* Wed Jul 29 2020 Marian Koncek - 2.7.0-1 +- Update to upstream version 2.7.0 + +* Wed Jul 29 2020 Fedora Release Engineering - 0:2.7.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Mon Jul 20 2020 Mat Booth - 0:2.7.0-3 +- Allow building against JDK 11 + +* Sat Jul 11 2020 Jiri Vanek - 0:2.7.0-2 +- Rebuilt for JDK-11, see https://fedoraproject.org/wiki/Changes/Java11 + +* Wed May 13 2020 Dr. Tilmann Bubeck - 0:2.7.0-1 +- Update to version 2.7.0. + +* Fri Jan 31 2020 Fedora Release Engineering - 0:2.6.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + * Tue Nov 05 2019 Mikolaj Izdebski - 2.6.3-2 - Mass rebuild for javapackages-tools 201902 +* Mon Jul 29 2019 Fabio Valentini - 0:2.6.3-1 +- Update to version 2.6.3. + +* Sat Jul 27 2019 Fedora Release Engineering - 0:1.6-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + * Wed Jun 26 2019 Marian Koncek - 2.6.3-1 - Update to upstream version 2.6.3