diff --git a/0001-Disable-tests-requiring-network-access.patch b/0001-Disable-tests-requiring-network-access.patch new file mode 100644 index 0000000000000000000000000000000000000000..04bef680af3dcf79ff6fe11003b9e638818dd01a --- /dev/null +++ b/0001-Disable-tests-requiring-network-access.patch @@ -0,0 +1,130 @@ +diff -r -u xmlunit-2.7.0-src-orig/xmlunit-assertj/src/test/java/org/xmlunit/assertj/XmlAssertNodesByXPathTest.java xmlunit-2.7.0-src/xmlunit-assertj/src/test/java/org/xmlunit/assertj/XmlAssertNodesByXPathTest.java +--- xmlunit-2.7.0-src-orig/xmlunit-assertj/src/test/java/org/xmlunit/assertj/XmlAssertNodesByXPathTest.java 2018-08-21 22:03:14.000000000 +0200 ++++ xmlunit-2.7.0-src/xmlunit-assertj/src/test/java/org/xmlunit/assertj/XmlAssertNodesByXPathTest.java 2020-05-15 13:40:22.050239084 +0200 +@@ -43,14 +43,6 @@ + } + + @Test +- public void testNodesByXPath_withNull_shouldFailed() { +- +- thrown.expectAssertionError(format("%nExpecting not blank but was:")); +- +- assertThat("").nodesByXPath(null); +- } +- +- @Test + public void testNodesByXPath_withWhitespacesOnly_shouldFailed() { + + thrown.expectAssertionError(format("%nExpecting not blank but was:<\" \n \t\">")); +diff -r -u xmlunit-2.7.0-src-orig/xmlunit-assertj/src/test/java/org/xmlunit/assertj/XmlAssertValidationTest.java xmlunit-2.7.0-src/xmlunit-assertj/src/test/java/org/xmlunit/assertj/XmlAssertValidationTest.java +--- xmlunit-2.7.0-src-orig/xmlunit-assertj/src/test/java/org/xmlunit/assertj/XmlAssertValidationTest.java 2020-05-03 21:05:12.000000000 +0200 ++++ xmlunit-2.7.0-src/xmlunit-assertj/src/test/java/org/xmlunit/assertj/XmlAssertValidationTest.java 2020-05-15 13:44:15.720157403 +0200 +@@ -91,64 +91,12 @@ + } + + @Test +- public void testIsValidAgainst_withEmptySourcesArray_shouldPass() { +- +- StreamSource xml = new StreamSource(new File(TestResources.TEST_RESOURCE_DIR + "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(TestResources.TEST_RESOURCE_DIR + "invalidBook.xml")); +- +- assertThat(xml).isValidAgainst(); +- } +- +- @Test +- public void testIsValid_shouldPass() { +- +- StreamSource xml = new StreamSource(new File(TestResources.TEST_RESOURCE_DIR + "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(TestResources.TEST_RESOURCE_DIR + "invalidBook.xml")); +- +- assertThat(xml).isValid(); +- } +- +- @Test + public void testIsInvalid_withBrokenXml_shouldPass() { + + StreamSource xml = new StreamSource(new File(TestResources.TEST_RESOURCE_DIR + "invalidBook.xml")); + + assertThat(xml).isInvalid(); + } +- +- @Test +- public void testIsInvalid_shouldField() { +- +- thrown.expectAssertionErrorPattern("^\\nExpecting:\\n <.*" +- + Pattern.quote(TestResources.TEST_RESOURCE_DIR) + "BookXsdGenerated.xml>\\nto be invalid"); +- +- StreamSource xml = new StreamSource(new File(TestResources.TEST_RESOURCE_DIR + "BookXsdGenerated.xml")); +- +- assertThat(xml).isInvalid(); +- } + + @Test + public void testIsValidAgainst_withNullSchemaSources_shouldFailed() { +Nur in xmlunit-2.7.0-src/xmlunit-assertj/src/test/java/org/xmlunit/assertj: XmlAssertValidationTest.java~. +diff -r -u xmlunit-2.7.0-src-orig/xmlunit-assertj/src/test/java/org/xmlunit/assertj/XmlAssertValueByXPathTest.java xmlunit-2.7.0-src/xmlunit-assertj/src/test/java/org/xmlunit/assertj/XmlAssertValueByXPathTest.java +--- xmlunit-2.7.0-src-orig/xmlunit-assertj/src/test/java/org/xmlunit/assertj/XmlAssertValueByXPathTest.java 2020-04-28 10:10:30.000000000 +0200 ++++ xmlunit-2.7.0-src/xmlunit-assertj/src/test/java/org/xmlunit/assertj/XmlAssertValueByXPathTest.java 2020-05-15 13:47:13.361335083 +0200 +@@ -31,14 +31,6 @@ + public static SetEnglishLocaleRule locale = new SetEnglishLocaleRule(); + + @Test +- public void testValueByXPath_withNull_shouldFailed() { +- +- thrown.expectAssertionError(format("%nExpecting not blank but was:")); +- +- assertThat("").valueByXPath(null); +- } +- +- @Test + public void testValueByXPath_withWhitespacesOnly_shouldFailed() { + + thrown.expectAssertionError(format("%nExpecting not blank but was:<\" \n \t\">")); +Nur in xmlunit-2.7.0-src/xmlunit-assertj/src/test/java/org/xmlunit/assertj: XmlAssertValueByXPathTest.java~. +diff -r -u xmlunit-2.7.0-src-orig/xmlunit-matchers/src/test/java/org/xmlunit/matchers/ValidationMatcherTest.java xmlunit-2.7.0-src/xmlunit-matchers/src/test/java/org/xmlunit/matchers/ValidationMatcherTest.java +--- xmlunit-2.7.0-src-orig/xmlunit-matchers/src/test/java/org/xmlunit/matchers/ValidationMatcherTest.java 2019-12-31 14:00:54.000000000 +0100 ++++ xmlunit-2.7.0-src/xmlunit-matchers/src/test/java/org/xmlunit/matchers/ValidationMatcherTest.java 2020-05-15 13:49:17.980758207 +0200 +@@ -78,19 +78,6 @@ + is(valid(new StreamSource(new File(TestResources.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_RESOURCE_DIR + "BookXsdGenerated.xml")), +- is(new ValidationMatcher())); +- +- } +- + @Test(expected = AssertionError.class) + public void shouldThrowOnBrokenInstanceWithoutExplicitSchemaSource() { + assertThat(new StreamSource(new File(TEST_RESOURCE_DIR + "invalidBook.xml")), +Nur in xmlunit-2.7.0-src/xmlunit-matchers/src/test/java/org/xmlunit/matchers: ValidationMatcherTest.java~. diff --git a/xmlunit-1.0.pom b/xmlunit-1.0.pom deleted file mode 100644 index c5aa039853fd589b284430be51949aa47d6f8d6b..0000000000000000000000000000000000000000 --- a/xmlunit-1.0.pom +++ /dev/null @@ -1,6 +0,0 @@ - - 4.0.0 - xmlunit - xmlunit - 1.0 - \ No newline at end of file diff --git a/xmlunit-1.6-src.zip b/xmlunit-1.6-src.zip deleted file mode 100644 index 6598ed29c1e10af8654bd93cdf6cb4db840e7125..0000000000000000000000000000000000000000 Binary files a/xmlunit-1.6-src.zip and /dev/null differ diff --git a/xmlunit-2.7.0-ValueAssertTest-fix.patch b/xmlunit-2.7.0-ValueAssertTest-fix.patch new file mode 100644 index 0000000000000000000000000000000000000000..cb96820f30aa8441621f7ed96bf654e320fa2d8e --- /dev/null +++ b/xmlunit-2.7.0-ValueAssertTest-fix.patch @@ -0,0 +1,12 @@ +diff -ru ../xmlunit-2.7.0-src.ORIG/xmlunit-assertj/src/test/java/org/xmlunit/assertj/ValueAssertTest.java ./xmlunit-assertj/src/test/java/org/xmlunit/assertj/ValueAssertTest.java +--- ../xmlunit-2.7.0-src.ORIG/xmlunit-assertj/src/test/java/org/xmlunit/assertj/ValueAssertTest.java 2020-04-28 03:09:04.000000000 -0500 ++++ ./xmlunit-assertj/src/test/java/org/xmlunit/assertj/ValueAssertTest.java 2021-01-29 13:24:38.101158331 -0600 +@@ -263,7 +263,7 @@ + @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 = ""; + diff --git a/xmlunit-2.7.0-src.tar.gz b/xmlunit-2.7.0-src.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..f807b56d16e5f32974fc51b2228d3728175599f7 Binary files /dev/null and b/xmlunit-2.7.0-src.tar.gz differ diff --git a/xmlunit.spec b/xmlunit.spec index a0f205b48179ce631597108a6bd037f419a4370e..e413612dd83b3e19badebe4d8c931eda266ea285 100644 --- a/xmlunit.spec +++ b/xmlunit.spec @@ -1,14 +1,27 @@ Name: xmlunit -Version: 1.6 -Release: 10 +Version: 2.7.0 +Release: 1 Summary: Unit Testing XML for Java and .NET -License: BSD -URL: http://xmlunit.sourceforge.net/ -Source0: http://downloads.sourceforge.net/xmlunit/xmlunit-1.6-src.zip -Source1: https://repo1.maven.org/maven2/xmlunit/xmlunit/1.0/xmlunit-1.0.pom +License: Apache 2.0 and BSD +URL: https://www.xmlunit.org/ +Source0: https://github.com/xmlunit/xmlunit/releases/download/v%{version}/%{name}-%{version}-src.tar.gz +Patch0: 0001-Disable-tests-requiring-network-access.patch +Patch1: xmlunit-2.7.0-ValueAssertTest-fix.patch BuildArch: noarch -BuildRequires: javapackages-local, ant, ant-junit, junit, xalan-j2, xerces-j2, xml-commons-apis +BuildRequires: maven-local +BuildRequires: mvn(com.sun.istack:istack-commons-runtime) +BuildRequires: mvn(com.sun.xml.bind:jaxb-impl) +BuildRequires: mvn(jakarta.activation:jakarta.activation-api) +BuildRequires: mvn(javax.xml.bind:jaxb-api) +BuildRequires: mvn(junit:junit) +BuildRequires: mvn(net.bytebuddy:byte-buddy) +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) Requires: junit, xalan-j2, xml-commons-apis Provides: %{name}-javadoc%{?_isa} %{name}-javadoc Obsoletes: %{name}-javadoc @@ -18,33 +31,64 @@ XMLUnit provides you with the tools to verify the XML you emit is the one you wa It provides helpers to validate against an XML Schema, assert the values of XPath queries or compare XML documents against expected outcomes. +%package assertj +Summary: Assertj for %{name} +%description assertj +This package provides %{summary}. + +%package core +Summary: Core package for %{name} +%description core +This package provides %{summary}. + +%package legacy +Summary: Legacy package for %{name} +%description legacy +This package provides %{summary}. + +%package matchers +Summary: Matchers for %{name} +%description matchers +This package provides %{summary}. + +%package placeholders +Summary: Placeholders for %{name} +%description placeholders +This package provides %{summary}. + %prep -%autosetup -p1 +%autosetup -n %{name}-%{version}-src -p1 -sed -i /java.class.path/d build.xml -find . -name "*.jar" -delete; -rm -rf doc +%pom_remove_plugin org.codehaus.mojo:buildnumber-maven-plugin +%pom_remove_plugin :maven-assembly-plugin -sed -i 's/\r//g' README.txt LICENSE.txt +%pom_change_dep javax.activation:activation jakarta.activation:jakarta.activation-api . xmlunit-core +%pom_change_dep com.sun.xml.bind:jaxb-core com.sun.xml.bind:jaxb-impl . xmlunit-core +%pom_add_dep com.sun.istack:istack-commons-runtime::test xmlunit-core -%mvn_file : %{name} +%mvn_alias "org.xmlunit:xmlunit-legacy" "xmlunit:xmlunit" %build -ant -Dbuild.compiler=modern -Dhaltonfailure=yes -Djunit.lib=$(build-classpath junit) \ - -Dxmlxsl.lib= -Dtest.report.dir=test -Ddb5.xsl=%{_datadir}/sgml/docbook/xsl-ns-stylesheets jar javadocs - -%mvn_artifact %{SOURCE1} build/lib/%{name}-%{version}.jar +%mvn_build -s -f %install -%mvn_install -J build/doc/api/ +%mvn_install -%check -ant -%files -f .mfiles -%doc README.txt LICENSE.txt userguide/XMLUnit-Java.pdf +%files -f .mfiles-xmlunit-parent +%doc README.md CONTRIBUTING.md RELEASE_NOTES.md +%license LICENSE %{_javadocdir}/%{name}/* +%files assertj -f .mfiles-xmlunit-assertj +%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 +* Mon Feb 21 2022 Ge Wang - 2.7.0-1 +- Upgrade to version 2.7.0 + * Tue Dec 3 2019 openEuler Buildteam - 1.6-9 - Package init