diff --git a/0001-Fix-build-with-OpenJDK-11.patch b/0001-Fix-build-with-OpenJDK-11.patch deleted file mode 100644 index c1fb36c..0000000 --- a/0001-Fix-build-with-OpenJDK-11.patch +++ /dev/null @@ -1,131 +0,0 @@ -From d33031924faa557bb43ba0471f74d942ddfeae50 Mon Sep 17 00:00:00 2001 -From: Mikolaj Izdebski -Date: Tue, 5 Nov 2019 14:50:23 +0100 -Subject: [PATCH] Fix build with OpenJDK 11 - ---- - .../src/main/java/org/hamcrest/collection/ArrayMatching.java | 3 ++- - .../org/hamcrest/collection/IsArrayContainingInAnyOrder.java | 2 +- - .../org/hamcrest/collection/IsArrayContainingInOrder.java | 2 +- - .../hamcrest/collection/IsIterableContainingInAnyOrder.java | 2 +- - .../collection/IsIterableContainingInRelativeOrder.java | 2 +- - hamcrest/src/main/java/org/hamcrest/core/AllOf.java | 2 +- - hamcrest/src/main/java/org/hamcrest/core/AnyOf.java | 2 +- - .../src/main/java/org/hamcrest/core/CombinableMatcher.java | 4 ++-- - 8 files changed, 10 insertions(+), 9 deletions(-) - -diff --git a/hamcrest/src/main/java/org/hamcrest/collection/ArrayMatching.java b/hamcrest/src/main/java/org/hamcrest/collection/ArrayMatching.java -index fc968e0..baab775 100644 ---- a/hamcrest/src/main/java/org/hamcrest/collection/ArrayMatching.java -+++ b/hamcrest/src/main/java/org/hamcrest/collection/ArrayMatching.java -@@ -67,7 +67,8 @@ public class ArrayMatching { - */ - @SafeVarargs - public static Matcher arrayContainingInAnyOrder(Matcher... itemMatchers) { -- return arrayContainingInAnyOrder(asList(itemMatchers)); -+ Collection> itemMatchersList = asList(itemMatchers); -+ return new ArrayAsIterableMatcher<>(new IsIterableContainingInAnyOrder<>(itemMatchersList), itemMatchersList, "in any order"); - } - - /** -diff --git a/hamcrest/src/main/java/org/hamcrest/collection/IsArrayContainingInAnyOrder.java b/hamcrest/src/main/java/org/hamcrest/collection/IsArrayContainingInAnyOrder.java -index 7e72a62..c0c7efc 100644 ---- a/hamcrest/src/main/java/org/hamcrest/collection/IsArrayContainingInAnyOrder.java -+++ b/hamcrest/src/main/java/org/hamcrest/collection/IsArrayContainingInAnyOrder.java -@@ -59,7 +59,7 @@ public class IsArrayContainingInAnyOrder extends TypeSafeMatcher { - * a list of matchers, each of which must be satisfied by an entry in an examined array - */ - public static Matcher arrayContainingInAnyOrder(Matcher... itemMatchers) { -- return arrayContainingInAnyOrder(Arrays.asList(itemMatchers)); -+ return new IsArrayContainingInAnyOrder(Arrays.asList(itemMatchers)); - } - - /** -diff --git a/hamcrest/src/main/java/org/hamcrest/collection/IsArrayContainingInOrder.java b/hamcrest/src/main/java/org/hamcrest/collection/IsArrayContainingInOrder.java -index c046914..2022f1a 100644 ---- a/hamcrest/src/main/java/org/hamcrest/collection/IsArrayContainingInOrder.java -+++ b/hamcrest/src/main/java/org/hamcrest/collection/IsArrayContainingInOrder.java -@@ -73,7 +73,7 @@ public class IsArrayContainingInOrder extends TypeSafeMatcher { - * the matchers that must be satisfied by the items in the examined array - */ - public static Matcher arrayContaining(Matcher... itemMatchers) { -- return arrayContaining(asList(itemMatchers)); -+ return new IsArrayContainingInOrder(asList(itemMatchers)); - } - - /** -diff --git a/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInAnyOrder.java b/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInAnyOrder.java -index d6a9a33..9a7e6c0 100644 ---- a/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInAnyOrder.java -+++ b/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInAnyOrder.java -@@ -98,7 +98,7 @@ public class IsIterableContainingInAnyOrder extends TypeSafeDiagnosingMatcher - */ - @SafeVarargs - public static Matcher> containsInAnyOrder(Matcher... itemMatchers) { -- return containsInAnyOrder(Arrays.asList(itemMatchers)); -+ return new IsIterableContainingInAnyOrder(Arrays.asList(itemMatchers)); - } - - /** -diff --git a/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInRelativeOrder.java b/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInRelativeOrder.java -index 0657768..06d6a57 100644 ---- a/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInRelativeOrder.java -+++ b/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInRelativeOrder.java -@@ -99,7 +99,7 @@ public class IsIterableContainingInRelativeOrder extends TypeSafeDiagnosingMa - */ - @SafeVarargs - public static Matcher> containsInRelativeOrder(Matcher... itemMatchers) { -- return containsInRelativeOrder(asList(itemMatchers)); -+ return new IsIterableContainingInRelativeOrder(asList(itemMatchers)); - } - - /** -diff --git a/hamcrest/src/main/java/org/hamcrest/core/AllOf.java b/hamcrest/src/main/java/org/hamcrest/core/AllOf.java -index b8c3faa..f8951bd 100644 ---- a/hamcrest/src/main/java/org/hamcrest/core/AllOf.java -+++ b/hamcrest/src/main/java/org/hamcrest/core/AllOf.java -@@ -56,6 +56,6 @@ public class AllOf extends DiagnosingMatcher { - */ - @SafeVarargs - public static Matcher allOf(Matcher... matchers) { -- return allOf(Arrays.asList(matchers)); -+ return new AllOf(Arrays.asList(matchers)); - } - } -diff --git a/hamcrest/src/main/java/org/hamcrest/core/AnyOf.java b/hamcrest/src/main/java/org/hamcrest/core/AnyOf.java -index 7a22c22..5a63574 100644 ---- a/hamcrest/src/main/java/org/hamcrest/core/AnyOf.java -+++ b/hamcrest/src/main/java/org/hamcrest/core/AnyOf.java -@@ -46,6 +46,6 @@ public class AnyOf extends ShortcutCombination { - */ - @SafeVarargs - public static AnyOf anyOf(Matcher... matchers) { -- return anyOf(Arrays.asList(matchers)); -+ return new AnyOf(Arrays.asList(matchers)); - } - } -diff --git a/hamcrest/src/main/java/org/hamcrest/core/CombinableMatcher.java b/hamcrest/src/main/java/org/hamcrest/core/CombinableMatcher.java -index e37efce..6b44884 100644 ---- a/hamcrest/src/main/java/org/hamcrest/core/CombinableMatcher.java -+++ b/hamcrest/src/main/java/org/hamcrest/core/CombinableMatcher.java -@@ -57,7 +57,7 @@ public class CombinableMatcher extends TypeSafeDiagnosingMatcher { - this.first = matcher; - } - public CombinableMatcher and(Matcher other) { -- return new CombinableMatcher<>(first).and(other); -+ return new CombinableMatcher<>(first).and((Matcher)other); - } - } - -@@ -76,7 +76,7 @@ public class CombinableMatcher extends TypeSafeDiagnosingMatcher { - this.first = matcher; - } - public CombinableMatcher or(Matcher other) { -- return new CombinableMatcher<>(first).or(other); -+ return new CombinableMatcher<>(first).or((Matcher)other); - } - } - } --- -2.21.0 - diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..c912306 --- /dev/null +++ b/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2000-2024, www.hamcrest.org + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff --git a/LICENSE.txt b/LICENSE.txt deleted file mode 100644 index d2ceb25..0000000 --- a/LICENSE.txt +++ /dev/null @@ -1,27 +0,0 @@ -BSD License - -Copyright (c) 2000-2015 www.hamcrest.org -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -Redistributions of source code must retain the above copyright notice, this list of -conditions and the following disclaimer. Redistributions in binary form must reproduce -the above copyright notice, this list of conditions and the following disclaimer in -the documentation and/or other materials provided with the distribution. - -Neither the name of Hamcrest nor the names of its contributors may be used to endorse -or promote products derived from this software without specific prior written -permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT -SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY -WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH -DAMAGE. diff --git a/README.md b/README.md index 314c76a..1ab2f47 100644 --- a/README.md +++ b/README.md @@ -1,63 +1,68 @@ ![JavaHamcrest](http://hamcrest.org/images/logo.jpg) -[![Build Status](https://travis-ci.org/hamcrest/JavaHamcrest.png?branch=master)](https://travis-ci.org/hamcrest/JavaHamcrest) +[![Build Status](https://github.com/hamcrest/JavaHamcrest/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/hamcrest/JavaHamcrest/actions/workflows/build.yml) +[![Maven Central](https://img.shields.io/maven-central/v/org.hamcrest/hamcrest.svg?label=Maven%20Central)](https://search.maven.org/artifact/org.hamcrest/hamcrest) +[![License](https://img.shields.io/github/license/hamcrest/JavaHamcrest.svg)](LICENSE) -Java Hamcrest -============= -Licensed under [BSD License][]. -What is Hamcrest? ------------------ +# Java Hamcrest + +## What is Hamcrest? + Hamcrest is a library of matchers, which can be combined in to create flexible expressions of intent in tests. They've also been used for other purposes. -Downloads ---------- -You can obtain Hamcrest binaries from [maven central][]. +The [tutorial](http://hamcrest.org/JavaHamcrest/tutorial) is good place to see how Hamcrest can be used. -Extensions ----------- +## Downloads -For Hamcrest extension projects see the [hamcrest extensions page][]. +You can obtain Hamcrest binaries from [maven central](https://search.maven.org/artifact/org.hamcrest/hamcrest). If you +are using build tooling such as Maven, Gradle, etc, you can simply add a dependency declaration to your build +definition. Learn more at [Hamcrest Distributables](http://hamcrest.org/JavaHamcrest/distributables). -Documentation -------------- -Documentation can be found on the [Hamcrest site](http://hamcrest.org). +## Documentation -Reporting Bugs/Issues ---------------------- -If you find an issue with Java Hamcrest, please report it via the -[GitHub issue tracker](https://github.com/hamcrest/JavaHamcrest/issues), -after first checking that it hasn't been raised already. +Documentation can be found on the [Hamcrest site](http://hamcrest.org). For a detailed list of recent changes, +see [CHANGES.md](CHANGES.md) -Source ------- -To build, please read BUILDING.txt +## Reporting Bugs/Issues + +If you find an issue with Java Hamcrest, please report it via the +[GitHub issue tracker](https://github.com/hamcrest/JavaHamcrest/issues), +after first checking that it hasn't been raised already. + +## Build from Source + +Building Hamcrest from source requires a minimum of JDK 1.8. + +Clone the repository, and from the top level directory in the repo workspace +run the following command: + +```shell +./gradlew clean build javadoc +``` +This will download the correct version of Gradle, do a full clean build, +run all tests and (if successful) package the compiled classes in a jar +file. The resulting look under the `hamcrest/build/libs` directory. + +## Acknowledgements -Acknowledgements ----------------- Developers: - * Joe Walnes - * Nat Pryce - * Steve Freeman +* Joe Walnes +* Nat Pryce +* Steve Freeman Contributors: - * Robert Chatley - * Tom White - * Neil Dunn - * Dan North - * Magne Rasmussen - * David Saff - * Tom Denley +* Robert Chatley +* Tom White +* Neil Dunn +* Dan North +* Magne Rasmussen +* David Saff +* Tom Denley +* Joe Schmetzer -Also, thanks to everyone who has worked on DynaMock, nMock, jMock, EasyMock and MiniMock! These libraries inspired Hamcrest. - - -[logo]: http://hamcrest.org/images/logo.jpg -[website]: https://github.com/hamcrest/JavaHamcrest -[BSD License]: http://opensource.org/licenses/BSD-3-Clause -[Maven central]: http://search.maven.org/#search%7Cga%7C1%7Cg%3Aorg.hamcrest -[hamcrest extensions page]: https://github.com/hamcrest/JavaHamcrest/wiki/Related-Projects -[GitHub issue tracker]: https://github.com/hamcrest/JavaHamcrest/issues +Also, thanks to everyone who has worked on DynaMock, nMock, jMock, EasyMock +and MiniMock! These libraries inspired Hamcrest. diff --git a/_service b/_service index 469615b..70a2148 100644 --- a/_service +++ b/_service @@ -3,7 +3,7 @@ git https://github.com/hamcrest/JavaHamcrest.git hamcrest - v2.2 + v3.0 v* @PARENT_TAG@ v(.*) diff --git a/hamcrest-2.2.tar.xz b/hamcrest-2.2.tar.xz deleted file mode 100644 index 7bdb4e4..0000000 --- a/hamcrest-2.2.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4dc070ac5ca508d33ff80e44b61dfd755764014b119462d5a6e80c22494ce9ce -size 51684 diff --git a/hamcrest-2.2.pom b/hamcrest-3.0.pom similarity index 52% rename from hamcrest-2.2.pom rename to hamcrest-3.0.pom index 91d3896..cc0a628 100644 --- a/hamcrest-2.2.pom +++ b/hamcrest-3.0.pom @@ -1,17 +1,22 @@ - + + + + + 4.0.0 org.hamcrest hamcrest - 2.2 + 3.0 Hamcrest Core API and libraries of hamcrest matcher framework. http://hamcrest.org/JavaHamcrest/ - BSD License 3 - http://opensource.org/licenses/BSD-3-Clause + BSD-3-Clause + https://raw.githubusercontent.com/hamcrest/JavaHamcrest/master/LICENSE @@ -29,7 +34,8 @@ - git@github.com:hamcrest/JavaHamcrest.git + scm:git:https://github.com/hamcrest/JavaHamcrest.git + scm:git:ssh://github.com/hamcrest/JavaHamcrest.git https://github.com/hamcrest/JavaHamcrest diff --git a/hamcrest-3.0.tar.xz b/hamcrest-3.0.tar.xz new file mode 100644 index 0000000..bf69e2d --- /dev/null +++ b/hamcrest-3.0.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3b6ba8d4a02881ae353188db89127917f0b288e2899f34d081fe1038b63b11e4 +size 52256 diff --git a/hamcrest-build.xml b/hamcrest-build.xml index a379206..2e0dcb7 100644 --- a/hamcrest-build.xml +++ b/hamcrest-build.xml @@ -10,9 +10,12 @@ - + - + + + + @@ -45,6 +48,7 @@ debug="true" optimize="false" deprecation="true" + release="${compiler.release}" target="${compiler.target}" verbose="false" fork="false" @@ -69,6 +73,7 @@ debug="true" optimize="false" deprecation="true" + release="${compiler.release}" target="${compiler.target}" verbose="false" fork="false" @@ -187,9 +192,9 @@ - - - + + + diff --git a/hamcrest.changes b/hamcrest.changes index cb36bf9..721d8ba 100644 --- a/hamcrest.changes +++ b/hamcrest.changes @@ -1,3 +1,20 @@ +------------------------------------------------------------------- +Tue Aug 27 14:36:48 UTC 2024 - Fridrich Strba + +- Upgrade to upstream version 3.0 + * Breaking Changes + + From version 3.0, the jar distributed to Maven Central is now + compiled to Java 1.8 bytecode, and is not compatible with + previous versions of Java. + Developers who use Java 1.7 earlier can still depend upon + hamcrest-2.2.jar. + * Improvements + + FileMatchersTest simplification + + License cleanup +- Removed patches: + * 0001-Fix-build-with-OpenJDK-11.patch + + not needed any more + ------------------------------------------------------------------- Wed Feb 21 09:10:46 UTC 2024 - Fridrich Strba diff --git a/hamcrest.spec b/hamcrest.spec index bc535fa..1ebc1d3 100644 --- a/hamcrest.spec +++ b/hamcrest.spec @@ -18,7 +18,7 @@ %bcond_with tests Name: hamcrest -Version: 2.2 +Version: 3.0 Release: 0 Summary: Library of matchers for building test expressions License: BSD-3-Clause @@ -27,9 +27,8 @@ URL: https://github.com/hamcrest/JavaHamcrest Source0: %{name}-%{version}.tar.xz Source1: %{name}-build.xml Source2: https://repo1.maven.org/maven2/org/hamcrest/%{name}/%{version}/%{name}-%{version}.pom -Source3: https://raw.githubusercontent.com/hamcrest/JavaHamcrest/v2.2/LICENSE.txt -Source4: https://raw.githubusercontent.com/hamcrest/JavaHamcrest/v2.2/README.md -Patch0: 0001-Fix-build-with-OpenJDK-11.patch +Source3: https://raw.githubusercontent.com/hamcrest/JavaHamcrest/v%{version}/LICENSE +Source4: https://raw.githubusercontent.com/hamcrest/JavaHamcrest/v%{version}/README.md BuildRequires: ant BuildRequires: fdupes BuildRequires: java-devel >= 1.8 @@ -60,8 +59,6 @@ Javadoc for %{name}. cp %{SOURCE1} build.xml cp %{SOURCE3} %{SOURCE4} . -%patch -P 0 -p2 - %build %{ant} \ %if %{without tests} @@ -89,11 +86,11 @@ cp -pr target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name} %files -f .mfiles %{_javadir}/%{name} -%license LICENSE.txt +%license LICENSE %doc README.md %files javadoc -%license LICENSE.txt +%license LICENSE %{_javadocdir}/%{name} %changelog