Compare commits

..

No commits in common. "c8-stream-201902" and "c10s" have entirely different histories.

16 changed files with 356 additions and 364 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

15
.gitignore vendored
View File

@ -1 +1,14 @@
SOURCES/xmlunit-2.6.3-src.tar.gz /results_*
/*.src.rpm
/xmlunit1.0.zip
/xmlunit-1.3-src.zip
/xmlunit-1.4-src.zip
/xmlunit-1.5-src.zip
/xmlunit-1.6-src.zip
/xmlunit-2.6.2-src.tar.gz
/xmlunit-2.6.3-src.tar.gz
/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

View File

@ -1 +0,0 @@
19d9c8df1d4645d59e15a27e978370964fd45030 SOURCES/xmlunit-2.6.3-src.tar.gz

View File

@ -0,0 +1,67 @@
From e20a29e689eab30408ccf495590d74c207092e3d Mon Sep 17 00:00:00 2001
From: Marian Koncek <mkoncek@redhat.com>
Date: Fri, 9 Sep 2022 15:08:45 +0200
Subject: [PATCH 1/2] Disable tests requiring network access
---
.../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-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 {
}
// 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("<!DOCTYPE Book PUBLIC \"XMLUNIT/TEST/PUB1\" \"../test-resources/Book.dtd\">"
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);
}
- public void testDoctypeDifferences() throws Exception {
+ public void no_testDoctypeDifferences() throws Exception {
String control = "<?xml version = \"1.0\" encoding = \"UTF-8\"?>"
+ "<!DOCTYPE Book PUBLIC \"XMLUNIT/TEST/PUB1\" \"../test-resources/Book.dtd\">"
+ "<Book/>";
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);
}
- public void testDoctypeDifferences() throws Exception {
+ public void no_testDoctypeDifferences() throws Exception {
String control = "<?xml version = \"1.0\" encoding = \"UTF-8\"?>"
+ "<!DOCTYPE Book PUBLIC \"XMLUNIT/TEST/PUB1\" \"../test-resources/Book.dtd\">"
+ "<Book/>";
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;
- 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.37.3

View 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

View File

@ -1,30 +1,35 @@
From 9866f331db726db0ac6af64649c308b01b34ea56 Mon Sep 17 00:00:00 2001 From 4b30dd33332f79c71697c8a9bdbf39d74fb06c4a Mon Sep 17 00:00:00 2001
From: Mikolaj Izdebski <mizdebsk@redhat.com> From: Mikolaj Izdebski <mizdebsk@redhat.com>
Date: Tue, 5 Nov 2019 12:14:08 +0100 Date: Tue, 5 Nov 2019 12:14:08 +0100
Subject: [PATCH 4/4] Drop support for JAXB 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 ------- .../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 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 157aa7d..d158141 100644
--- a/xmlunit-core/src/main/java/org/xmlunit/builder/Input.java --- a/xmlunit-core/src/main/java/org/xmlunit/builder/Input.java
+++ b/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 { @@ -149,12 +149,12 @@ public class Input {
}
return xml;
}
-
+
/** /**
* Build a Source from a Jaxb-Object. * Build a Source from a Jaxb-Object.
*/ */
- public static JaxbBuilder fromJaxb(Object jaxbObject) { - public static JaxbBuilder fromJaxb(Object jaxbObject) {
- return new JaxbBuilder(jaxbObject); - return JaxbBuilderFactoryLocator.getFactory().create(jaxbObject);
+ public static Builder fromJaxb(Object jaxbObject) { + public static Builder fromJaxb(Object jaxbObject) {
+ throw new RuntimeException("This implementation has JAXB support removed"); + 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 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 --- a/xmlunit-core/src/test/java/org/xmlunit/builder/InputTest.java
+++ b/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; @@ -31,7 +31,6 @@ import org.w3c.dom.Document;
@ -35,7 +40,7 @@ index 83ff38a..fac270d 100644
import org.xmlunit.util.Convert; import org.xmlunit.util.Convert;
import org.xmlunit.xpath.JAXPXPathEngine; import org.xmlunit.xpath.JAXPXPathEngine;
@@ -148,10 +147,6 @@ public class InputTest { @@ -132,10 +131,6 @@ public class InputTest {
allIsWellFor(s, "furry"); allIsWellFor(s, "furry");
} }
@ -46,15 +51,15 @@ index 83ff38a..fac270d 100644
@Test public void shouldParseUnknownToSource() throws Exception { @Test public void shouldParseUnknownToSource() throws Exception {
// from Source // from Source
allIsWellFor(Input.from(Input.fromByteArray(readTestFile()).build()).build()); 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()); allIsWellFor(Input.from(new URI("file:" + TestResources.ANIMAL_FILE)).build());
// from URL // from URL
allIsWellFor(Input.from(new URL("file:" + TestResources.ANIMAL_FILE)).build()); allIsWellFor(Input.from(new URL("file:" + TestResources.ANIMAL_FILE)).build());
- // from Jaxb-Object - // from Jaxb-Object
- allIsWellFor(Input.from(new ComplexNode()).build(), "complexNode"); - allIsWellFor(Input.from(new ComplexNode()).build(), "complexNode");
// from InputStream // from InputStream
FileInputStream is = null; try (FileInputStream is = new FileInputStream(TestResources.ANIMAL_FILE)) {
try { allIsWellFor(Input.from(is).build());
-- --
2.21.0 2.37.2

View 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

View File

@ -1,146 +0,0 @@
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 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(-)
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");
}
- @Test
- public void testNodesByXPath_withNull_shouldFailed() {
-
- thrown.expectAssertionError(format("%nExpecting not blank but was:<null>"));
-
- assertThat("<a><b></b><c/></a>").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);
}
- @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();
}
- @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() {
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:<null>"));
-
- assertThat("<a><b></b><c/></a>").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")),
--
2.21.0

View File

@ -1,156 +0,0 @@
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 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<Object>
* <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 final class CompareMatcher extends BaseMatcher<Object>
* <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 @@ 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<Object> {
* @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 @@ 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<Object> {
* @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<T> extends TypeSafeMatcher<String> {
* @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 abstract class TypeMatcher<T> extends TypeSafeMatcher<String> {
* @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 abstract class TypeMatcher<T> extends TypeSafeMatcher<String> {
* @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 abstract class TypeMatcher<T> extends TypeSafeMatcher<String> {
* @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.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

View File

@ -1,25 +0,0 @@
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 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 = "<a><b attr=\"abc\"></b></a>";
--
2.21.0

1
ci.fmf Normal file
View File

@ -0,0 +1 @@
resultsdb-testcase: separate

7
gating.yaml Normal file
View File

@ -0,0 +1,7 @@
--- !Policy
product_versions:
- rhel-10
decision_contexts:
- osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build./plans/javapackages.functional}

20
generate-tarball.sh Executable file
View File

@ -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"

7
plans/javapackages.fmf Normal file
View File

@ -0,0 +1,7 @@
summary: Run javapackages-specific tests
discover:
how: fmf
url: https://src.fedoraproject.org/tests/javapackages
ref: c10s
execute:
how: tmt

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (xmlunit-2.9.0.tar.gz) = ac00537052e6947a14ac44e69f236286dab8b62907d3357953421a9533dc32aac6d92ab8176bccfc0e4a116c7397eb85539b9b6e13a6c7aa12cf9aa8106f426d

View File

@ -1,27 +1,40 @@
%bcond_with bootstrap
Name: xmlunit Name: xmlunit
Version: 2.6.3 Version: 2.9.0
Release: 2%{?dist} Release: 9%{?dist}
Summary: Provides classes to do asserts on xml Summary: Provides classes to do asserts on xml
# The whole package is ASL 2.0 except for xmlunit-legacy which is BSD # The whole package is ASL 2.0 except for xmlunit-legacy which is BSD
License: ASL 2.0 and BSD License: Apache-2.0
Source0: https://github.com/xmlunit/xmlunit/releases/download/v%{version}/%{name}-%{version}-src.tar.gz
URL: https://www.xmlunit.org/ URL: https://www.xmlunit.org/
BuildArch: noarch
ExclusiveArch: %{java_arches} noarch
# ./generate-tarball.sh
Source0: %{name}-%{version}.tar.gz
# Remove bundled binaries which cannot be easily verified for licensing
Source1: generate-tarball.sh
Patch1: 0001-Disable-tests-requiring-network-access.patch 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
Patch3: 0003-Fix-test-failure.patch # be fetched are identical to the local file
Patch4: 0004-Drop-support-for-JAXB.patch 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: maven-local
BuildRequires: mvn(junit:junit) BuildRequires: mvn(junit:junit)
BuildRequires: mvn(net.bytebuddy:byte-buddy)
BuildRequires: mvn(org.apache.felix:maven-bundle-plugin) 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.assertj:assertj-core)
BuildRequires: mvn(org.hamcrest:hamcrest-core) BuildRequires: mvn(org.hamcrest:hamcrest-core)
BuildRequires: mvn(org.hamcrest:hamcrest-library) BuildRequires: mvn(org.hamcrest:hamcrest-library)
BuildRequires: mvn(org.mockito:mockito-core) BuildRequires: mvn(org.mockito:mockito-core)
%endif
BuildArch: noarch BuildRequires: jurand
%description %description
XMLUnit provides you with the tools to verify the XML you emit is the one you XMLUnit provides you with the tools to verify the XML you emit is the one you
@ -48,6 +61,7 @@ This package provides %{summary}.
%package legacy %package legacy
Summary: Legacy package for %{name} Summary: Legacy package for %{name}
License: BSD-3-Clause
%description legacy %description legacy
This package provides %{summary}. This package provides %{summary}.
@ -67,26 +81,38 @@ This package provides %{summary}.
%prep %prep
%setup -q -n %{name}-%{version}-src %setup -q -n %{name}-%{version}-src
%patch1 -p1 %patch 1 -p1
%patch2 -p1 %patch 2 -p1
# This test failure showed up after updating mockito to 3.X, but the error
# message clearly points to assertj-core %patch 3 -p1
%patch3 -p1 rm -r xmlunit-core/src/main/java/org/xmlunit/builder/javax_jaxb\
%patch4 -p1 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\
;
%patch 4 -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 org.codehaus.mojo:buildnumber-maven-plugin
%pom_remove_plugin :maven-assembly-plugin %pom_remove_plugin :maven-assembly-plugin
%pom_remove_plugin -r :maven-shade-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 # JAXB and JAF are not available in JDK11
%pom_remove_dep javax.activation:* xmlunit-core %pom_remove_dep org.glassfish.jaxb: xmlunit-core
%pom_remove_dep javax.xml.bind:* xmlunit-core %pom_remove_dep jakarta.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} rm -rf xmlunit-core/src/{main,test}/java/org/xmlunit/builder/{jaxb/,JaxbBuilder.java,JaxbBuilderTest.java}
%build %build
%mvn_build -s %mvn_build -s -- -Dmaven.compile.source=1.8 -Dmaven.compile.target=1.8
%install %install
%mvn_install %mvn_install
@ -96,16 +122,107 @@ rm -rf xmlunit-core/src/{main,test}/java/org/xmlunit/builder/{jaxb/,JaxbBuilder.
%license LICENSE %license LICENSE
%files javadoc -f .mfiles-javadoc %files javadoc -f .mfiles-javadoc
%files assertj -f .mfiles-xmlunit-assertj %files assertj -f .mfiles-xmlunit-assertj3
%files core -f .mfiles-xmlunit-core %files core -f .mfiles-xmlunit-core
%files legacy -f .mfiles-xmlunit-legacy %files legacy -f .mfiles-xmlunit-legacy
%files matchers -f .mfiles-xmlunit-matchers %files matchers -f .mfiles-xmlunit-matchers
%files placeholders -f .mfiles-xmlunit-placeholders %files placeholders -f .mfiles-xmlunit-placeholders
%changelog %changelog
* Mon Aug 05 2024 Mikolaj Izdebski <mizdebsk@redhat.com> - 2.9.0-9
- Switch Java compiler source/target to 1.8
- Resolves: RHEL-52707
* Thu Aug 01 2024 Troy Dawson <tdawson@redhat.com> - 2.9.0-9
- Bump release for Aug 2024 java mass rebuild
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 2.9.0-8
- Bump release for June 2024 mass rebuild
* Sat Jan 27 2024 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Fri Sep 01 2023 Mikolaj Izdebski <mizdebsk@redhat.com> - 2.9.0-6
- Convert License tag to SPDX format
* Wed Aug 30 2023 Mikolaj Izdebski <mizdebsk@redhat.com> - 2.9.0-5
- Build with Jurand instead of deprecated javapackages-extra
* Sat Jul 22 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Sat Jan 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Tue Oct 04 2022 Mikolaj Izdebski <mizdebsk@redhat.com> - 2.9.0-2
- Fix BuildRequires on javapackages-extra
* 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
* Fri Apr 22 2022 Mikolaj Izdebski <mizdebsk@redhat.com> - 2.8.2-7
- Disable more tests that require network access
* Sat Feb 05 2022 Jiri Vanek <jvanek@redhat.com> - 2.8.2-6
- Rebuilt for java-17-openjdk as system jdk
* Sat Jan 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 2.8.2-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.8.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Fri Jun 18 2021 Mikolaj Izdebski <mizdebsk@redhat.com> - 2.8.2-3
- Clean tarball from content with questionable licensing
- Resolves: rhbz#1973721
* Mon May 17 2021 Mikolaj Izdebski <mizdebsk@redhat.com> - 2.8.2-2
- Bootstrap build
- Non-bootstrap build
* Thu Feb 04 2021 Merlin Mathesius <mmathesi@redhat.com> - 0:2.7.0-7
- Update previous patch to use improved version that was merged upstream
* Fri Jan 29 2021 Merlin Mathesius <mmathesi@redhat.com> - 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 <releng@fedoraproject.org> - 0:2.7.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Tue Jan 26 2021 Marian Koncek <mkoncek@redhat.com> - 2.8.2-1
- Update to upstream version 2.8.2
* Wed Jul 29 2020 Marian Koncek <mkoncek@redhat.com> - 2.7.0-1
- Update to upstream version 2.7.0
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0:2.7.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Mon Jul 20 2020 Mat Booth <mat.booth@redhat.com> - 0:2.7.0-3
- Allow building against JDK 11
* Sat Jul 11 2020 Jiri Vanek <jvanek@redhat.com> - 0:2.7.0-2
- Rebuilt for JDK-11, see https://fedoraproject.org/wiki/Changes/Java11
* Wed May 13 2020 Dr. Tilmann Bubeck <bubeck@fedoraproject.org> - 0:2.7.0-1
- Update to version 2.7.0.
* Fri Jan 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0:2.6.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Tue Nov 05 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 2.6.3-2 * Tue Nov 05 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 2.6.3-2
- Mass rebuild for javapackages-tools 201902 - Mass rebuild for javapackages-tools 201902
* Mon Jul 29 2019 Fabio Valentini <decathorpe@gmail.com> - 0:2.6.3-1
- Update to version 2.6.3.
* Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0:1.6-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Wed Jun 26 2019 Marian Koncek <mkoncek@redhat.com> - 2.6.3-1 * Wed Jun 26 2019 Marian Koncek <mkoncek@redhat.com> - 2.6.3-1
- Update to upstream version 2.6.3 - Update to upstream version 2.6.3