Compare commits

...

No commits in common. "c8s-stream-rhel8" and "c8-stream-201902" have entirely different histories.

3 changed files with 211 additions and 18 deletions

View File

@ -0,0 +1,108 @@
From 9507c7b942a25f89428c95abb0012d30aff0ca9b Mon Sep 17 00:00:00 2001
From: Marian Koncek <mkoncek@redhat.com>
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<T extends Throwable> extends
return stringWriter.toString();
}
- @Factory
public static <T extends Throwable> Matcher<T> isThrowable(
Matcher<T> throwableMatcher) {
return new StacktracePrintingMatcher<T>(throwableMatcher);
}
- @Factory
public static <T extends Exception> Matcher<T> isException(
Matcher<T> exceptionMatcher) {
return new StacktracePrintingMatcher<T>(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<T extends Throwable> extends
* @param matcher to apply to the cause of the outer exception
* @param <T> type of the outer exception
*/
- @Factory
public static <T extends Throwable> Matcher<T> hasCause(final Matcher<? extends Throwable> matcher) {
return new ThrowableCauseMatcher<T>(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<T extends Throwable> extends
matcher.describeMismatch(item.getMessage(), description);
}
- @Factory
public static <T extends Throwable> Matcher<T> hasMessage(final Matcher<String> matcher) {
return new ThrowableMessageMatcher<T>(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 <T> Matcher<Iterable<T>> everyItem(final Matcher<T> elementMatcher) {
+ public static <T> Matcher<Iterable<? extends T>> everyItem(final Matcher<T> 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<Iterable<Failure>> empty() {
+ private Matcher<Iterable<? extends Failure>> empty() {
return everyItem(nullValue(Failure.class));
}
}
--
2.21.0

View File

@ -0,0 +1,90 @@
From abb2895b7faf07817644e69e34701af6e88204e7 Mon Sep 17 00:00:00 2001
From: Marian Koncek <mkoncek@redhat.com>
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

View File

@ -1,7 +1,6 @@
Name: junit Name: junit
Epoch: 1
Version: 4.12 Version: 4.12
Release: 14%{?dist} Release: 11%{?dist}
Summary: Java regression test package Summary: Java regression test package
License: EPL-1.0 License: EPL-1.0
URL: http://www.junit.org/ URL: http://www.junit.org/
@ -11,12 +10,14 @@ BuildArch: noarch
Source0: %{name}-%{version}-clean.tar.gz Source0: %{name}-%{version}-clean.tar.gz
Source3: create-tarball.sh Source3: create-tarball.sh
Patch1: 0001-Port-to-hamcrest-2.1.patch
Patch2: 0002-Port-to-OpenJDK-11.patch
BuildRequires: maven-local BuildRequires: maven-local
BuildRequires: mvn(org.apache.felix:maven-bundle-plugin) BuildRequires: mvn(org.apache.felix:maven-bundle-plugin)
BuildRequires: mvn(org.apache.maven.plugins:maven-enforcer-plugin) BuildRequires: mvn(org.apache.maven.plugins:maven-enforcer-plugin)
BuildRequires: mvn(org.hamcrest:hamcrest-core) BuildRequires: mvn(org.hamcrest:hamcrest-core)
Obsoletes: %{name}-demo < 4.12
%description %description
JUnit is a regression testing framework written by Erich Gamma and Kent Beck. JUnit is a regression testing framework written by Erich Gamma and Kent Beck.
@ -39,6 +40,9 @@ Javadoc for %{name}.
%prep %prep
%setup -q -n %{name}-r%{version} %setup -q -n %{name}-r%{version}
%patch1 -p1
%patch2 -p1
# InaccessibleBaseClassTest fails with Java 8 # InaccessibleBaseClassTest fails with Java 8
sed -i /InaccessibleBaseClassTest/d src/test/java/org/junit/tests/AllTests.java sed -i /InaccessibleBaseClassTest/d src/test/java/org/junit/tests/AllTests.java
@ -70,7 +74,7 @@ sed s/@version@/%{version}/ src/main/java/junit/runner/Version.java.template >sr
%mvn_file : %{name} %mvn_file : %{name}
%build %build
%mvn_build %mvn_build -- -DjdkVersion=1.6
%install %install
%mvn_install %mvn_install
@ -86,20 +90,11 @@ sed s/@version@/%{version}/ src/main/java/junit/runner/Version.java.template >sr
%doc doc/* %doc doc/*
%changelog %changelog
* Fri Jul 10 2020 Jiri Vanek <jvanek@redhat.com> - 1:4.12-14 * Tue Nov 05 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.12-11
- Rebuilt for JDK-11, see https://fedoraproject.org/wiki/Changes/Java11 - Mass rebuild for javapackages-tools 201902
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.12-13 * Fri May 24 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 1:4.12-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild - Mass rebuild for javapackages-tools 201901
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.12-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.12-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.12-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Mon Jul 2 2018 Mikolaj Izdebski <mizdebsk@redhat.com> - 1:4.12-9 * Mon Jul 2 2018 Mikolaj Izdebski <mizdebsk@redhat.com> - 1:4.12-9
- Update license tag - Update license tag
@ -166,7 +161,7 @@ sed s/@version@/%{version}/ src/main/java/junit/runner/Version.java.template >sr
* Fri Jun 28 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 0:4.11-4 * Fri Jun 28 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 0:4.11-4
- Rebuild to regenerate API documentation - Rebuild to regenerate API documentation
- CVE-2013-1571 - Resolves: CVE-2013-1571
* Fri Jun 21 2013 Michal Srb <msrb@redhat.com> - 0:4.11-3 * Fri Jun 21 2013 Michal Srb <msrb@redhat.com> - 0:4.11-3
- Build from clean tarball - Build from clean tarball