From c9cef20a482b1832ba713287616ffc3eecd26ed0 Mon Sep 17 00:00:00 2001 From: Marian Koncek Date: Thu, 31 Oct 2019 12:17:16 +0100 Subject: [PATCH] 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