From d2fe58e62eb8f8b2935eadb519714eb9c4c1f996 Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Thu, 29 Nov 2018 12:06:43 +0000 Subject: [PATCH 01/16] Switch to SHA512 sources --- sources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources b/sources index d77668d..f586a0c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -0de14594aaba3379f6b19ba75a393232 junit-4.12-clean.tar.gz +SHA512 (junit-4.12-clean.tar.gz) = d25fc547aa8fd961a33e5104da899be924047dbe150bfe8cd1677648173f7bcab82b0562718fc8ec2138323b786bb6c66e749f96701871d8f1d8984dee52c2de From b322d34ffbc716faf2b50ecb59e1a38e7379aa78 Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Thu, 29 Nov 2018 12:55:39 +0000 Subject: [PATCH 02/16] Remove Obsoletes --- junit.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/junit.spec b/junit.spec index 79e8de6..5e99856 100644 --- a/junit.spec +++ b/junit.spec @@ -16,7 +16,6 @@ BuildRequires: mvn(org.apache.felix:maven-bundle-plugin) BuildRequires: mvn(org.apache.maven.plugins:maven-enforcer-plugin) BuildRequires: mvn(org.hamcrest:hamcrest-core) -Obsoletes: %{name}-demo < 4.12 %description JUnit is a regression testing framework written by Erich Gamma and Kent Beck. From 7632bdc5663c65c29fe877519bea634f5eb15792 Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Fri, 24 May 2019 17:00:54 +0200 Subject: [PATCH 03/16] Mass rebuild for javapackages-tools 201901 --- junit.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/junit.spec b/junit.spec index 5e99856..5e15f6e 100644 --- a/junit.spec +++ b/junit.spec @@ -1,7 +1,7 @@ Name: junit Epoch: 1 Version: 4.12 -Release: 9%{?dist} +Release: 10%{?dist} Summary: Java regression test package License: EPL-1.0 URL: http://www.junit.org/ @@ -85,6 +85,9 @@ sed s/@version@/%{version}/ src/main/java/junit/runner/Version.java.template >sr %doc doc/* %changelog +* Fri May 24 2019 Mikolaj Izdebski - 1:4.12-10 +- Mass rebuild for javapackages-tools 201901 + * Mon Jul 2 2018 Mikolaj Izdebski - 1:4.12-9 - Update license tag From 82f045811c0404b6e17f2db6c1dba24922eb4bb1 Mon Sep 17 00:00:00 2001 From: Marian Koncek Date: Thu, 29 Aug 2019 12:50:26 +0200 Subject: [PATCH 04/16] Port to hamcrest 2.1 --- 0001-Port-to-hamcrest-2.1.patch | 108 ++++++++++++++++++++++++++++++++ junit.spec | 4 ++ 2 files changed, 112 insertions(+) create mode 100644 0001-Port-to-hamcrest-2.1.patch diff --git a/0001-Port-to-hamcrest-2.1.patch b/0001-Port-to-hamcrest-2.1.patch new file mode 100644 index 0000000..16b864a --- /dev/null +++ b/0001-Port-to-hamcrest-2.1.patch @@ -0,0 +1,108 @@ +From 9507c7b942a25f89428c95abb0012d30aff0ca9b Mon Sep 17 00:00:00 2001 +From: Marian Koncek +Date: Thu, 29 Aug 2019 12:48:20 +0200 +Subject: [PATCH] Port to hamcrest 2.1 + +--- + .../org/junit/internal/matchers/StacktracePrintingMatcher.java | 3 --- + .../org/junit/internal/matchers/ThrowableCauseMatcher.java | 2 -- + .../org/junit/internal/matchers/ThrowableMessageMatcher.java | 2 -- + src/main/java/org/junit/matchers/JUnitMatchers.java | 2 +- + .../experimental/theories/runner/WithDataPointMethod.java | 2 +- + 5 files changed, 2 insertions(+), 9 deletions(-) + +diff --git a/src/main/java/org/junit/internal/matchers/StacktracePrintingMatcher.java b/src/main/java/org/junit/internal/matchers/StacktracePrintingMatcher.java +index 5d45ba3..6e94a67 100644 +--- a/src/main/java/org/junit/internal/matchers/StacktracePrintingMatcher.java ++++ b/src/main/java/org/junit/internal/matchers/StacktracePrintingMatcher.java +@@ -4,7 +4,6 @@ import java.io.PrintWriter; + import java.io.StringWriter; + + import org.hamcrest.Description; +-import org.hamcrest.Factory; + import org.hamcrest.Matcher; + + /** +@@ -42,13 +41,11 @@ public class StacktracePrintingMatcher extends + return stringWriter.toString(); + } + +- @Factory + public static Matcher isThrowable( + Matcher throwableMatcher) { + return new StacktracePrintingMatcher(throwableMatcher); + } + +- @Factory + public static Matcher isException( + Matcher exceptionMatcher) { + return new StacktracePrintingMatcher(exceptionMatcher); +diff --git a/src/main/java/org/junit/internal/matchers/ThrowableCauseMatcher.java b/src/main/java/org/junit/internal/matchers/ThrowableCauseMatcher.java +index 22ce8bd..4fa89e7 100644 +--- a/src/main/java/org/junit/internal/matchers/ThrowableCauseMatcher.java ++++ b/src/main/java/org/junit/internal/matchers/ThrowableCauseMatcher.java +@@ -1,7 +1,6 @@ + package org.junit.internal.matchers; + + import org.hamcrest.Description; +-import org.hamcrest.Factory; + import org.hamcrest.Matcher; + import org.hamcrest.TypeSafeMatcher; + +@@ -43,7 +42,6 @@ public class ThrowableCauseMatcher extends + * @param matcher to apply to the cause of the outer exception + * @param type of the outer exception + */ +- @Factory + public static Matcher hasCause(final Matcher matcher) { + return new ThrowableCauseMatcher(matcher); + } +diff --git a/src/main/java/org/junit/internal/matchers/ThrowableMessageMatcher.java b/src/main/java/org/junit/internal/matchers/ThrowableMessageMatcher.java +index 74386a8..7d16b11 100644 +--- a/src/main/java/org/junit/internal/matchers/ThrowableMessageMatcher.java ++++ b/src/main/java/org/junit/internal/matchers/ThrowableMessageMatcher.java +@@ -1,7 +1,6 @@ + package org.junit.internal.matchers; + + import org.hamcrest.Description; +-import org.hamcrest.Factory; + import org.hamcrest.Matcher; + import org.hamcrest.TypeSafeMatcher; + +@@ -30,7 +29,6 @@ public class ThrowableMessageMatcher extends + matcher.describeMismatch(item.getMessage(), description); + } + +- @Factory + public static Matcher hasMessage(final Matcher matcher) { + return new ThrowableMessageMatcher(matcher); + } +diff --git a/src/main/java/org/junit/matchers/JUnitMatchers.java b/src/main/java/org/junit/matchers/JUnitMatchers.java +index 13407cc..8889266 100644 +--- a/src/main/java/org/junit/matchers/JUnitMatchers.java ++++ b/src/main/java/org/junit/matchers/JUnitMatchers.java +@@ -56,7 +56,7 @@ public class JUnitMatchers { + * @deprecated Please use {@link CoreMatchers#everyItem(Matcher)} instead. + */ + @Deprecated +- public static Matcher> everyItem(final Matcher elementMatcher) { ++ public static Matcher> everyItem(final Matcher elementMatcher) { + return CoreMatchers.everyItem(elementMatcher); + } + +diff --git a/src/test/java/org/junit/tests/experimental/theories/runner/WithDataPointMethod.java b/src/test/java/org/junit/tests/experimental/theories/runner/WithDataPointMethod.java +index c814508..ce22ef4 100644 +--- a/src/test/java/org/junit/tests/experimental/theories/runner/WithDataPointMethod.java ++++ b/src/test/java/org/junit/tests/experimental/theories/runner/WithDataPointMethod.java +@@ -108,7 +108,7 @@ public class WithDataPointMethod { + return JUnitCore.runClasses(type).getFailures(); + } + +- private Matcher> empty() { ++ private Matcher> empty() { + return everyItem(nullValue(Failure.class)); + } + } +-- +2.21.0 + diff --git a/junit.spec b/junit.spec index 5e15f6e..5fd85d5 100644 --- a/junit.spec +++ b/junit.spec @@ -11,6 +11,8 @@ BuildArch: noarch Source0: %{name}-%{version}-clean.tar.gz Source3: create-tarball.sh +Patch1: 0001-Port-to-hamcrest-2.1.patch + BuildRequires: maven-local BuildRequires: mvn(org.apache.felix:maven-bundle-plugin) BuildRequires: mvn(org.apache.maven.plugins:maven-enforcer-plugin) @@ -38,6 +40,8 @@ Javadoc for %{name}. %prep %setup -q -n %{name}-r%{version} +%patch1 -p1 + # InaccessibleBaseClassTest fails with Java 8 sed -i /InaccessibleBaseClassTest/d src/test/java/org/junit/tests/AllTests.java From 47fb9150a3d86e9f7abc4259bc33ca9c477f3a43 Mon Sep 17 00:00:00 2001 From: Marian Koncek Date: Tue, 24 Sep 2019 11:20:09 +0200 Subject: [PATCH 05/16] Remove Epoch --- junit.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/junit.spec b/junit.spec index 5fd85d5..b82ac09 100644 --- a/junit.spec +++ b/junit.spec @@ -1,5 +1,4 @@ Name: junit -Epoch: 1 Version: 4.12 Release: 10%{?dist} Summary: Java regression test package From 9a59ab0198798c29b630e8663b608f32939aa5ea Mon Sep 17 00:00:00 2001 From: Marian Koncek Date: Tue, 24 Sep 2019 11:54:23 +0200 Subject: [PATCH 06/16] Update to upstream version 4.13~beta.1 --- .gitignore | 1 + 0001-Port-to-hamcrest-2.1.patch | 41 ++++++++++++++++++--------------- create-tarball.sh | 22 ------------------ generate-tarball.sh | 23 ++++++++++++++++++ junit.spec | 15 +++++++----- sources | 2 +- 6 files changed, 56 insertions(+), 48 deletions(-) delete mode 100755 create-tarball.sh create mode 100755 generate-tarball.sh diff --git a/.gitignore b/.gitignore index ecd44ef..3a4dd0c 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ junit3.8.2.zip /r4.11.tar.gz /junit-4.11-clean.tar.gz /junit-4.12-clean.tar.gz +/junit-4.13~beta.1.tar.gz diff --git a/0001-Port-to-hamcrest-2.1.patch b/0001-Port-to-hamcrest-2.1.patch index 16b864a..bc1fd0c 100644 --- a/0001-Port-to-hamcrest-2.1.patch +++ b/0001-Port-to-hamcrest-2.1.patch @@ -1,30 +1,30 @@ -From 9507c7b942a25f89428c95abb0012d30aff0ca9b Mon Sep 17 00:00:00 2001 +From e2d59e5707cdcb011cb8390dadbba7bbe7f64ece Mon Sep 17 00:00:00 2001 From: Marian Koncek -Date: Thu, 29 Aug 2019 12:48:20 +0200 +Date: Tue, 24 Sep 2019 11:38:29 +0200 Subject: [PATCH] Port to hamcrest 2.1 --- - .../org/junit/internal/matchers/StacktracePrintingMatcher.java | 3 --- - .../org/junit/internal/matchers/ThrowableCauseMatcher.java | 2 -- - .../org/junit/internal/matchers/ThrowableMessageMatcher.java | 2 -- - src/main/java/org/junit/matchers/JUnitMatchers.java | 2 +- - .../experimental/theories/runner/WithDataPointMethod.java | 2 +- - 5 files changed, 2 insertions(+), 9 deletions(-) + .../junit/internal/matchers/StacktracePrintingMatcher.java | 3 --- + .../org/junit/internal/matchers/ThrowableCauseMatcher.java | 4 +--- + .../org/junit/internal/matchers/ThrowableMessageMatcher.java | 2 -- + src/main/java/org/junit/matchers/JUnitMatchers.java | 2 +- + .../experimental/theories/runner/WithDataPointMethod.java | 2 +- + 5 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/main/java/org/junit/internal/matchers/StacktracePrintingMatcher.java b/src/main/java/org/junit/internal/matchers/StacktracePrintingMatcher.java -index 5d45ba3..6e94a67 100644 +index 9e9505d..45dc4f1 100644 --- a/src/main/java/org/junit/internal/matchers/StacktracePrintingMatcher.java +++ b/src/main/java/org/junit/internal/matchers/StacktracePrintingMatcher.java -@@ -4,7 +4,6 @@ import java.io.PrintWriter; - import java.io.StringWriter; +@@ -1,7 +1,6 @@ + package org.junit.internal.matchers; import org.hamcrest.Description; -import org.hamcrest.Factory; import org.hamcrest.Matcher; - /** -@@ -42,13 +41,11 @@ public class StacktracePrintingMatcher extends - return stringWriter.toString(); + import org.junit.internal.Throwables; +@@ -43,13 +42,11 @@ public class StacktracePrintingMatcher extends + return Throwables.getStacktrace(throwable); } - @Factory @@ -38,7 +38,7 @@ index 5d45ba3..6e94a67 100644 Matcher exceptionMatcher) { return new StacktracePrintingMatcher(exceptionMatcher); diff --git a/src/main/java/org/junit/internal/matchers/ThrowableCauseMatcher.java b/src/main/java/org/junit/internal/matchers/ThrowableCauseMatcher.java -index 22ce8bd..4fa89e7 100644 +index a8d9cef..a3611b4 100644 --- a/src/main/java/org/junit/internal/matchers/ThrowableCauseMatcher.java +++ b/src/main/java/org/junit/internal/matchers/ThrowableCauseMatcher.java @@ -1,7 +1,6 @@ @@ -49,14 +49,17 @@ index 22ce8bd..4fa89e7 100644 import org.hamcrest.Matcher; import org.hamcrest.TypeSafeMatcher; -@@ -43,7 +42,6 @@ public class ThrowableCauseMatcher extends +@@ -45,8 +44,7 @@ public class ThrowableCauseMatcher extends * @param matcher to apply to the cause of the outer exception * @param type of the outer exception */ - @Factory - public static Matcher hasCause(final Matcher matcher) { + public static Matcher hasCause(final Matcher matcher) { return new ThrowableCauseMatcher(matcher); } +-} +\ No newline at end of file ++} diff --git a/src/main/java/org/junit/internal/matchers/ThrowableMessageMatcher.java b/src/main/java/org/junit/internal/matchers/ThrowableMessageMatcher.java index 74386a8..7d16b11 100644 --- a/src/main/java/org/junit/internal/matchers/ThrowableMessageMatcher.java @@ -78,10 +81,10 @@ index 74386a8..7d16b11 100644 return new ThrowableMessageMatcher(matcher); } diff --git a/src/main/java/org/junit/matchers/JUnitMatchers.java b/src/main/java/org/junit/matchers/JUnitMatchers.java -index 13407cc..8889266 100644 +index 47897c5..8ae4dcd 100644 --- a/src/main/java/org/junit/matchers/JUnitMatchers.java +++ b/src/main/java/org/junit/matchers/JUnitMatchers.java -@@ -56,7 +56,7 @@ public class JUnitMatchers { +@@ -58,7 +58,7 @@ public class JUnitMatchers { * @deprecated Please use {@link CoreMatchers#everyItem(Matcher)} instead. */ @Deprecated diff --git a/create-tarball.sh b/create-tarball.sh deleted file mode 100755 index 1594760..0000000 --- a/create-tarball.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -if [ $# -ne 1 ]; then - echo "Usage: ./create-tarball.sh VERSION" - exit 1 -fi - -VERSION=${1} -NAME="junit" - -wget https://github.com/${NAME}-team/${NAME}/archive/r${VERSION}.tar.gz -tar xvf r${VERSION}.tar.gz - -( - cd ${NAME}-r${VERSION} - find . -name "*.jar" -delete - find . -name "*.class" -delete -) - -tar czvf ${NAME}-${VERSION}-clean.tar.gz ${NAME}-r${VERSION} -rm -Rf ${NAME}-${VERSION}.tar.gz - diff --git a/generate-tarball.sh b/generate-tarball.sh new file mode 100755 index 0000000..019c640 --- /dev/null +++ b/generate-tarball.sh @@ -0,0 +1,23 @@ +#!/bin/bash +set -e + +name=junit +version="$(sed -n 's/Version:\s*//p' *.spec)" +upstream_version="$(echo ${version} | echo ${version} | sed 's/~\|\(alpha\.\|beta\)\./\1-/g')" + +# RETRIEVE +wget "https://github.com/${name}-team/${name}/archive/r${upstream_version}.tar.gz" + +rm -rf tarball-tmp +mkdir tarball-tmp +pushd tarball-tmp +tar xf "../r${upstream_version}.tar.gz" +mv * ${name}-${version} + +# CLEAN TARBALL +find -name '*.jar' -delete +find -name '*.class' -delete + +tar czf "../${name}-${version}.tar.gz" * +popd +rm -r tarball-tmp "r${upstream_version}.tar.gz" diff --git a/junit.spec b/junit.spec index b82ac09..7ef3574 100644 --- a/junit.spec +++ b/junit.spec @@ -1,14 +1,14 @@ Name: junit -Version: 4.12 -Release: 10%{?dist} +Version: 4.13~beta.1 +Release: 1%{?dist} Summary: Java regression test package License: EPL-1.0 URL: http://www.junit.org/ BuildArch: noarch -# ./clean-tarball.sh %{version} -Source0: %{name}-%{version}-clean.tar.gz -Source3: create-tarball.sh +# ./generate-tarball.sh +Source0: %{name}-%{version}.tar.gz +Source3: ./generate-tarball.sh Patch1: 0001-Port-to-hamcrest-2.1.patch @@ -37,7 +37,7 @@ Summary: Javadoc for %{name} Javadoc for %{name}. %prep -%setup -q -n %{name}-r%{version} +%setup -q %patch1 -p1 @@ -88,6 +88,9 @@ sed s/@version@/%{version}/ src/main/java/junit/runner/Version.java.template >sr %doc doc/* %changelog +* Tue Sep 24 2019 Marian Koncek - 4.13~beta.1-1 +- Update to upstream version 4.13~beta.1 + * Fri May 24 2019 Mikolaj Izdebski - 1:4.12-10 - Mass rebuild for javapackages-tools 201901 diff --git a/sources b/sources index f586a0c..c0cdbe0 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (junit-4.12-clean.tar.gz) = d25fc547aa8fd961a33e5104da899be924047dbe150bfe8cd1677648173f7bcab82b0562718fc8ec2138323b786bb6c66e749f96701871d8f1d8984dee52c2de +SHA512 (junit-4.13~beta.1.tar.gz) = 7ae7c85077dfd3fd0ba0084317f628654f5f9352d3680033746e061f07aae0a8720d38b83782059a7f93d63cc54a0af73323aa9b30d11e223e5c5f8d34b8e67f From 35ba4685daab0c3c739652e366b3386c1bafed16 Mon Sep 17 00:00:00 2001 From: Marian Koncek Date: Tue, 24 Sep 2019 13:08:31 +0200 Subject: [PATCH 07/16] Revert "Update to upstream version 4.13~beta.1" This reverts commit 9a59ab0198798c29b630e8663b608f32939aa5ea. reason: breaks mockito tests --- .gitignore | 1 - 0001-Port-to-hamcrest-2.1.patch | 41 +++++++++++++++------------------ create-tarball.sh | 22 ++++++++++++++++++ generate-tarball.sh | 23 ------------------ junit.spec | 15 +++++------- sources | 2 +- 6 files changed, 48 insertions(+), 56 deletions(-) create mode 100755 create-tarball.sh delete mode 100755 generate-tarball.sh diff --git a/.gitignore b/.gitignore index 3a4dd0c..ecd44ef 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,3 @@ junit3.8.2.zip /r4.11.tar.gz /junit-4.11-clean.tar.gz /junit-4.12-clean.tar.gz -/junit-4.13~beta.1.tar.gz diff --git a/0001-Port-to-hamcrest-2.1.patch b/0001-Port-to-hamcrest-2.1.patch index bc1fd0c..16b864a 100644 --- a/0001-Port-to-hamcrest-2.1.patch +++ b/0001-Port-to-hamcrest-2.1.patch @@ -1,30 +1,30 @@ -From e2d59e5707cdcb011cb8390dadbba7bbe7f64ece Mon Sep 17 00:00:00 2001 +From 9507c7b942a25f89428c95abb0012d30aff0ca9b Mon Sep 17 00:00:00 2001 From: Marian Koncek -Date: Tue, 24 Sep 2019 11:38:29 +0200 +Date: Thu, 29 Aug 2019 12:48:20 +0200 Subject: [PATCH] Port to hamcrest 2.1 --- - .../junit/internal/matchers/StacktracePrintingMatcher.java | 3 --- - .../org/junit/internal/matchers/ThrowableCauseMatcher.java | 4 +--- - .../org/junit/internal/matchers/ThrowableMessageMatcher.java | 2 -- - src/main/java/org/junit/matchers/JUnitMatchers.java | 2 +- - .../experimental/theories/runner/WithDataPointMethod.java | 2 +- - 5 files changed, 3 insertions(+), 10 deletions(-) + .../org/junit/internal/matchers/StacktracePrintingMatcher.java | 3 --- + .../org/junit/internal/matchers/ThrowableCauseMatcher.java | 2 -- + .../org/junit/internal/matchers/ThrowableMessageMatcher.java | 2 -- + src/main/java/org/junit/matchers/JUnitMatchers.java | 2 +- + .../experimental/theories/runner/WithDataPointMethod.java | 2 +- + 5 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/main/java/org/junit/internal/matchers/StacktracePrintingMatcher.java b/src/main/java/org/junit/internal/matchers/StacktracePrintingMatcher.java -index 9e9505d..45dc4f1 100644 +index 5d45ba3..6e94a67 100644 --- a/src/main/java/org/junit/internal/matchers/StacktracePrintingMatcher.java +++ b/src/main/java/org/junit/internal/matchers/StacktracePrintingMatcher.java -@@ -1,7 +1,6 @@ - package org.junit.internal.matchers; +@@ -4,7 +4,6 @@ import java.io.PrintWriter; + import java.io.StringWriter; import org.hamcrest.Description; -import org.hamcrest.Factory; import org.hamcrest.Matcher; - import org.junit.internal.Throwables; -@@ -43,13 +42,11 @@ public class StacktracePrintingMatcher extends - return Throwables.getStacktrace(throwable); + /** +@@ -42,13 +41,11 @@ public class StacktracePrintingMatcher extends + return stringWriter.toString(); } - @Factory @@ -38,7 +38,7 @@ index 9e9505d..45dc4f1 100644 Matcher exceptionMatcher) { return new StacktracePrintingMatcher(exceptionMatcher); diff --git a/src/main/java/org/junit/internal/matchers/ThrowableCauseMatcher.java b/src/main/java/org/junit/internal/matchers/ThrowableCauseMatcher.java -index a8d9cef..a3611b4 100644 +index 22ce8bd..4fa89e7 100644 --- a/src/main/java/org/junit/internal/matchers/ThrowableCauseMatcher.java +++ b/src/main/java/org/junit/internal/matchers/ThrowableCauseMatcher.java @@ -1,7 +1,6 @@ @@ -49,17 +49,14 @@ index a8d9cef..a3611b4 100644 import org.hamcrest.Matcher; import org.hamcrest.TypeSafeMatcher; -@@ -45,8 +44,7 @@ public class ThrowableCauseMatcher extends +@@ -43,7 +42,6 @@ public class ThrowableCauseMatcher extends * @param matcher to apply to the cause of the outer exception * @param type of the outer exception */ - @Factory - public static Matcher hasCause(final Matcher matcher) { + public static Matcher hasCause(final Matcher matcher) { return new ThrowableCauseMatcher(matcher); } --} -\ No newline at end of file -+} diff --git a/src/main/java/org/junit/internal/matchers/ThrowableMessageMatcher.java b/src/main/java/org/junit/internal/matchers/ThrowableMessageMatcher.java index 74386a8..7d16b11 100644 --- a/src/main/java/org/junit/internal/matchers/ThrowableMessageMatcher.java @@ -81,10 +78,10 @@ index 74386a8..7d16b11 100644 return new ThrowableMessageMatcher(matcher); } diff --git a/src/main/java/org/junit/matchers/JUnitMatchers.java b/src/main/java/org/junit/matchers/JUnitMatchers.java -index 47897c5..8ae4dcd 100644 +index 13407cc..8889266 100644 --- a/src/main/java/org/junit/matchers/JUnitMatchers.java +++ b/src/main/java/org/junit/matchers/JUnitMatchers.java -@@ -58,7 +58,7 @@ public class JUnitMatchers { +@@ -56,7 +56,7 @@ public class JUnitMatchers { * @deprecated Please use {@link CoreMatchers#everyItem(Matcher)} instead. */ @Deprecated diff --git a/create-tarball.sh b/create-tarball.sh new file mode 100755 index 0000000..1594760 --- /dev/null +++ b/create-tarball.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +if [ $# -ne 1 ]; then + echo "Usage: ./create-tarball.sh VERSION" + exit 1 +fi + +VERSION=${1} +NAME="junit" + +wget https://github.com/${NAME}-team/${NAME}/archive/r${VERSION}.tar.gz +tar xvf r${VERSION}.tar.gz + +( + cd ${NAME}-r${VERSION} + find . -name "*.jar" -delete + find . -name "*.class" -delete +) + +tar czvf ${NAME}-${VERSION}-clean.tar.gz ${NAME}-r${VERSION} +rm -Rf ${NAME}-${VERSION}.tar.gz + diff --git a/generate-tarball.sh b/generate-tarball.sh deleted file mode 100755 index 019c640..0000000 --- a/generate-tarball.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -set -e - -name=junit -version="$(sed -n 's/Version:\s*//p' *.spec)" -upstream_version="$(echo ${version} | echo ${version} | sed 's/~\|\(alpha\.\|beta\)\./\1-/g')" - -# RETRIEVE -wget "https://github.com/${name}-team/${name}/archive/r${upstream_version}.tar.gz" - -rm -rf tarball-tmp -mkdir tarball-tmp -pushd tarball-tmp -tar xf "../r${upstream_version}.tar.gz" -mv * ${name}-${version} - -# CLEAN TARBALL -find -name '*.jar' -delete -find -name '*.class' -delete - -tar czf "../${name}-${version}.tar.gz" * -popd -rm -r tarball-tmp "r${upstream_version}.tar.gz" diff --git a/junit.spec b/junit.spec index 7ef3574..b82ac09 100644 --- a/junit.spec +++ b/junit.spec @@ -1,14 +1,14 @@ Name: junit -Version: 4.13~beta.1 -Release: 1%{?dist} +Version: 4.12 +Release: 10%{?dist} Summary: Java regression test package License: EPL-1.0 URL: http://www.junit.org/ BuildArch: noarch -# ./generate-tarball.sh -Source0: %{name}-%{version}.tar.gz -Source3: ./generate-tarball.sh +# ./clean-tarball.sh %{version} +Source0: %{name}-%{version}-clean.tar.gz +Source3: create-tarball.sh Patch1: 0001-Port-to-hamcrest-2.1.patch @@ -37,7 +37,7 @@ Summary: Javadoc for %{name} Javadoc for %{name}. %prep -%setup -q +%setup -q -n %{name}-r%{version} %patch1 -p1 @@ -88,9 +88,6 @@ sed s/@version@/%{version}/ src/main/java/junit/runner/Version.java.template >sr %doc doc/* %changelog -* Tue Sep 24 2019 Marian Koncek - 4.13~beta.1-1 -- Update to upstream version 4.13~beta.1 - * Fri May 24 2019 Mikolaj Izdebski - 1:4.12-10 - Mass rebuild for javapackages-tools 201901 diff --git a/sources b/sources index c0cdbe0..f586a0c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (junit-4.13~beta.1.tar.gz) = 7ae7c85077dfd3fd0ba0084317f628654f5f9352d3680033746e061f07aae0a8720d38b83782059a7f93d63cc54a0af73323aa9b30d11e223e5c5f8d34b8e67f +SHA512 (junit-4.12-clean.tar.gz) = d25fc547aa8fd961a33e5104da899be924047dbe150bfe8cd1677648173f7bcab82b0562718fc8ec2138323b786bb6c66e749f96701871d8f1d8984dee52c2de From edd08b97a561d800b2e10d1f7589cfb3fe3b337a Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Mon, 28 Oct 2019 15:00:31 +0100 Subject: [PATCH 08/16] Set compiler source/target levels to 1.6 --- junit.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/junit.spec b/junit.spec index b82ac09..c28cbbe 100644 --- a/junit.spec +++ b/junit.spec @@ -72,7 +72,7 @@ sed s/@version@/%{version}/ src/main/java/junit/runner/Version.java.template >sr %mvn_file : %{name} %build -%mvn_build +%mvn_build -- -DjdkVersion=1.6 %install %mvn_install From c9cef20a482b1832ba713287616ffc3eecd26ed0 Mon Sep 17 00:00:00 2001 From: Marian Koncek Date: Thu, 31 Oct 2019 12:17:16 +0100 Subject: [PATCH 09/16] Port to OpenJDK 11 --- 0002-Port-to-OpenJDK-11.patch | 90 +++++++++++++++++++++++++++++++++++ junit.spec | 2 + 2 files changed, 92 insertions(+) create mode 100644 0002-Port-to-OpenJDK-11.patch diff --git a/0002-Port-to-OpenJDK-11.patch b/0002-Port-to-OpenJDK-11.patch new file mode 100644 index 0000000..d251373 --- /dev/null +++ b/0002-Port-to-OpenJDK-11.patch @@ -0,0 +1,90 @@ +From abb2895b7faf07817644e69e34701af6e88204e7 Mon Sep 17 00:00:00 2001 +From: Marian Koncek +Date: Wed, 30 Oct 2019 17:16:11 +0100 +Subject: [PATCH] Port to OpenJDK 11 + +--- + .../junit/runners/model/TestClassTest.java | 3 ++ + .../junit/tests/running/core/MainRunner.java | 31 ------------------- + 2 files changed, 3 insertions(+), 31 deletions(-) + +diff --git a/src/test/java/org/junit/runners/model/TestClassTest.java b/src/test/java/org/junit/runners/model/TestClassTest.java +index 7682968..810de25 100644 +--- a/src/test/java/org/junit/runners/model/TestClassTest.java ++++ b/src/test/java/org/junit/runners/model/TestClassTest.java +@@ -135,6 +135,9 @@ public class TestClassTest { + } + } + ++ /// The class Object starting from JDK9 has its own annotations ++ /// which causes this test to fail ++ @Ignore + @Test + public void providesAnnotatedMethodsSortedByName() { + TestClass tc = new TestClass(MethodsAnnotated.class); +diff --git a/src/test/java/org/junit/tests/running/core/MainRunner.java b/src/test/java/org/junit/tests/running/core/MainRunner.java +index 31f01e8..076a212 100644 +--- a/src/test/java/org/junit/tests/running/core/MainRunner.java ++++ b/src/test/java/org/junit/tests/running/core/MainRunner.java +@@ -39,11 +39,6 @@ public class MainRunner { + throw new ExitException(status); + } + +- @Override +- public boolean getInCheck() { +- return (originalSecurityManager != null) && originalSecurityManager.getInCheck(); +- } +- + @Override + public Object getSecurityContext() { + return (originalSecurityManager == null) ? super.getSecurityContext() : originalSecurityManager.getSecurityContext(); +@@ -196,11 +191,6 @@ public class MainRunner { + } + } + +- @Override +- public boolean checkTopLevelWindow(Object window) { +- return (originalSecurityManager == null) ? super.checkTopLevelWindow(window) : originalSecurityManager.checkTopLevelWindow(window); +- } +- + @Override + public void checkPrintJobAccess() { + if (originalSecurityManager != null) { +@@ -208,20 +198,6 @@ public class MainRunner { + } + } + +- @Override +- public void checkSystemClipboardAccess() { +- if (originalSecurityManager != null) { +- originalSecurityManager.checkSystemClipboardAccess(); +- } +- } +- +- @Override +- public void checkAwtEventQueueAccess() { +- if (originalSecurityManager != null) { +- originalSecurityManager.checkAwtEventQueueAccess(); +- } +- } +- + @Override + public void checkPackageAccess(String pkg) { + if (originalSecurityManager != null) { +@@ -243,13 +219,6 @@ public class MainRunner { + } + } + +- @Override +- public void checkMemberAccess(Class clazz, int which) { +- if (originalSecurityManager != null) { +- originalSecurityManager.checkMemberAccess(clazz, which); +- } +- } +- + @Override + public void checkSecurityAccess(String target) { + if (originalSecurityManager != null) { +-- +2.21.0 + diff --git a/junit.spec b/junit.spec index c28cbbe..d53084b 100644 --- a/junit.spec +++ b/junit.spec @@ -11,6 +11,7 @@ Source0: %{name}-%{version}-clean.tar.gz Source3: create-tarball.sh Patch1: 0001-Port-to-hamcrest-2.1.patch +Patch2: 0002-Port-to-OpenJDK-11.patch BuildRequires: maven-local BuildRequires: mvn(org.apache.felix:maven-bundle-plugin) @@ -40,6 +41,7 @@ Javadoc for %{name}. %setup -q -n %{name}-r%{version} %patch1 -p1 +%patch2 -p1 # InaccessibleBaseClassTest fails with Java 8 sed -i /InaccessibleBaseClassTest/d src/test/java/org/junit/tests/AllTests.java From d0f7b6e6de9d59874c9f7c5e470d6c43718b1f18 Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Tue, 5 Nov 2019 17:29:28 +0100 Subject: [PATCH 10/16] Mass rebuild for javapackages-tools 201902 --- junit.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/junit.spec b/junit.spec index d53084b..d7c4372 100644 --- a/junit.spec +++ b/junit.spec @@ -1,6 +1,6 @@ Name: junit Version: 4.12 -Release: 10%{?dist} +Release: 11%{?dist} Summary: Java regression test package License: EPL-1.0 URL: http://www.junit.org/ @@ -90,6 +90,9 @@ sed s/@version@/%{version}/ src/main/java/junit/runner/Version.java.template >sr %doc doc/* %changelog +* Tue Nov 05 2019 Mikolaj Izdebski - 4.12-11 +- Mass rebuild for javapackages-tools 201902 + * Fri May 24 2019 Mikolaj Izdebski - 1:4.12-10 - Mass rebuild for javapackages-tools 201901 From 0ba92bfe809f7baba5c28ec9bda7e733030fcee2 Mon Sep 17 00:00:00 2001 From: Marian Koncek Date: Fri, 6 Mar 2020 14:49:34 +0100 Subject: [PATCH 11/16] Update to upstream version 4.13 --- .gitignore | 1 + 0001-Port-to-hamcrest-2.1.patch | 83 +++--------------------------- 0002-Port-to-OpenJDK-11.patch | 90 --------------------------------- create-tarball.sh | 22 -------- generate-tarball.sh | 22 ++++++++ junit.spec | 22 ++++---- sources | 2 +- 7 files changed, 44 insertions(+), 198 deletions(-) delete mode 100644 0002-Port-to-OpenJDK-11.patch delete mode 100755 create-tarball.sh create mode 100755 generate-tarball.sh diff --git a/.gitignore b/.gitignore index ecd44ef..78c1bba 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ junit3.8.2.zip /r4.11.tar.gz /junit-4.11-clean.tar.gz /junit-4.12-clean.tar.gz +/junit-4.13.tar.gz diff --git a/0001-Port-to-hamcrest-2.1.patch b/0001-Port-to-hamcrest-2.1.patch index 16b864a..015a7ee 100644 --- a/0001-Port-to-hamcrest-2.1.patch +++ b/0001-Port-to-hamcrest-2.1.patch @@ -1,82 +1,13 @@ -From 9507c7b942a25f89428c95abb0012d30aff0ca9b Mon Sep 17 00:00:00 2001 +From 41302698f39a6bda58e634a786ce2a6c290eadba Mon Sep 17 00:00:00 2001 From: Marian Koncek -Date: Thu, 29 Aug 2019 12:48:20 +0200 +Date: Fri, 6 Mar 2020 14:28:05 +0100 Subject: [PATCH] Port to hamcrest 2.1 --- - .../org/junit/internal/matchers/StacktracePrintingMatcher.java | 3 --- - .../org/junit/internal/matchers/ThrowableCauseMatcher.java | 2 -- - .../org/junit/internal/matchers/ThrowableMessageMatcher.java | 2 -- - src/main/java/org/junit/matchers/JUnitMatchers.java | 2 +- - .../experimental/theories/runner/WithDataPointMethod.java | 2 +- - 5 files changed, 2 insertions(+), 9 deletions(-) + src/main/java/org/junit/matchers/JUnitMatchers.java | 2 +- + .../tests/experimental/theories/runner/WithDataPointMethod.java | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) -diff --git a/src/main/java/org/junit/internal/matchers/StacktracePrintingMatcher.java b/src/main/java/org/junit/internal/matchers/StacktracePrintingMatcher.java -index 5d45ba3..6e94a67 100644 ---- a/src/main/java/org/junit/internal/matchers/StacktracePrintingMatcher.java -+++ b/src/main/java/org/junit/internal/matchers/StacktracePrintingMatcher.java -@@ -4,7 +4,6 @@ import java.io.PrintWriter; - import java.io.StringWriter; - - import org.hamcrest.Description; --import org.hamcrest.Factory; - import org.hamcrest.Matcher; - - /** -@@ -42,13 +41,11 @@ public class StacktracePrintingMatcher extends - return stringWriter.toString(); - } - -- @Factory - public static Matcher isThrowable( - Matcher throwableMatcher) { - return new StacktracePrintingMatcher(throwableMatcher); - } - -- @Factory - public static Matcher isException( - Matcher exceptionMatcher) { - return new StacktracePrintingMatcher(exceptionMatcher); -diff --git a/src/main/java/org/junit/internal/matchers/ThrowableCauseMatcher.java b/src/main/java/org/junit/internal/matchers/ThrowableCauseMatcher.java -index 22ce8bd..4fa89e7 100644 ---- a/src/main/java/org/junit/internal/matchers/ThrowableCauseMatcher.java -+++ b/src/main/java/org/junit/internal/matchers/ThrowableCauseMatcher.java -@@ -1,7 +1,6 @@ - package org.junit.internal.matchers; - - import org.hamcrest.Description; --import org.hamcrest.Factory; - import org.hamcrest.Matcher; - import org.hamcrest.TypeSafeMatcher; - -@@ -43,7 +42,6 @@ public class ThrowableCauseMatcher extends - * @param matcher to apply to the cause of the outer exception - * @param type of the outer exception - */ -- @Factory - public static Matcher hasCause(final Matcher matcher) { - return new ThrowableCauseMatcher(matcher); - } -diff --git a/src/main/java/org/junit/internal/matchers/ThrowableMessageMatcher.java b/src/main/java/org/junit/internal/matchers/ThrowableMessageMatcher.java -index 74386a8..7d16b11 100644 ---- a/src/main/java/org/junit/internal/matchers/ThrowableMessageMatcher.java -+++ b/src/main/java/org/junit/internal/matchers/ThrowableMessageMatcher.java -@@ -1,7 +1,6 @@ - package org.junit.internal.matchers; - - import org.hamcrest.Description; --import org.hamcrest.Factory; - import org.hamcrest.Matcher; - import org.hamcrest.TypeSafeMatcher; - -@@ -30,7 +29,6 @@ public class ThrowableMessageMatcher extends - matcher.describeMismatch(item.getMessage(), description); - } - -- @Factory - public static Matcher hasMessage(final Matcher matcher) { - return new ThrowableMessageMatcher(matcher); - } diff --git a/src/main/java/org/junit/matchers/JUnitMatchers.java b/src/main/java/org/junit/matchers/JUnitMatchers.java index 13407cc..8889266 100644 --- a/src/main/java/org/junit/matchers/JUnitMatchers.java @@ -91,7 +22,7 @@ index 13407cc..8889266 100644 } diff --git a/src/test/java/org/junit/tests/experimental/theories/runner/WithDataPointMethod.java b/src/test/java/org/junit/tests/experimental/theories/runner/WithDataPointMethod.java -index c814508..ce22ef4 100644 +index f2b2753..e5759ed 100644 --- a/src/test/java/org/junit/tests/experimental/theories/runner/WithDataPointMethod.java +++ b/src/test/java/org/junit/tests/experimental/theories/runner/WithDataPointMethod.java @@ -108,7 +108,7 @@ public class WithDataPointMethod { @@ -104,5 +35,5 @@ index c814508..ce22ef4 100644 } } -- -2.21.0 +2.24.1 diff --git a/0002-Port-to-OpenJDK-11.patch b/0002-Port-to-OpenJDK-11.patch deleted file mode 100644 index d251373..0000000 --- a/0002-Port-to-OpenJDK-11.patch +++ /dev/null @@ -1,90 +0,0 @@ -From abb2895b7faf07817644e69e34701af6e88204e7 Mon Sep 17 00:00:00 2001 -From: Marian Koncek -Date: Wed, 30 Oct 2019 17:16:11 +0100 -Subject: [PATCH] Port to OpenJDK 11 - ---- - .../junit/runners/model/TestClassTest.java | 3 ++ - .../junit/tests/running/core/MainRunner.java | 31 ------------------- - 2 files changed, 3 insertions(+), 31 deletions(-) - -diff --git a/src/test/java/org/junit/runners/model/TestClassTest.java b/src/test/java/org/junit/runners/model/TestClassTest.java -index 7682968..810de25 100644 ---- a/src/test/java/org/junit/runners/model/TestClassTest.java -+++ b/src/test/java/org/junit/runners/model/TestClassTest.java -@@ -135,6 +135,9 @@ public class TestClassTest { - } - } - -+ /// The class Object starting from JDK9 has its own annotations -+ /// which causes this test to fail -+ @Ignore - @Test - public void providesAnnotatedMethodsSortedByName() { - TestClass tc = new TestClass(MethodsAnnotated.class); -diff --git a/src/test/java/org/junit/tests/running/core/MainRunner.java b/src/test/java/org/junit/tests/running/core/MainRunner.java -index 31f01e8..076a212 100644 ---- a/src/test/java/org/junit/tests/running/core/MainRunner.java -+++ b/src/test/java/org/junit/tests/running/core/MainRunner.java -@@ -39,11 +39,6 @@ public class MainRunner { - throw new ExitException(status); - } - -- @Override -- public boolean getInCheck() { -- return (originalSecurityManager != null) && originalSecurityManager.getInCheck(); -- } -- - @Override - public Object getSecurityContext() { - return (originalSecurityManager == null) ? super.getSecurityContext() : originalSecurityManager.getSecurityContext(); -@@ -196,11 +191,6 @@ public class MainRunner { - } - } - -- @Override -- public boolean checkTopLevelWindow(Object window) { -- return (originalSecurityManager == null) ? super.checkTopLevelWindow(window) : originalSecurityManager.checkTopLevelWindow(window); -- } -- - @Override - public void checkPrintJobAccess() { - if (originalSecurityManager != null) { -@@ -208,20 +198,6 @@ public class MainRunner { - } - } - -- @Override -- public void checkSystemClipboardAccess() { -- if (originalSecurityManager != null) { -- originalSecurityManager.checkSystemClipboardAccess(); -- } -- } -- -- @Override -- public void checkAwtEventQueueAccess() { -- if (originalSecurityManager != null) { -- originalSecurityManager.checkAwtEventQueueAccess(); -- } -- } -- - @Override - public void checkPackageAccess(String pkg) { - if (originalSecurityManager != null) { -@@ -243,13 +219,6 @@ public class MainRunner { - } - } - -- @Override -- public void checkMemberAccess(Class clazz, int which) { -- if (originalSecurityManager != null) { -- originalSecurityManager.checkMemberAccess(clazz, which); -- } -- } -- - @Override - public void checkSecurityAccess(String target) { - if (originalSecurityManager != null) { --- -2.21.0 - diff --git a/create-tarball.sh b/create-tarball.sh deleted file mode 100755 index 1594760..0000000 --- a/create-tarball.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -if [ $# -ne 1 ]; then - echo "Usage: ./create-tarball.sh VERSION" - exit 1 -fi - -VERSION=${1} -NAME="junit" - -wget https://github.com/${NAME}-team/${NAME}/archive/r${VERSION}.tar.gz -tar xvf r${VERSION}.tar.gz - -( - cd ${NAME}-r${VERSION} - find . -name "*.jar" -delete - find . -name "*.class" -delete -) - -tar czvf ${NAME}-${VERSION}-clean.tar.gz ${NAME}-r${VERSION} -rm -Rf ${NAME}-${VERSION}.tar.gz - diff --git a/generate-tarball.sh b/generate-tarball.sh new file mode 100755 index 0000000..76a4605 --- /dev/null +++ b/generate-tarball.sh @@ -0,0 +1,22 @@ +#!/bin/bash +set -e + +name=junit +version="$(sed -n 's/Version:\s*//p' *.spec)" + +# RETRIEVE +wget "https://github.com/junit-team/junit/archive/r${version}.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 +find -name '*.jar' -delete +find -name '*.class' -delete +rm -r "junit4-r${version}/src/site" + +tar -czf "../${name}-${version}.tar.gz" * +popd +rm -r tarball-tmp "${name}-${version}.orig.tar.gz" diff --git a/junit.spec b/junit.spec index d7c4372..75269cf 100644 --- a/junit.spec +++ b/junit.spec @@ -1,24 +1,22 @@ Name: junit -Version: 4.12 -Release: 11%{?dist} +Version: 4.13 +Release: 1%{?dist} Summary: Java regression test package License: EPL-1.0 URL: http://www.junit.org/ BuildArch: noarch -# ./clean-tarball.sh %{version} -Source0: %{name}-%{version}-clean.tar.gz -Source3: create-tarball.sh +# ./generate-tarball.sh +Source0: %{name}-%{version}.tar.gz +Source1: generate-tarball.sh Patch1: 0001-Port-to-hamcrest-2.1.patch -Patch2: 0002-Port-to-OpenJDK-11.patch BuildRequires: maven-local BuildRequires: mvn(org.apache.felix:maven-bundle-plugin) BuildRequires: mvn(org.apache.maven.plugins:maven-enforcer-plugin) BuildRequires: mvn(org.hamcrest:hamcrest-core) - %description JUnit is a regression testing framework written by Erich Gamma and Kent Beck. It is used by the developer who implements unit tests in Java. JUnit is Open @@ -38,10 +36,13 @@ Summary: Javadoc for %{name} Javadoc for %{name}. %prep -%setup -q -n %{name}-r%{version} +%setup -q -n junit4-r%{version} %patch1 -p1 -%patch2 -p1 + +# Port to hamcrest 2.1 (Factory annotation removed with no effect) +find -name '*.java' -exec sed -i '/@Factory/d' {} + +find -name '*.java' -exec sed -i '/hamcrest\.Factory/d' {} + # InaccessibleBaseClassTest fails with Java 8 sed -i /InaccessibleBaseClassTest/d src/test/java/org/junit/tests/AllTests.java @@ -90,6 +91,9 @@ sed s/@version@/%{version}/ src/main/java/junit/runner/Version.java.template >sr %doc doc/* %changelog +* Fri Mar 06 2020 Marian Koncek - 4.13-1 +- Update to upstream version 4.13 + * Tue Nov 05 2019 Mikolaj Izdebski - 4.12-11 - Mass rebuild for javapackages-tools 201902 diff --git a/sources b/sources index f586a0c..b0927fa 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (junit-4.12-clean.tar.gz) = d25fc547aa8fd961a33e5104da899be924047dbe150bfe8cd1677648173f7bcab82b0562718fc8ec2138323b786bb6c66e749f96701871d8f1d8984dee52c2de +SHA512 (junit-4.13.tar.gz) = 6cafdeed70435c1928767fbb3327a7c9e6d6869703c10696e404e6f1c3ececa3ef0c09bad50585c28f6b1ca5b17affcaa29e207b1d20e257e7f332d5fc3554bc From 88b304df04dd2f537378c2bcef651d74c818a136 Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Wed, 22 Apr 2020 11:27:19 +0200 Subject: [PATCH 12/16] Rework hamcrest 2.2 patch --- 0001-Port-to-hamcrest-2.1.patch | 39 ------------ 0001-Port-to-hamcrest-2.2.patch | 108 ++++++++++++++++++++++++++++++++ junit.spec | 6 +- 3 files changed, 109 insertions(+), 44 deletions(-) delete mode 100644 0001-Port-to-hamcrest-2.1.patch create mode 100644 0001-Port-to-hamcrest-2.2.patch diff --git a/0001-Port-to-hamcrest-2.1.patch b/0001-Port-to-hamcrest-2.1.patch deleted file mode 100644 index 015a7ee..0000000 --- a/0001-Port-to-hamcrest-2.1.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 41302698f39a6bda58e634a786ce2a6c290eadba Mon Sep 17 00:00:00 2001 -From: Marian Koncek -Date: Fri, 6 Mar 2020 14:28:05 +0100 -Subject: [PATCH] Port to hamcrest 2.1 - ---- - src/main/java/org/junit/matchers/JUnitMatchers.java | 2 +- - .../tests/experimental/theories/runner/WithDataPointMethod.java | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/main/java/org/junit/matchers/JUnitMatchers.java b/src/main/java/org/junit/matchers/JUnitMatchers.java -index 13407cc..8889266 100644 ---- a/src/main/java/org/junit/matchers/JUnitMatchers.java -+++ b/src/main/java/org/junit/matchers/JUnitMatchers.java -@@ -56,7 +56,7 @@ public class JUnitMatchers { - * @deprecated Please use {@link CoreMatchers#everyItem(Matcher)} instead. - */ - @Deprecated -- public static Matcher> everyItem(final Matcher elementMatcher) { -+ public static Matcher> everyItem(final Matcher elementMatcher) { - return CoreMatchers.everyItem(elementMatcher); - } - -diff --git a/src/test/java/org/junit/tests/experimental/theories/runner/WithDataPointMethod.java b/src/test/java/org/junit/tests/experimental/theories/runner/WithDataPointMethod.java -index f2b2753..e5759ed 100644 ---- a/src/test/java/org/junit/tests/experimental/theories/runner/WithDataPointMethod.java -+++ b/src/test/java/org/junit/tests/experimental/theories/runner/WithDataPointMethod.java -@@ -108,7 +108,7 @@ public class WithDataPointMethod { - return JUnitCore.runClasses(type).getFailures(); - } - -- private Matcher> empty() { -+ private Matcher> empty() { - return everyItem(nullValue(Failure.class)); - } - } --- -2.24.1 - diff --git a/0001-Port-to-hamcrest-2.2.patch b/0001-Port-to-hamcrest-2.2.patch new file mode 100644 index 0000000..0d51ef4 --- /dev/null +++ b/0001-Port-to-hamcrest-2.2.patch @@ -0,0 +1,108 @@ +From 85c780b61cd35b4544d2926393805e1699641f38 Mon Sep 17 00:00:00 2001 +From: Marian Koncek +Date: Fri, 6 Mar 2020 14:28:05 +0100 +Subject: [PATCH] Port to hamcrest 2.2 + +--- + .../org/junit/internal/matchers/StacktracePrintingMatcher.java | 3 --- + .../org/junit/internal/matchers/ThrowableCauseMatcher.java | 2 -- + .../org/junit/internal/matchers/ThrowableMessageMatcher.java | 2 -- + src/main/java/org/junit/matchers/JUnitMatchers.java | 2 +- + .../experimental/theories/runner/WithDataPointMethod.java | 2 +- + 5 files changed, 2 insertions(+), 9 deletions(-) + +diff --git a/src/main/java/org/junit/internal/matchers/StacktracePrintingMatcher.java b/src/main/java/org/junit/internal/matchers/StacktracePrintingMatcher.java +index 93a6827..3ea4a81 100644 +--- a/src/main/java/org/junit/internal/matchers/StacktracePrintingMatcher.java ++++ b/src/main/java/org/junit/internal/matchers/StacktracePrintingMatcher.java +@@ -1,7 +1,6 @@ + package org.junit.internal.matchers; + + import org.hamcrest.Description; +-import org.hamcrest.Factory; + import org.hamcrest.Matcher; + + import org.junit.internal.Throwables; +@@ -39,13 +38,11 @@ public class StacktracePrintingMatcher extends + return Throwables.getStacktrace(throwable); + } + +- @Factory + public static Matcher isThrowable( + Matcher throwableMatcher) { + return new StacktracePrintingMatcher(throwableMatcher); + } + +- @Factory + public static Matcher isException( + Matcher exceptionMatcher) { + return new StacktracePrintingMatcher(exceptionMatcher); +diff --git a/src/main/java/org/junit/internal/matchers/ThrowableCauseMatcher.java b/src/main/java/org/junit/internal/matchers/ThrowableCauseMatcher.java +index 6e2ff5e..1f0a0a0 100644 +--- a/src/main/java/org/junit/internal/matchers/ThrowableCauseMatcher.java ++++ b/src/main/java/org/junit/internal/matchers/ThrowableCauseMatcher.java +@@ -1,7 +1,6 @@ + package org.junit.internal.matchers; + + import org.hamcrest.Description; +-import org.hamcrest.Factory; + import org.hamcrest.Matcher; + import org.hamcrest.TypeSafeMatcher; + +@@ -43,7 +42,6 @@ public class ThrowableCauseMatcher extends + * @param matcher to apply to the cause of the outer exception + * @param type of the outer exception + */ +- @Factory + public static Matcher hasCause(final Matcher matcher) { + return new ThrowableCauseMatcher(matcher); + } +diff --git a/src/main/java/org/junit/internal/matchers/ThrowableMessageMatcher.java b/src/main/java/org/junit/internal/matchers/ThrowableMessageMatcher.java +index 74386a8..7d16b11 100644 +--- a/src/main/java/org/junit/internal/matchers/ThrowableMessageMatcher.java ++++ b/src/main/java/org/junit/internal/matchers/ThrowableMessageMatcher.java +@@ -1,7 +1,6 @@ + package org.junit.internal.matchers; + + import org.hamcrest.Description; +-import org.hamcrest.Factory; + import org.hamcrest.Matcher; + import org.hamcrest.TypeSafeMatcher; + +@@ -30,7 +29,6 @@ public class ThrowableMessageMatcher extends + matcher.describeMismatch(item.getMessage(), description); + } + +- @Factory + public static Matcher hasMessage(final Matcher matcher) { + return new ThrowableMessageMatcher(matcher); + } +diff --git a/src/main/java/org/junit/matchers/JUnitMatchers.java b/src/main/java/org/junit/matchers/JUnitMatchers.java +index 13407cc..8889266 100644 +--- a/src/main/java/org/junit/matchers/JUnitMatchers.java ++++ b/src/main/java/org/junit/matchers/JUnitMatchers.java +@@ -56,7 +56,7 @@ public class JUnitMatchers { + * @deprecated Please use {@link CoreMatchers#everyItem(Matcher)} instead. + */ + @Deprecated +- public static Matcher> everyItem(final Matcher elementMatcher) { ++ public static Matcher> everyItem(final Matcher elementMatcher) { + return CoreMatchers.everyItem(elementMatcher); + } + +diff --git a/src/test/java/org/junit/tests/experimental/theories/runner/WithDataPointMethod.java b/src/test/java/org/junit/tests/experimental/theories/runner/WithDataPointMethod.java +index f2b2753..e5759ed 100644 +--- a/src/test/java/org/junit/tests/experimental/theories/runner/WithDataPointMethod.java ++++ b/src/test/java/org/junit/tests/experimental/theories/runner/WithDataPointMethod.java +@@ -108,7 +108,7 @@ public class WithDataPointMethod { + return JUnitCore.runClasses(type).getFailures(); + } + +- private Matcher> empty() { ++ private Matcher> empty() { + return everyItem(nullValue(Failure.class)); + } + } +-- +2.25.2 + diff --git a/junit.spec b/junit.spec index 75269cf..b070b0c 100644 --- a/junit.spec +++ b/junit.spec @@ -10,7 +10,7 @@ BuildArch: noarch Source0: %{name}-%{version}.tar.gz Source1: generate-tarball.sh -Patch1: 0001-Port-to-hamcrest-2.1.patch +Patch1: 0001-Port-to-hamcrest-2.2.patch BuildRequires: maven-local BuildRequires: mvn(org.apache.felix:maven-bundle-plugin) @@ -40,10 +40,6 @@ Javadoc for %{name}. %patch1 -p1 -# Port to hamcrest 2.1 (Factory annotation removed with no effect) -find -name '*.java' -exec sed -i '/@Factory/d' {} + -find -name '*.java' -exec sed -i '/hamcrest\.Factory/d' {} + - # InaccessibleBaseClassTest fails with Java 8 sed -i /InaccessibleBaseClassTest/d src/test/java/org/junit/tests/AllTests.java From 618bce49235f51f34a8336c1095e8c15c4448b63 Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Mon, 20 Jul 2020 14:12:17 +0200 Subject: [PATCH 13/16] Add BR on surefire-junit4 --- junit.spec | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/junit.spec b/junit.spec index b070b0c..9c9c478 100644 --- a/junit.spec +++ b/junit.spec @@ -17,6 +17,11 @@ BuildRequires: mvn(org.apache.felix:maven-bundle-plugin) BuildRequires: mvn(org.apache.maven.plugins:maven-enforcer-plugin) BuildRequires: mvn(org.hamcrest:hamcrest-core) +# For other packages, surefire-junit4 is normally pulled as transitive +# runtime dependency of junit, but junit doesn't build-depend on +# itself, so explicit BR on surefire-junit4 is needed. +BuildRequires: mvn(org.apache.maven.surefire:surefire-junit4) + %description JUnit is a regression testing framework written by Erich Gamma and Kent Beck. It is used by the developer who implements unit tests in Java. JUnit is Open From d1002df10688196fca68bdc67ecf2ff38543ad2d Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Fri, 4 Dec 2020 12:53:26 +0100 Subject: [PATCH 14/16] Update to upstream version 4.13.1 --- .gitignore | 1 + junit.spec | 5 ++++- sources | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 78c1bba..b5d208d 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ junit3.8.2.zip /junit-4.11-clean.tar.gz /junit-4.12-clean.tar.gz /junit-4.13.tar.gz +/junit-4.13.1.tar.gz diff --git a/junit.spec b/junit.spec index 9c9c478..236af75 100644 --- a/junit.spec +++ b/junit.spec @@ -1,5 +1,5 @@ Name: junit -Version: 4.13 +Version: 4.13.1 Release: 1%{?dist} Summary: Java regression test package License: EPL-1.0 @@ -92,6 +92,9 @@ sed s/@version@/%{version}/ src/main/java/junit/runner/Version.java.template >sr %doc doc/* %changelog +* Fri Dec 4 2020 Mikolaj Izdebski - 4.13.1-1 +- Update to upstream version 4.13.1 + * Fri Mar 06 2020 Marian Koncek - 4.13-1 - Update to upstream version 4.13 diff --git a/sources b/sources index b0927fa..4064fda 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (junit-4.13.tar.gz) = 6cafdeed70435c1928767fbb3327a7c9e6d6869703c10696e404e6f1c3ececa3ef0c09bad50585c28f6b1ca5b17affcaa29e207b1d20e257e7f332d5fc3554bc +SHA512 (junit-4.13.1.tar.gz) = 53eb0ab9278bb792b8e5f7978d3d47f52d6e94898fbf77286f7d4836cdb78aac4f0db111c146373e2591feb9c8600193d09c146a6befa56029c06324e444ecfc From 83b6c85acad2b8a45dbb5b10e61df375b1f303bb Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Fri, 16 Apr 2021 15:33:12 +0200 Subject: [PATCH 15/16] Conditionalize buildrequires in bootstrap mode --- junit.spec | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/junit.spec b/junit.spec index 236af75..2703dc2 100644 --- a/junit.spec +++ b/junit.spec @@ -1,3 +1,5 @@ +%bcond_without bootstrap + Name: junit Version: 4.13.1 Release: 1%{?dist} @@ -13,14 +15,20 @@ Source1: generate-tarball.sh Patch1: 0001-Port-to-hamcrest-2.2.patch BuildRequires: maven-local +%if %{with bootstrap} +BuildRequires: javapackages-bootstrap +%else BuildRequires: mvn(org.apache.felix:maven-bundle-plugin) BuildRequires: mvn(org.apache.maven.plugins:maven-enforcer-plugin) BuildRequires: mvn(org.hamcrest:hamcrest-core) +%endif # For other packages, surefire-junit4 is normally pulled as transitive # runtime dependency of junit, but junit doesn't build-depend on # itself, so explicit BR on surefire-junit4 is needed. +%if %{without bootstrap} BuildRequires: mvn(org.apache.maven.surefire:surefire-junit4) +%endif %description JUnit is a regression testing framework written by Erich Gamma and Kent Beck. From bac7df55951558a6ba3d31b41b1e14eccca4f046 Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Thu, 13 May 2021 19:08:42 +0200 Subject: [PATCH 16/16] Turn off bootstrap mode by default --- junit.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/junit.spec b/junit.spec index 2703dc2..5461390 100644 --- a/junit.spec +++ b/junit.spec @@ -1,4 +1,4 @@ -%bcond_without bootstrap +%bcond_with bootstrap Name: junit Version: 4.13.1