Update to upstream version 2.9.0
This commit is contained in:
parent
b6a986a9ba
commit
7d696257b1
1
.gitignore
vendored
1
.gitignore
vendored
@ -11,3 +11,4 @@
|
||||
/xmlunit-2.7.0-src.tar.gz
|
||||
/xmlunit-2.8.2-src.tar.gz
|
||||
/xmlunit-2.8.2.tar.gz
|
||||
/xmlunit-2.9.0.tar.gz
|
||||
|
@ -1,116 +1,20 @@
|
||||
From 81808e548ddc6cf0a3cc12285f48caa2bd517a07 Mon Sep 17 00:00:00 2001
|
||||
From e20a29e689eab30408ccf495590d74c207092e3d Mon Sep 17 00:00:00 2001
|
||||
From: Marian Koncek <mkoncek@redhat.com>
|
||||
Date: Mon, 4 Mar 2019 14:52:59 +0100
|
||||
Subject: [PATCH 1/3] Disable tests requiring network access
|
||||
Date: Fri, 9 Sep 2022 15:08:45 +0200
|
||||
Subject: [PATCH 1/2] Disable tests requiring network access
|
||||
|
||||
---
|
||||
.../org/xmlunit/assertj3/XmlAssertNodesByXPathTest.java | 2 ++
|
||||
.../java/org/xmlunit/assertj3/XmlAssertValidationTest.java | 6 ++++++
|
||||
.../org/xmlunit/assertj3/XmlAssertValueByXPathTest.java | 2 ++
|
||||
.../org/custommonkey/xmlunit/test_AbstractNodeTester.java | 2 +-
|
||||
.../org/custommonkey/xmlunit/test_DifferenceEngine.java | 2 +-
|
||||
.../org/custommonkey/xmlunit/test_NewDifferenceEngine.java | 2 +-
|
||||
.../test/java/org/custommonkey/xmlunit/test_Validator.java | 2 +-
|
||||
.../java/org/xmlunit/matchers/ValidationMatcherTest.java | 2 ++
|
||||
8 files changed, 16 insertions(+), 4 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-assertj3/src/test/java/org/xmlunit/assertj3/XmlAssertNodesByXPathTest.java b/xmlunit-assertj3/src/test/java/org/xmlunit/assertj3/XmlAssertNodesByXPathTest.java
|
||||
index 166633e..926c647 100644
|
||||
--- a/xmlunit-assertj3/src/test/java/org/xmlunit/assertj3/XmlAssertNodesByXPathTest.java
|
||||
+++ b/xmlunit-assertj3/src/test/java/org/xmlunit/assertj3/XmlAssertNodesByXPathTest.java
|
||||
@@ -13,6 +13,7 @@
|
||||
*/
|
||||
package org.xmlunit.assertj3;
|
||||
|
||||
+import org.junit.Ignore;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -43,6 +44,7 @@ public void testAssertThat_withNull_shouldFailed() {
|
||||
}
|
||||
|
||||
@Test
|
||||
+ @Ignore
|
||||
public void testNodesByXPath_withNull_shouldFailed() {
|
||||
|
||||
thrown.expectAssertionError(format("%nExpecting not blank but was:<null>"));
|
||||
diff --git a/xmlunit-assertj3/src/test/java/org/xmlunit/assertj3/XmlAssertValidationTest.java b/xmlunit-assertj3/src/test/java/org/xmlunit/assertj3/XmlAssertValidationTest.java
|
||||
index d4f1e82..027e7e9 100644
|
||||
--- a/xmlunit-assertj3/src/test/java/org/xmlunit/assertj3/XmlAssertValidationTest.java
|
||||
+++ b/xmlunit-assertj3/src/test/java/org/xmlunit/assertj3/XmlAssertValidationTest.java
|
||||
@@ -14,6 +14,7 @@
|
||||
package org.xmlunit.assertj3;
|
||||
|
||||
import org.junit.ClassRule;
|
||||
+import org.junit.Ignore;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.xmlunit.TestResources;
|
||||
@@ -91,6 +92,7 @@ public void testIsValidAgainst_withBrokenXml_shouldFailed() {
|
||||
}
|
||||
|
||||
@Test
|
||||
+ @Ignore
|
||||
public void testIsValidAgainst_withEmptySourcesArray_shouldPass() {
|
||||
|
||||
StreamSource xml = new StreamSource(new File(TestResources.TEST_RESOURCE_DIR + "BookXsdGenerated.xml"));
|
||||
@@ -100,6 +102,7 @@ public void testIsValidAgainst_withEmptySourcesArray_shouldPass() {
|
||||
}
|
||||
|
||||
@Test
|
||||
+ @Ignore
|
||||
public void testIsValidAgainst_withBrokenXmlAndEmptySourcesArray_shouldFailed() {
|
||||
|
||||
thrown.expectAssertionError("1. line=9; column=8; type=ERROR;" +
|
||||
@@ -112,6 +115,7 @@ public void testIsValidAgainst_withBrokenXmlAndEmptySourcesArray_shouldFailed()
|
||||
}
|
||||
|
||||
@Test
|
||||
+ @Ignore
|
||||
public void testIsValid_shouldPass() {
|
||||
|
||||
StreamSource xml = new StreamSource(new File(TestResources.TEST_RESOURCE_DIR + "BookXsdGenerated.xml"));
|
||||
@@ -120,6 +124,7 @@ public void testIsValid_shouldPass() {
|
||||
}
|
||||
|
||||
@Test
|
||||
+ @Ignore
|
||||
public void testIsValid_withBrokenXml_shouldPass() {
|
||||
|
||||
thrown.expectAssertionError("1. line=9; column=8; type=ERROR;" +
|
||||
@@ -140,6 +145,7 @@ public void testIsInvalid_withBrokenXml_shouldPass() {
|
||||
}
|
||||
|
||||
@Test
|
||||
+ @Ignore
|
||||
public void testIsInvalid_shouldField() {
|
||||
|
||||
thrown.expectAssertionErrorPattern("^\\nExpecting:\\n <.*"
|
||||
diff --git a/xmlunit-assertj3/src/test/java/org/xmlunit/assertj3/XmlAssertValueByXPathTest.java b/xmlunit-assertj3/src/test/java/org/xmlunit/assertj3/XmlAssertValueByXPathTest.java
|
||||
index 7ac9a3f..3cb825b 100644
|
||||
--- a/xmlunit-assertj3/src/test/java/org/xmlunit/assertj3/XmlAssertValueByXPathTest.java
|
||||
+++ b/xmlunit-assertj3/src/test/java/org/xmlunit/assertj3/XmlAssertValueByXPathTest.java
|
||||
@@ -14,6 +14,7 @@
|
||||
package org.xmlunit.assertj3;
|
||||
|
||||
import org.junit.ClassRule;
|
||||
+import org.junit.Ignore;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.xmlunit.assertj3.util.SetEnglishLocaleRule;
|
||||
@@ -31,6 +32,7 @@ public class XmlAssertValueByXPathTest {
|
||||
public static SetEnglishLocaleRule locale = new SetEnglishLocaleRule();
|
||||
|
||||
@Test
|
||||
+ @Ignore
|
||||
public void testValueByXPath_withNull_shouldFailed() {
|
||||
|
||||
thrown.expectAssertionError(format("%nExpecting not blank but was:<null>"));
|
||||
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 void testTextNode() {
|
||||
@@ -176,7 +176,7 @@ public class test_AbstractNodeTester extends TestCase {
|
||||
}
|
||||
|
||||
// never called as NodeTest directly jumps to the document element
|
||||
@ -123,7 +27,7 @@ diff --git a/xmlunit-legacy/src/test/java/org/custommonkey/xmlunit/test_Differen
|
||||
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 void testIgnoresDifferencesBetweenDocAndRootElement()
|
||||
@@ -1020,7 +1020,7 @@ public class test_DifferenceEngine extends TestCase implements DifferenceConstan
|
||||
listener.different);
|
||||
}
|
||||
|
||||
@ -136,7 +40,7 @@ diff --git a/xmlunit-legacy/src/test/java/org/custommonkey/xmlunit/test_NewDiffe
|
||||
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 void testIgnoresDifferencesBetweenDocAndRootElement()
|
||||
@@ -567,7 +567,7 @@ public class test_NewDifferenceEngine extends TestCase implements DifferenceCons
|
||||
listener.different);
|
||||
}
|
||||
|
||||
@ -158,26 +62,6 @@ index ad63592..cfcc5e2 100644
|
||||
File xsdFile = new File(test_Constants.TEST_RESOURCE_DIR + "Book.xsd");
|
||||
assertTrue("xsdFile " + xsdFile.getAbsolutePath() + " exists",
|
||||
xsdFile.exists());
|
||||
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 6f26927..bf9a153 100644
|
||||
--- a/xmlunit-matchers/src/test/java/org/xmlunit/matchers/ValidationMatcherTest.java
|
||||
+++ b/xmlunit-matchers/src/test/java/org/xmlunit/matchers/ValidationMatcherTest.java
|
||||
@@ -13,6 +13,7 @@
|
||||
*/
|
||||
package org.xmlunit.matchers;
|
||||
|
||||
+import org.junit.Ignore;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.ExpectedException;
|
||||
@@ -79,6 +80,7 @@ public void shouldThrowOnBrokenInstance() {
|
||||
}
|
||||
|
||||
@Test
|
||||
+ @Ignore
|
||||
public void shouldSuccessfullyValidateInstanceWithoutExplicitSchemaSource() {
|
||||
try {
|
||||
Class.forName("java.nio.file.FileSystem");
|
||||
--
|
||||
2.35.1
|
||||
2.37.3
|
||||
|
||||
|
@ -1,156 +0,0 @@
|
||||
From 8d7373f5feef927514339fe42919873836c0f710 Mon Sep 17 00:00:00 2001
|
||||
From: Marian Koncek <mkoncek@redhat.com>
|
||||
Date: Thu, 29 Aug 2019 13:58:24 +0200
|
||||
Subject: [PATCH 2/3] 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.hamcrest.BaseMatcher;
|
||||
import org.hamcrest.Description;
|
||||
-import org.hamcrest.Factory;
|
||||
import org.hamcrest.Matcher;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
@@ -112,7 +111,6 @@ private CompareMatcher(Object control) {
|
||||
* <p>
|
||||
* 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 static CompareMatcher isIdenticalTo(final Object control) {
|
||||
* <p>
|
||||
* 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 @@
|
||||
|
||||
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 EvaluateXPathMatcher(String xPath, Matcher<String> valueMatcher) {
|
||||
* @param valueMatcher matcher for the value at the specified xpath
|
||||
* @return the xpath matcher
|
||||
*/
|
||||
- @Factory
|
||||
public static EvaluateXPathMatcher hasXPath(String xPath, Matcher<String> 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 @@
|
||||
|
||||
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 void describeMismatch(Object item, Description mismatchDescription) {
|
||||
* @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 @@ private T nullSafeConvert(String item) {
|
||||
* @param valueMatcher valueMatcher for the converted value
|
||||
* @return the BigDecimal matcher
|
||||
*/
|
||||
- @Factory
|
||||
public static TypeMatcher<BigDecimal> asBigDecimal(Matcher<? extends BigDecimal> valueMatcher) {
|
||||
return new BigDecimalTypeMatcher(valueMatcher);
|
||||
}
|
||||
@@ -146,7 +144,6 @@ public static TypeMatcher<BigDecimal> asBigDecimal(Matcher<? extends BigDecimal>
|
||||
* @param valueMatcher valueMatcher for the converted value
|
||||
* @return the Double matcher
|
||||
*/
|
||||
- @Factory
|
||||
public static TypeMatcher<Double> asDouble(Matcher<? extends Double> valueMatcher) {
|
||||
return new DoubleTypeMatcher(valueMatcher);
|
||||
}
|
||||
@@ -164,7 +161,6 @@ public static TypeMatcher<Double> asDouble(Matcher<? extends Double> valueMatche
|
||||
* @param valueMatcher valueMatcher for the converted value
|
||||
* @return the Integer matcher
|
||||
*/
|
||||
- @Factory
|
||||
public static TypeMatcher<Integer> asInt(Matcher<? extends Integer> valueMatcher) {
|
||||
return new IntegerTypeMatcher(valueMatcher);
|
||||
}
|
||||
@@ -182,7 +178,6 @@ public static TypeMatcher<Integer> asInt(Matcher<? extends Integer> valueMatcher
|
||||
* @param valueMatcher valueMatcher for the converted value
|
||||
* @return the Boolean matcher
|
||||
*/
|
||||
- @Factory
|
||||
public static TypeMatcher<Boolean> asBoolean(Matcher<? extends Boolean> 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.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 void describeMismatch(final Object item, final Description mismatchDescri
|
||||
}
|
||||
}
|
||||
|
||||
- @Factory
|
||||
public static ValidationMatcher valid(final Object schemaSource) {
|
||||
return new ValidationMatcher(schemaSource);
|
||||
}
|
||||
@@ -129,7 +127,6 @@ public static ValidationMatcher valid(final Object schemaSource) {
|
||||
/**
|
||||
* @since XMLUnit 2.3.0
|
||||
*/
|
||||
- @Factory
|
||||
public static ValidationMatcher valid(final Schema schema) {
|
||||
return new ValidationMatcher(schema);
|
||||
}
|
||||
--
|
||||
2.35.1
|
||||
|
50
0002-Use-local-schema.patch
Normal file
50
0002-Use-local-schema.patch
Normal file
@ -0,0 +1,50 @@
|
||||
From 4d3f414382866e26eac672026cb294e5250375b4 Mon Sep 17 00:00:00 2001
|
||||
From: Marian Koncek <mkoncek@redhat.com>
|
||||
Date: Mon, 26 Sep 2022 12:28:11 +0200
|
||||
Subject: [PATCH 2/2] 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 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
-<Book xmlns:xsd="http://www.w3.org/2000/10/XMLSchema" xmlns="https://www.xmlunit.org/publishing" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://www.xmlunit.org/publishing https://www.xmlunit.org/test-support/Book.xsd">
|
||||
+<Book xmlns:xsd="http://www.w3.org/2000/10/XMLSchema" xmlns="https://www.xmlunit.org/publishing" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://www.xmlunit.org/publishing Book.xsd">
|
||||
<Title>Chicken Soup for the Soul</Title>
|
||||
<Author>Jack Canfield</Author>
|
||||
<Author>Mark Victor Hansen</Author>
|
||||
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 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- this is a comment -->
|
||||
-<Book xmlns:xsd="http://www.w3.org/2000/10/XMLSchema" xmlns="https://www.xmlunit.org/publishing" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://www.xmlunit.org/publishing https://raw.githubusercontent.com/xmlunit/test-resources/main/Book.xsd">
|
||||
+<Book xmlns:xsd="http://www.w3.org/2000/10/XMLSchema" xmlns="https://www.xmlunit.org/publishing" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://www.xmlunit.org/publishing Book.xsd">
|
||||
<Title>Chicken Soup for the Soul</Title>
|
||||
<Author>Jack Canfield</Author>
|
||||
<Author>Mark Victor Hansen</Author>
|
||||
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 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
-<Book xmlns:xsd="http://www.w3.org/2000/10/XMLSchema"
|
||||
- xmlns="https://www.xmlunit.org/publishing" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://www.xmlunit.org/publishing https://raw.githubusercontent.com/xmlunit/test-resources/main/Book.xsd">
|
||||
+<Book xmlns:xsd="http://www.w3.org/2000/10/XMLSchema"
|
||||
+ xmlns="https://www.xmlunit.org/publishing" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://www.xmlunit.org/publishing Book.xsd">
|
||||
<Title>Chicken Soup for the Soul</Title>
|
||||
<Author>Jack Canfield</Author>
|
||||
<Author>Mark Victor Hansen</Author>
|
||||
--
|
||||
2.37.3
|
||||
|
@ -4,20 +4,25 @@ Date: Tue, 5 Nov 2019 12:14:08 +0100
|
||||
Subject: [PATCH 3/3] Drop support for JAXB
|
||||
|
||||
---
|
||||
xmlunit-core/src/main/java/org/xmlunit/builder/Input.java | 4 ++--
|
||||
xmlunit-core/src/main/java/org/xmlunit/builder/Input.java | 6 +++---
|
||||
.../src/test/java/org/xmlunit/builder/InputTest.java | 7 -------
|
||||
2 files changed, 2 insertions(+), 9 deletions(-)
|
||||
2 files changed, 3 insertions(+), 10 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 27d9c5a..81165cc 100644
|
||||
index 157aa7d..d158141 100644
|
||||
--- a/xmlunit-core/src/main/java/org/xmlunit/builder/Input.java
|
||||
+++ b/xmlunit-core/src/main/java/org/xmlunit/builder/Input.java
|
||||
@@ -153,8 +153,8 @@ public static Builder from(Object object) {
|
||||
@@ -149,12 +149,12 @@ public class Input {
|
||||
}
|
||||
return xml;
|
||||
}
|
||||
-
|
||||
+
|
||||
/**
|
||||
* Build a Source from a Jaxb-Object.
|
||||
*/
|
||||
- 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");
|
||||
}
|
||||
@ -27,7 +32,7 @@ diff --git a/xmlunit-core/src/test/java/org/xmlunit/builder/InputTest.java b/xml
|
||||
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 @@
|
||||
@@ -31,7 +31,6 @@ import org.w3c.dom.Document;
|
||||
import org.xmlunit.NullNode;
|
||||
import org.xmlunit.TestResources;
|
||||
import org.xmlunit.XMLUnitException;
|
||||
@ -35,7 +40,7 @@ index e767f38..98e3fe7 100644
|
||||
import org.xmlunit.util.Convert;
|
||||
import org.xmlunit.xpath.JAXPXPathEngine;
|
||||
|
||||
@@ -132,10 +131,6 @@ private static Document parse(Source s) throws Exception {
|
||||
@@ -132,10 +131,6 @@ public class InputTest {
|
||||
allIsWellFor(s, "furry");
|
||||
}
|
||||
|
||||
@ -46,7 +51,7 @@ index e767f38..98e3fe7 100644
|
||||
@Test public void shouldParseUnknownToSource() throws Exception {
|
||||
// from Source
|
||||
allIsWellFor(Input.from(Input.fromByteArray(readTestFile()).build()).build());
|
||||
@@ -153,8 +148,6 @@ private static Document parse(Source s) throws Exception {
|
||||
@@ -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());
|
||||
@ -56,5 +61,5 @@ index e767f38..98e3fe7 100644
|
||||
try (FileInputStream is = new FileInputStream(TestResources.ANIMAL_FILE)) {
|
||||
allIsWellFor(Input.from(is).build());
|
||||
--
|
||||
2.35.1
|
||||
2.37.2
|
||||
|
||||
|
31
0004-Port-to-assertj-core-3.patch
Normal file
31
0004-Port-to-assertj-core-3.patch
Normal file
@ -0,0 +1,31 @@
|
||||
From 7077eac701bca8e63d16aede77a73474d5fe79af Mon Sep 17 00:00:00 2001
|
||||
From: Marian Koncek <mkoncek@redhat.com>
|
||||
Date: Mon, 26 Sep 2022 13:53:53 +0200
|
||||
Subject: [PATCH] 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 = "<a><b attr=\"abc\"></b></a>";
|
||||
--
|
||||
2.37.3
|
||||
|
@ -10,7 +10,7 @@ wget "https://github.com/xmlunit/xmlunit/releases/download/v${version}/${name}-$
|
||||
rm -rf tarball-tmp
|
||||
mkdir tarball-tmp
|
||||
pushd tarball-tmp
|
||||
tar xf "../${name}-${version}.orig.tar.gz"
|
||||
tar -xf "../${name}-${version}.orig.tar.gz"
|
||||
|
||||
# CLEAN TARBALL
|
||||
rm */GPATH */GRTAGS */GTAGS
|
||||
|
2
sources
2
sources
@ -1 +1 @@
|
||||
SHA512 (xmlunit-2.8.2.tar.gz) = 345ef6b8072d2a27e880475d813c704636cf029cd8c43ea639828775fc8c5713ceed908f01b80f6decf6e36fbac7ddca41c09a1222aee23540305c9c25a75154
|
||||
SHA512 (xmlunit-2.9.0.tar.gz) = ac00537052e6947a14ac44e69f236286dab8b62907d3357953421a9533dc32aac6d92ab8176bccfc0e4a116c7397eb85539b9b6e13a6c7aa12cf9aa8106f426d
|
||||
|
30
xmlunit.spec
30
xmlunit.spec
@ -1,8 +1,8 @@
|
||||
%bcond_with bootstrap
|
||||
|
||||
Name: xmlunit
|
||||
Version: 2.8.2
|
||||
Release: 8%{?dist}
|
||||
Version: 2.9.0
|
||||
Release: 1%{?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
|
||||
@ -16,13 +16,17 @@ Source0: %{name}-%{version}.tar.gz
|
||||
Source1: generate-tarball.sh
|
||||
|
||||
Patch1: 0001-Disable-tests-requiring-network-access.patch
|
||||
Patch2: 0002-Port-to-hamcrest-2.1.patch
|
||||
# This also solves the problem of tests requiring network. The files that would
|
||||
# be fetched are identical to the local file
|
||||
Patch2: 0002-Use-local-schema.patch
|
||||
Patch3: 0003-Drop-support-for-JAXB.patch
|
||||
Patch4: 0004-Port-to-assertj-core-3.patch
|
||||
|
||||
%if %{with bootstrap}
|
||||
BuildRequires: javapackages-bootstrap
|
||||
%else
|
||||
BuildRequires: maven-local
|
||||
BuildRequires: javapackages-extra
|
||||
BuildRequires: mvn(junit:junit)
|
||||
BuildRequires: mvn(net.bytebuddy:byte-buddy)
|
||||
BuildRequires: mvn(org.apache.felix:maven-bundle-plugin)
|
||||
@ -78,14 +82,21 @@ This package provides %{summary}.
|
||||
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
|
||||
# Tests compare the string constent of thrown exceptions
|
||||
# and we use a different version of assertj
|
||||
find xmlunit-assertj3/src/test -name '*.java' -exec sed -i 's/\(Expecting not blank but was:\)<\(.*\)>/\1 \2/' {} +
|
||||
sed -i 's/\(expected:\)<\\"\[\(something\)\]\\"> but was:<\\"\[\(abc\)\]\\">/\1 \\"\2\\"\\nbut was : \\"\3\\"/' xmlunit-assertj3/src/test/java/org/xmlunit/assertj3/ValueAssertTest.java
|
||||
%patch3 -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\
|
||||
;
|
||||
|
||||
%patch4 -p1
|
||||
|
||||
# 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
|
||||
@ -117,6 +128,9 @@ rm -rf xmlunit-core/src/{main,test}/java/org/xmlunit/builder/{jaxb/,JaxbBuilder.
|
||||
%files placeholders -f .mfiles-xmlunit-placeholders
|
||||
|
||||
%changelog
|
||||
* Fri Sep 09 2022 Marian Koncek <mkoncek@redhat.com> - 2.9.0-1
|
||||
- Update to upstream version 2.9.0
|
||||
|
||||
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.8.2-8
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user