#1 Update to upstream version 2.6.2
Closed 4 years ago by decathorpe. Opened 4 years ago by mkoncek.
Unknown source update-version  into  master

file modified
+1
@@ -3,3 +3,4 @@

  /xmlunit-1.4-src.zip

  /xmlunit-1.5-src.zip

  /xmlunit-1.6-src.zip

+ /xmlunit-2.6.2-src.tar.gz

@@ -0,0 +1,146 @@

+ From 72b14aa3c437984f15e026aeb3976de978e19436 Mon Sep 17 00:00:00 2001

+ From: Marian Koncek <mkoncek@redhat.com>

+ Date: Mon, 4 Mar 2019 14:52:59 +0100

+ Subject: [PATCH] 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.20.1

+ 

file modified
+1 -1
@@ -1,1 +1,1 @@

- e69b85b1b386b5027e30053eaaf591a3  xmlunit-1.6-src.zip

+ SHA512 (xmlunit-2.6.2-src.tar.gz) = 7e71626e604f475e0dffaabf814a81e0d2a6fd43790e2371858c815c676d5b3d6e9f285f98d817ff1b41a81323441bdadb56b8d172419f5546ff6ffc1f7ace7c

file removed
-6
@@ -1,6 +0,0 @@

- <project>

-   <modelVersion>4.0.0</modelVersion>

-   <groupId>xmlunit</groupId>

-   <artifactId>xmlunit</artifactId>

-   <version>1.0</version>

- </project> 

\ No newline at end of file

file modified
+67 -43
@@ -29,33 +29,31 @@

  #

  

  Name:           xmlunit

- Version:        1.6

- Release:        9%{?dist}

+ Version:        2.6.2

+ Release:        1%{?dist}

  Epoch:          0

  Summary:        Provides classes to do asserts on xml

- License:        BSD

- Source0:        http://downloads.sourceforge.net/xmlunit/xmlunit-1.6-src.zip

- Source1:        http://repo1.maven.org/maven2/xmlunit/xmlunit/1.0/xmlunit-1.0.pom

- URL:            http://xmlunit.sourceforge.net/

- BuildRequires:  javapackages-local

- BuildRequires:  ant

- BuildRequires:  ant-junit

- BuildRequires:  junit

- BuildRequires:  xalan-j2

- BuildRequires:  xerces-j2

- BuildRequires:  xml-commons-apis

- 

- Requires:       junit

- Requires:       xalan-j2

- Requires:       xml-commons-apis

+ License:        ASL 2.0

+ Source0:        https://github.com/xmlunit/xmlunit/releases/download/v%{version}/%{name}-%{version}-src.tar.gz

+ URL:            https://www.xmlunit.org/

+ 

+ Patch0:         0001-Disable-tests-requiring-network-access.patch

+ 

+ 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

  

  %description

- XMLUnit extends JUnit to simplify unit testing of XML. It compares a control

- XML document to a test document or the result of a transformation, validates

- documents against a DTD, and (from v0.5) compares the results of XPath

- expressions.

+ 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}
@@ -63,41 +61,67 @@

  %description    javadoc

  Javadoc for %{name}

  

- %prep

- %setup -q

+ %package        assertj

+ Summary:        Assertj for %{name}

  

- sed -i /java.class.path/d build.xml

- # remove all binary libs and javadocs

- find . -name "*.jar" -exec rm -f {} \;

- rm -rf doc

+ %description    assertj

+ This package provides %{summary}.

  

- #Fix wrong-file-end-of-line-encoding

- sed -i 's/\r//g' README.txt LICENSE.txt

+ %package        core

+ Summary:        Core package for %{name}

  

- %mvn_file : %{name}

+ %description    core

+ This package provides %{summary}.

  

- %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

+ %package        legacy

+ Summary:        Legacy package for %{name}

  

- %mvn_artifact %{SOURCE1} build/lib/%{name}-%{version}.jar

+ %description    legacy

+ This package provides %{summary}.

  

- %install

- %mvn_install -J build/doc/api/

+ %package        matchers

+ Summary:        Matchers for %{name}

+ 

+ %description    matchers

+ This package provides %{summary}.

+ 

+ %package        placeholders

+ Summary:        Placeholders for %{name}

+ 

+ %description    placeholders

+ This package provides %{summary}.

  

- %check

- ant

+ %prep

+ %setup -q -n %{name}-%{version}-src

+ 

+ %patch0 -p1

+ 

+ %pom_remove_plugin org.codehaus.mojo:buildnumber-maven-plugin

+ %pom_remove_plugin :maven-assembly-plugin

+ 

+ %mvn_alias "org.xmlunit:xmlunit-legacy" "xmlunit:xmlunit"

  

+ %build

+ %mvn_build -s

+ 

+ %install

+ %mvn_install

  

- %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

  

  %files javadoc -f .mfiles-javadoc

+ %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 Mar 04 2019 Marian Koncek <mkoncek@redhat.com> - 0:2.6.2-1

+ - Update to upstream version 2.6.2

+ 

  * Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0:1.6-9

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

  

no initial comment

The pull-request cannot be merged due to conflicts.

rebased onto 0b9040f

4 years ago

That is fixed now.
xmlunit >= 2 is required to build maven 3.6.0 with tests.

How breaking change is this? Does it break other packages?

It is a major update, many things changed in the source package (custom pom.xml, modular architecture).

However they provide a xmlunit-legacy module which provides backwards compatibility. I set %mvn_alias between xmlunit-legacy and the old name for xmlunit package, I believe it works correctly.

Thanks! I think this should be good, but I let the maintainers decide here, this one is not maintained by the Stewardship SIG.

Does not build. Patch 0001-Disable-tests-requiring-network-access.patch is missing. Did you forget to git add it?

rebased onto 79c8202

4 years ago

I've done test rebuilds of dependent packages against this update in COPR:

https://copr.fedorainfracloud.org/coprs/decathorpe/xmlunit-pr/monitor/

Compared to the current state of koschei, there are 4 additional build failures:

  • java-uuid-generator: always fails in COPR builds for unrelated reason (some ethernet-adapter-naming dependent test code?)
  • openhft-affinity: also always fails in COPR for unrelated reasons (looks like CPU affinity test fails in COPR)
  • py4j: unrelated build failure due to non-deterministic test suite (involving networking issues)

The only interesting failure here is xmvn: Looking at the failing test, it seems like an expected change when updating xmlunit:

[different] Expected attribute value 'http://fedorahosted.org/xmvn/CONFIG/2.0.0' but was 'http://fedorahosted.org/xmvn/METADATA/3.0.0'

Build log here: https://copr-be.cloud.fedoraproject.org/results/decathorpe/xmlunit-pr/fedora-rawhide-x86_64/00958792-xmvn/build.log.gz

@mizdebsk do you know anything about this? I assume updating xmvn to version 3.1.0 would fix this issue.

The referenced XMvn problem can be fixed with upstream commit c35be2b. Additionally, another patch is needed: 2ee3ca0. Both patches were applied in MBI: see commit dabf665

Great, thanks! That's what I was looking for. With these patches, xmvn built fine against xmlunit 2.6.2:

https://copr.fedorainfracloud.org/coprs/decathorpe/xmlunit-pr/build/958921/

I've submitted a PR to xmvn, which can be merged as soon as this PR is merged, as well:

https://src.fedoraproject.org/rpms/xmvn/pull-request/1

Related: xmlunit was updated to version 2.6.2 in these module branches already:

@mizdebsk what do you think, can we merge this?
It looks good from my perspective. The follow-up PR for xmvn is also ready.

Pull-Request has been closed by decathorpe

4 years ago