update to version 2.6.3

This commit is contained in:
Fabio Valentini 2019-07-29 18:48:47 +02:00
parent cf2d1b9642
commit bf396e3cbf
No known key found for this signature in database
GPG Key ID: 5AC5F572E5D410AF
5 changed files with 233 additions and 50 deletions

9
.gitignore vendored
View File

@ -1,5 +1,10 @@
xmlunit1.0.zip
xmlunit-1.3-src.zip
/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

View File

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

View File

@ -1 +1 @@
e69b85b1b386b5027e30053eaaf591a3 xmlunit-1.6-src.zip
SHA512 (xmlunit-2.6.3-src.tar.gz) = c52e9dc1d67ee61d266d35e59e7c54ca554fcc8fd7036ed1c6dacb85ebf8cc545da0cae9863b1c228b59abfd1ae659b080f691c02257b96f3882a9d9ecb8dbf9

View File

@ -1,6 +0,0 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>xmlunit</groupId>
<artifactId>xmlunit</artifactId>
<version>1.0</version>
</project>

View File

@ -29,33 +29,34 @@
#
Name: xmlunit
Version: 1.6
Release: 10%{?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
Epoch: 0
Version: 2.6.3
Release: 1%{?dist}
# xmlunit2 is licensed under ASL 2.0, xmlunit-legacy is still BSD-licensed
License: ASL 2.0 and BSD
Requires: junit
Requires: xalan-j2
Requires: xml-commons-apis
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
BuildArch: noarch
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)
%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 +64,77 @@ Summary: Javadoc for %{name}
%description javadoc
Javadoc for %{name}
%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
%setup -q
%setup -q -n %{name}-%{version}-src
sed -i /java.class.path/d build.xml
# remove all binary libs and javadocs
find . -name "*.jar" -exec rm -f {} \;
rm -rf doc
%patch0 -p1
#Fix wrong-file-end-of-line-encoding
sed -i 's/\r//g' README.txt LICENSE.txt
%pom_remove_plugin org.codehaus.mojo:buildnumber-maven-plugin
%pom_remove_plugin :maven-assembly-plugin
%mvn_alias "org.xmlunit:xmlunit-legacy" "xmlunit:xmlunit"
%mvn_file : %{name}
%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_build -s
%mvn_artifact %{SOURCE1} build/lib/%{name}-%{version}.jar
%install
%mvn_install -J build/doc/api/
%check
ant
%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 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
@ -212,3 +249,4 @@ ant
* Wed Dec 17 2003 Paul Nasrat <pauln at truemesh.com> - 0:1.0-1jpp
- Initial Version