Compare commits

...

No commits in common. 'c9' and 'i10cs' have entirely different histories.
c9 ... i10cs

2
.gitignore vendored

@ -1 +1 @@
SOURCES/junit-4.13.1.tar.gz
SOURCES/junit-4.13.2.tar.gz

@ -1 +1 @@
f076a21f66401bdd79263ba0e464c95018a2365d SOURCES/junit-4.13.1.tar.gz
11859a602e4f585adcb06a8d7ab76e4fa1125ba2 SOURCES/junit-4.13.2.tar.gz

@ -0,0 +1,143 @@
From e77b0978378999acd44ddf4b75476cc25c14c19e Mon Sep 17 00:00:00 2001
From: Marian Koncek <mkoncek@redhat.com>
Date: Wed, 21 Feb 2024 13:30:20 +0100
Subject: [PATCH 2/2] Port to OpenJDK 21
---
src/main/java/org/junit/runner/Result.java | 18 ++++++++++-----
.../runners/statements/FailOnTimeoutTest.java | 1 +
.../tests/running/core/AllCoreTests.java | 4 +---
.../tests/running/core/CommandLineTest.java | 1 +
.../junit/tests/running/core/MainRunner.java | 22 -------------------
5 files changed, 15 insertions(+), 31 deletions(-)
diff --git a/src/main/java/org/junit/runner/Result.java b/src/main/java/org/junit/runner/Result.java
index 4b5f4a4..abfe0fe 100644
--- a/src/main/java/org/junit/runner/Result.java
+++ b/src/main/java/org/junit/runner/Result.java
@@ -1,11 +1,13 @@
package org.junit.runner;
import java.io.IOException;
+import java.io.InvalidClassException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.ObjectStreamClass;
import java.io.ObjectStreamField;
import java.io.Serializable;
+import java.lang.ClassNotFoundException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -189,12 +191,16 @@ public class Result implements Serializable {
@SuppressWarnings("unchecked")
private SerializedForm(ObjectInputStream.GetField fields) throws IOException {
- fCount = (AtomicInteger) fields.get("fCount", null);
- fIgnoreCount = (AtomicInteger) fields.get("fIgnoreCount", null);
- assumptionFailureCount = (AtomicInteger) fields.get("assumptionFailureCount", null);
- fFailures = (List<Failure>) fields.get("fFailures", null);
- fRunTime = fields.get("fRunTime", 0L);
- fStartTime = fields.get("fStartTime", 0L);
+ try {
+ fCount = (AtomicInteger) fields.get("fCount", null);
+ fIgnoreCount = (AtomicInteger) fields.get("fIgnoreCount", null);
+ assumptionFailureCount = (AtomicInteger) fields.get("assumptionFailureCount", null);
+ fFailures = (List<Failure>) fields.get("fFailures", null);
+ fRunTime = fields.get("fRunTime", 0L);
+ fStartTime = fields.get("fStartTime", 0L);
+ } catch (ClassNotFoundException ex) {
+ throw new InvalidClassException("ClassNotFoundException", ex);
+ }
}
public void serialize(ObjectOutputStream s) throws IOException {
diff --git a/src/test/java/org/junit/internal/runners/statements/FailOnTimeoutTest.java b/src/test/java/org/junit/internal/runners/statements/FailOnTimeoutTest.java
index 8bf7823..cafbd18 100644
--- a/src/test/java/org/junit/internal/runners/statements/FailOnTimeoutTest.java
+++ b/src/test/java/org/junit/internal/runners/statements/FailOnTimeoutTest.java
@@ -182,6 +182,7 @@ public class FailOnTimeoutTest {
}
@Test
+ @org.junit.Ignore
public void lookingForStuckThread_threadGroupNotLeaked() throws Throwable {
assumeTrue(lookingForStuckThread);
final AtomicReference<ThreadGroup> innerThreadGroup = new AtomicReference<ThreadGroup>();
diff --git a/src/test/java/org/junit/tests/running/core/AllCoreTests.java b/src/test/java/org/junit/tests/running/core/AllCoreTests.java
index a17a7e2..1a65be5 100644
--- a/src/test/java/org/junit/tests/running/core/AllCoreTests.java
+++ b/src/test/java/org/junit/tests/running/core/AllCoreTests.java
@@ -6,9 +6,7 @@ import org.junit.runners.Suite.SuiteClasses;
@RunWith(Suite.class)
@SuiteClasses({
- CommandLineTest.class,
- JUnitCoreReturnsCorrectExitCodeTest.class,
- SystemExitTest.class
+ CommandLineTest.class
})
public class AllCoreTests {
}
diff --git a/src/test/java/org/junit/tests/running/core/CommandLineTest.java b/src/test/java/org/junit/tests/running/core/CommandLineTest.java
index 37f0659..7c82cba 100644
--- a/src/test/java/org/junit/tests/running/core/CommandLineTest.java
+++ b/src/test/java/org/junit/tests/running/core/CommandLineTest.java
@@ -36,6 +36,7 @@ public class CommandLineTest {
}
@Test
+ @org.junit.Ignore
public void runATest() {
testWasRun = false;
new MainRunner().runWithCheckForSystemExit(new Runnable() {
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 ea90886..91e5e4f 100644
--- a/src/test/java/org/junit/tests/running/core/MainRunner.java
+++ b/src/test/java/org/junit/tests/running/core/MainRunner.java
@@ -20,25 +20,6 @@ public class MainRunner {
}
}
- /**
- * A {@code NoExitSecurityManager} throws a {@link ExitException} exception
- * whenever {@link #checkExit(int)} is called; all other permissions are allowed.
- */
- public class NoExitSecurityManager extends SecurityManager {
-
- @Override
- public void checkExit(int status) {
- throw new ExitException(status);
- }
-
- @Override
- public void checkPermission(Permission perm) {
- if (perm.getName().startsWith("exitVM")) {
- super.checkPermission(perm);
- }
- }
- }
-
/**
* Execute runnable.run(), preventing System.exit(). If System.exit() is called
* in runnable.run(), the value is returned. If System.exit()
@@ -47,8 +28,6 @@ public class MainRunner {
* @return null if System.exit() is not called, Integer.valueof(status) if not
*/
public Integer runWithCheckForSystemExit(Runnable runnable) {
- SecurityManager oldSecurityManager = System.getSecurityManager();
- System.setSecurityManager(new NoExitSecurityManager());
PrintStream oldOut = System.out;
System.setOut(new PrintStream(new ByteArrayOutputStream()));
@@ -60,7 +39,6 @@ public class MainRunner {
System.out.println("System.exit() called, value=" + e.getStatus());
return e.getStatus();
} finally {
- System.setSecurityManager(oldSecurityManager);
System.setOut(oldOut);
}
}
--
2.43.0

@ -2,24 +2,25 @@
Name: junit
Epoch: 1
Version: 4.13.1
Version: 4.13.2
Release: 7%{?dist}
Summary: Java regression test package
License: EPL-1.0
URL: http://www.junit.org/
URL: https://junit.org/junit4/
BuildArch: noarch
ExclusiveArch: %{java_arches} noarch
# ./generate-tarball.sh
Source0: %{name}-%{version}.tar.gz
Source1: generate-tarball.sh
Patch1: 0001-Port-to-hamcrest-2.2.patch
Patch2: 0002-Port-to-OpenJDK-21.patch
BuildRequires: maven-local
%if %{with bootstrap}
BuildRequires: javapackages-bootstrap
%else
BuildRequires: mvn(org.apache.felix:maven-bundle-plugin)
BuildRequires: maven-local
BuildRequires: mvn(org.apache.maven.plugins:maven-enforcer-plugin)
BuildRequires: mvn(org.hamcrest:hamcrest-core)
%endif
@ -52,7 +53,8 @@ Javadoc for %{name}.
%prep
%setup -q -n junit4-r%{version}
%patch -P 1 -p1
%patch 1 -p1
%patch 2 -p1
# InaccessibleBaseClassTest fails with Java 8
sed -i /InaccessibleBaseClassTest/d src/test/java/org/junit/tests/AllTests.java
@ -65,27 +67,12 @@ sed s/@version@/%{version}/ src/main/java/junit/runner/Version.java.template >sr
# Removing hamcrest source jar references (not available and/or necessary)
%pom_remove_plugin :maven-javadoc-plugin
# Add proper Apache Felix Bundle Plugin instructions
# so that we get a reasonable OSGi manifest.
%pom_xpath_inject pom:project "<packaging>bundle</packaging>"
%pom_xpath_inject pom:build/pom:plugins "
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>org.junit</Bundle-SymbolicName>
<Export-Package>{local-packages},!org.hamcrest*,*;x-internal:=true</Export-Package>
<_nouses>true</_nouses>
</instructions>
</configuration>
</plugin>"
%mvn_file : %{name}
%mvn_alias junit:junit junit:junit-dep
%build
%mvn_build -- -DjdkVersion=1.6
%mvn_build -- -DjdkVersion=1.8 -P\!restrict-doclint
%install
%mvn_install
@ -102,21 +89,58 @@ sed s/@version@/%{version}/ src/main/java/junit/runner/Version.java.template >sr
%doc doc/*
%changelog
* Thu Nov 21 2024 Marián Konček <mkoncek@redhat.com> - 1:4.13.1-7
- Fix patch usage
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 1:4.13.2-7
- Bump release for October 2024 mass rebuild:
Resolves: RHEL-64018
* Fri Oct 25 2024 MSVSphere Packaging Team <packager@msvsphere-os.ru> - 1:4.13.2-6
- Rebuilt for MSVSphere 10
* Mon Aug 05 2024 Mikolaj Izdebski <mizdebsk@redhat.com> - 1:4.13.2-6
- Port to OpenJDK 21
- Resolves: RHEL-52712
* Thu Aug 01 2024 Troy Dawson <tdawson@redhat.com> - 1:4.13.2-6
- Bump release for Aug 2024 java mass rebuild
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 1:4.13.2-5
- Bump release for June 2024 mass rebuild
* Wed Jan 24 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.13.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sat Jan 20 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.13.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.13.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Tue Apr 25 2023 Chris Kelley <ckelley@redhat.com> - 4.13.2-1
- Update to upstream version 4.13.2
* Thu Feb 16 2023 Marian Koncek <mkoncek@redhat.com> - 1:4.13.1-11
- Change packaging to jar instead of bundle
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.13.1-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.13.1-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Sat Feb 05 2022 Jiri Vanek <jvanek@redhat.com> - 1:4.13.1-7
- Rebuilt for java-17-openjdk as system jdk
* Tue Nov 19 2024 Marián Konček <mkoncek@redhat.com> - 1:4.13.1-6
- Rebuild with regenerated Requires on Java
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.13.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 1:4.13.1-5
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Tue Nov 02 2021 Mikolaj Izdebski <mizdebsk@redhat.com> - 1:4.13.1-5
- Bump Java compiler source/target levels to 1.7
* Wed Jun 09 2021 Mikolaj Izdebski <mizdebsk@redhat.com> - 1:4.13.1-4
- Rebuild to workaround DistroBaker issue
* Wed Sep 15 2021 Didik Supriadi <didiksupriadi41@gmail.com> - 1:4.13.1-4
- Add alias for junit-dep
* Tue Jun 08 2021 Mikolaj Izdebski <mizdebsk@redhat.com> - 1:4.13.1-3
- Bootstrap Maven for CentOS Stream 9
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.13.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Mon May 17 2021 Mikolaj Izdebski <mizdebsk@redhat.com> - 1:4.13.1-2
- Bootstrap build

Loading…
Cancel
Save