From 4ca3ef27c03599582020e00085b0dba9f8f86e8c1368d4f7b72a3afc96672298 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Fri, 3 May 2024 14:08:10 +0200 Subject: [PATCH] Sync from SUSE:SLFO:Main junit revision 0c68396a9c92542bea9b9790c95c7d37 --- .gitattributes | 23 ++ 0001-Port-to-hamcrest-2.2.patch | 108 +++++++++ build.xml | 394 ++++++++++++++++++++++++++++++++ junit.changes | 192 ++++++++++++++++ junit.spec | 130 +++++++++++ r4.13.2.tar.gz | 3 + 6 files changed, 850 insertions(+) create mode 100644 .gitattributes create mode 100644 0001-Port-to-hamcrest-2.2.patch create mode 100644 build.xml create mode 100644 junit.changes create mode 100644 junit.spec create mode 100644 r4.13.2.tar.gz diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/0001-Port-to-hamcrest-2.2.patch b/0001-Port-to-hamcrest-2.2.patch new file mode 100644 index 0000000..ea5b5f2 --- /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/build.xml b/build.xml new file mode 100644 index 0000000..46971d5 --- /dev/null +++ b/build.xml @@ -0,0 +1,394 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/junit.changes b/junit.changes new file mode 100644 index 0000000..81e3596 --- /dev/null +++ b/junit.changes @@ -0,0 +1,192 @@ +------------------------------------------------------------------- +Thu Sep 21 07:53:02 UTC 2023 - Fridrich Strba + +- Let ant build with --release 8 if the compiler knows that option. + This allows us to avoid incompatible exception declarations + in ObjectInputStream.GetField.get(String,Object) in java >= 20 + +------------------------------------------------------------------- +Thu Mar 23 17:18:10 UTC 2023 - Fridrich Strba + +- Conditionalize the spec file so that junit can be built with + both hamcrest 1.3 and 2.2 from the same sources + +------------------------------------------------------------------- +Thu Jun 9 18:02:17 UTC 2022 - Fridrich Strba + +- Added patch: + * 0001-Port-to-hamcrest-2.2.patch + + do not use the org.hamcrest.Factory that was removed in + hamcrest 2.x and should have been an internal annotation + only + + fix some incompatibilities with template types in matchers + +------------------------------------------------------------------- +Fri Mar 18 16:38:08 UTC 2022 - Fridrich Strba + +- Build with source/target levels 8 + +------------------------------------------------------------------- +Sun Dec 12 12:57:43 UTC 2021 - Dirk Müller + +- update to 4.13.2: + * Mark ThreadGroups created by FailOnTimeout as daemon groups + * Only create ThreadGroups if FailOnTimeout.lookForStuckThread is true. + * Fix NotSerializableException with AssumptionViolatedException + * Security fix: TemporaryFolder now limits access to temporary folders on + Java 1.7 or later (CVE-2020-1945, bsc#1171696) + * Make FrameworkField constructor public + +------------------------------------------------------------------- +Tue Apr 7 12:20:17 UTC 2020 - Fridrich Strba + +- Upgrade to 4.13 +- Removed patches: + * junit-jdk10.patch + * junit-jdk11.patch + + not needed with this version + +------------------------------------------------------------------- +Mon Feb 4 17:16:22 UTC 2019 - Fridrich Strba + +- Add OSGi manifest to the jar file +- Package the manual +- BuildRequire and Require hamcrest-core, since the package does + strictly depend on hamcrest-core only. + +------------------------------------------------------------------- +Mon Jan 21 23:36:15 UTC 2019 - Jan Engelhardt + +- Trim repeated metadata from description. + +------------------------------------------------------------------- +Wed Dec 26 06:27:56 UTC 2018 - Fridrich Strba + +- Upgrade to 4.12 +- Removed patches: + * junit-jdk8.patch + * junit-jdk9.patch + * junit-no-hamcrest-src.patch + + Integrated directly in the added build.xml file + +------------------------------------------------------------------- +Wed Jul 11 14:52:48 UTC 2018 - fstrba@suse.com + +- Added patch: + * junit-jdk11.patch + + Fix build with jdk11 + + Don't override removed SecurityManager methods + +------------------------------------------------------------------- +Mon Dec 18 15:40:52 UTC 2017 - fstrba@suse.com + +- Run fdupes on documentation + +------------------------------------------------------------------- +Mon Dec 18 15:35:28 UTC 2017 - dimstar@opensuse.org + +- Harden and fix the test suite: + + org.framework.junit is deprecated since junit 4.0 + + Ensure we fail check when junit no longer returns what we + expect it to (error code checking is useless, since Assert + returns !0, like any other failure to start the test). + +------------------------------------------------------------------- +Mon Dec 18 09:34:48 UTC 2017 - fstrba@suse.com + +- Added patch: + * junit-jdk10.patch + + Remove a function getInCheck from NoExitSecurityManager, + since it does not exist in the extended class in jdk10 and is + deprecated in previous versions + +------------------------------------------------------------------- +Fri Sep 8 08:42:24 UTC 2017 - fstrba@suse.com + +- Added patch: + * junit-jdk9.patch + + Build with java source and target levels 1.6 in order to + allow building with jdk9 + +------------------------------------------------------------------- +Fri May 19 10:03:43 UTC 2017 - dziolkowski@suse.com + +- New build dependency: javapackages-local + +------------------------------------------------------------------- +Tue Jul 28 07:53:29 UTC 2015 - tchvatal@suse.com + +- Add patch to build with jdk8: + * junit-jdk8.patch + +------------------------------------------------------------------- +Wed Mar 18 09:46:15 UTC 2015 - tchvatal@suse.com + +- Fix build with new javapackages-tools + +------------------------------------------------------------------- +Fri Oct 25 07:39:22 UTC 2013 - mvyskocil@suse.com + +- Update to 4.11 + * Matchers: Upgrade to Hamcrest 1.3 + no longer included junit jar + * Parameterized Tests + * Specify Test execution order + * New maven artifact 'junit:junit' w/o builtin hamcrest + * Number of improvements into Rules +- Drop jdk7-testfailure.patch, fixed upstream +- Add junit-no-hamcrest-src.patch, don't bundle hamcrest into junit.jar +- Use SourceUrl for release tarball and pom +- Don't inject OSGI manifest, it breaks junit.jar +- Provide/obsolete package junit4 + +------------------------------------------------------------------- +Fri Aug 23 09:35:53 UTC 2013 - mvyskocil@suse.com + +- disable javadoc build + +------------------------------------------------------------------- +Thu Sep 11 16:14:37 CEST 2008 - mvyskocil@suse.cz + +- Use gcc-java for build +- Update 3.8.2 (a new build.xml) +- Removed a java14compat +- Removed javadoc postin/postun +- Add a cpl-v10.html + +------------------------------------------------------------------- +Fri Mar 30 01:45:59 CEST 2007 - ro@suse.de + +- added unzip to buildreq + +------------------------------------------------------------------- +Tue Sep 26 15:24:14 CEST 2006 - skh@suse.de + +- don't use icecream +- use source="1.4" and target="1.4" for build with java 1.5 + +------------------------------------------------------------------- +Wed Jan 25 21:46:48 CET 2006 - mls@suse.de + +- converted neededforbuild to BuildRequires + +------------------------------------------------------------------- +Thu Jul 28 15:35:11 CEST 2005 - jsmeix@suse.de + +- Adjustments in the spec file. + +------------------------------------------------------------------- +Mon Jul 18 16:45:22 CEST 2005 - jsmeix@suse.de + +- Current version 3.8.1 from JPackage.org + +------------------------------------------------------------------- +Thu Sep 16 15:05:57 CEST 2004 - skh@suse.de + +- Fix prerequires of javadoc subpackage + +------------------------------------------------------------------- +Thu Sep 2 16:30:31 CEST 2004 - skh@suse.de + +- Initial package created with version 3.8.1 (JPackage 1.5) + diff --git a/junit.spec b/junit.spec new file mode 100644 index 0000000..10ec989 --- /dev/null +++ b/junit.spec @@ -0,0 +1,130 @@ +# +# spec file for package junit +# +# Copyright (c) 2023 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +Name: junit +Version: 4.13.2 +Release: 0 +Summary: Java regression test package +License: EPL-1.0 +Group: Development/Libraries/Java +URL: https://junit.org/junit4/ +Source0: https://github.com/junit-team/junit4/archive/r%{version}.tar.gz +Source1: build.xml +Patch0: 0001-Port-to-hamcrest-2.2.patch +BuildRequires: ant +BuildRequires: fdupes +BuildRequires: hamcrest >= 1.3 +BuildRequires: java-devel >= 1.8 +BuildRequires: javapackages-local +Requires: mvn(org.hamcrest:hamcrest-core) +Provides: %{name}-demo = %{version}-%{release} +Obsoletes: %{name}-demo < %{version}-%{release} +Provides: %{name}4-demo = %{version}-%{release} +Obsoletes: %{name}4-demo < %{version}-%{release} +Provides: %{name}4 = %{version}-%{release} +Obsoletes: %{name}4 < %{version}-%{release} +BuildArch: noarch + +%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. + +%package javadoc +Summary: Javadoc for %{name} +Group: Documentation/HTML +Provides: %{name}4-javadoc = %{version}-%{release} +Obsoletes: %{name}4-javadoc < %{version}-%{release} + +%description javadoc +Javadoc for %{name}. + +%package manual +Summary: Manual for %{name} +Group: Documentation/Other +Provides: %{name}4-manual = %{version}-%{release} +Obsoletes: %{name}4-manual < %{version}-%{release} + +%description manual +Documentation for %{name}. + +%prep +%setup -q -n %{name}4-r%{version} +%if %{?pkg_vcmp:%pkg_vcmp hamcrest >= 2.0}%{!?pkg_vcmp:0} +%patch0 -p1 +%endif +cp %{SOURCE1} . + +find . -type f -name "*.jar" -or -name "*.class" | xargs -t rm -rf + +%if %{?pkg_vcmp:%pkg_vcmp hamcrest >= 2.0}%{!?pkg_vcmp:0} +ln -s $(build-classpath hamcrest/hamcrest) lib/hamcrest-core-1.3.jar +%else +ln -s $(build-classpath hamcrest/all) lib/hamcrest-core-1.3.jar +%endif + +%build +export CLASSPATH=$(build-classpath hamcrest) +ant jars javadoc -Dversion-status= + +%install +# jars +install -d -m 755 %{buildroot}%{_javadir} +install -m 644 %{name}%{version}/%{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}.jar +# compat symlink +ln -sf %{_javadir}/%{name}.jar %{buildroot}%{_javadir}/%{name}4.jar + +# pom +install -d -m 755 %{buildroot}%{_mavenpomdir} +install -m 644 pom.xml %{buildroot}%{_mavenpomdir}/%{name}.pom +%add_maven_depmap %{name}.pom %{name}.jar + +# javadoc +install -d -m 755 %{buildroot}%{_javadocdir}/%{name} +cp -pr %{name}%{version}/javadoc/* %{buildroot}%{_javadocdir}/%{name} +%fdupes -s %{buildroot}%{_javadocdir}/%{name} + +%check + +cat > test.java <&1 | \ + grep 'Exception in thread "main" java.lang.AssertionError: Hello world from junit' + +%files -f .mfiles +%license LICENSE-junit.txt +%doc CODING_STYLE.txt README.md acknowledgements.txt +%{_javadir}/%{name}4.jar + +%files javadoc +%license LICENSE-junit.txt +%{_javadocdir}/%{name} + +%files manual +%license LICENSE-junit.txt +%doc doc/* + +%changelog diff --git a/r4.13.2.tar.gz b/r4.13.2.tar.gz new file mode 100644 index 0000000..44d85c7 --- /dev/null +++ b/r4.13.2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1b6d700fc374c82951d247f6d80238951d87c61661ceb151f9fbf40f65413561 +size 1077147