Sync from SUSE:SLFO:Main junit revision bc1aeeaba6631de51b230eb95932bc1e

This commit is contained in:
Adrian Schröter 2024-05-31 14:46:08 +02:00
parent 4ca3ef27c0
commit e7edb375eb
9 changed files with 272 additions and 427 deletions

View File

@ -1,7 +1,7 @@
From 85c780b61cd35b4544d2926393805e1699641f38 Mon Sep 17 00:00:00 2001
From d09cc37d39895b8b8b0bffb1c70d0a9d06df69a1 Mon Sep 17 00:00:00 2001
From: Marian Koncek <mkoncek@redhat.com>
Date: Fri, 6 Mar 2020 14:28:05 +0100
Subject: [PATCH] Port to hamcrest 2.2
Subject: [PATCH 1/2] Port to hamcrest 2.2
---
.../org/junit/internal/matchers/StacktracePrintingMatcher.java | 3 ---
@ -12,7 +12,7 @@ Subject: [PATCH] Port to hamcrest 2.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
index 93a68276..3ea4a813 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 @@
@ -38,7 +38,7 @@ index 93a6827..3ea4a81 100644
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 6e2ff5e..1f0a0a0 100644
index 6e2ff5e3..1f0a0a02 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 @@
@ -58,7 +58,7 @@ index 6e2ff5e..1f0a0a0 100644
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
index 74386a86..7d16b11b 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 @@
@ -78,7 +78,7 @@ index 74386a8..7d16b11 100644
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
index 13407cc0..8889266e 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 {
@ -91,7 +91,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 f2b2753..e5759ed 100644
index f2b27531..e5759ed8 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 +104,5 @@ index f2b2753..e5759ed 100644
}
}
--
2.25.2
2.44.0

View File

@ -0,0 +1,67 @@
From 12270ec059bb103dcfb1d11c359e25c7ce5953da Mon Sep 17 00:00:00 2001
From: Christine Poerschke <cpoerschke@bloomberg.net>
Date: Thu, 30 Dec 2021 08:44:54 +0000
Subject: [PATCH 2/2] remove usages of deprecated org.junit.Assert.assertThat()
---
src/main/java/org/junit/rules/ErrorCollector.java | 4 ++--
src/main/java/org/junit/rules/ExpectedException.java | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/main/java/org/junit/rules/ErrorCollector.java b/src/main/java/org/junit/rules/ErrorCollector.java
index 9711e503..f846d776 100644
--- a/src/main/java/org/junit/rules/ErrorCollector.java
+++ b/src/main/java/org/junit/rules/ErrorCollector.java
@@ -1,6 +1,5 @@
package org.junit.rules;
-import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertThrows;
import java.util.ArrayList;
@@ -10,6 +9,7 @@ import java.util.concurrent.Callable;
import org.junit.function.ThrowingRunnable;
import org.junit.internal.AssumptionViolatedException;
import org.hamcrest.Matcher;
+import org.hamcrest.MatcherAssert;
import org.junit.runners.model.MultipleFailureException;
/**
@@ -74,7 +74,7 @@ public class ErrorCollector extends Verifier {
public <T> void checkThat(final String reason, final T value, final Matcher<T> matcher) {
checkSucceeds(new Callable<Object>() {
public Object call() throws Exception {
- assertThat(reason, value, matcher);
+ MatcherAssert.assertThat(reason, value, matcher);
return value;
}
});
diff --git a/src/main/java/org/junit/rules/ExpectedException.java b/src/main/java/org/junit/rules/ExpectedException.java
index 431ad495..16550851 100644
--- a/src/main/java/org/junit/rules/ExpectedException.java
+++ b/src/main/java/org/junit/rules/ExpectedException.java
@@ -3,11 +3,11 @@ package org.junit.rules;
import static java.lang.String.format;
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.instanceOf;
-import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
import static org.junit.internal.matchers.ThrowableCauseMatcher.hasCause;
import static org.junit.internal.matchers.ThrowableMessageMatcher.hasMessage;
import org.hamcrest.Matcher;
+import org.hamcrest.MatcherAssert;
import org.hamcrest.StringDescription;
import org.junit.AssumptionViolatedException;
import org.junit.runners.model.Statement;
@@ -268,7 +268,7 @@ public class ExpectedException implements TestRule {
private void handleException(Throwable e) throws Throwable {
if (isAnyExceptionExpected()) {
- assertThat(e, matcherBuilder.build());
+ MatcherAssert.assertThat(e, matcherBuilder.build());
} else {
throw e;
}
--
2.44.0

17
_service Normal file
View File

@ -0,0 +1,17 @@
<services>
<service name="tar_scm" mode="disabled">
<param name="scm">git</param>
<param name="url">https://github.com/junit-team/junit4.git</param>
<param name="revision">r4.13.2</param>
<param name="match-tag">r*</param>
<param name="versionformat">@PARENT_TAG@</param>
<param name="versionrewrite-pattern">r(.*)</param>
<param name="exclude">**/*.jar</param>
<param name="filename">junit</param>
</service>
<service name="recompress" mode="disabled">
<param name="file">*.tar</param>
<param name="compression">xz</param>
</service>
<service name="set_version" mode="disabled"/>
</services>

394
build.xml
View File

@ -1,394 +0,0 @@
<project name="junit" default="dist" basedir="."
xmlns:artifact="antlib:org.apache.maven.artifact.ant">
<tstamp />
<taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
<property file="${user.home}/.junit.properties" />
<property name="src" value="src/main/java" />
<property name="target" location="target" />
<property name="bin" location="${target}/main" />
<property name="version-base" value="4.13.2" />
<property name="version-bundle" value="${version-base}" />
<property name="version-status" value="-SNAPSHOT" />
<property name="version" value="${version-base}${version-status}" />
<property name="dist" value="junit${version}" />
<property name="versionfile" value="${src}/junit/runner/Version.java" />
<property name="zipfile" value="${dist}/${dist}.zip" />
<property name="testsrc" location="src/test/java" />
<property name="testrsrc" location="src/test/resources" />
<property name="testbin" location="${target}/test/java" />
<property name="unjarred"
value="**/*.jar, ${testfiles}, doc/**, README.html, .classpath, .project, cpl-v10.html" />
<property name="binjar" value="junit-${version}.jar" />
<property name="srcjar" value="junit-${version}-src.jar" />
<property name="docjar" value="junit-${version}-javadoc.jar" />
<property name="depjar" value="junit-dep-${version}.jar" />
<property name="depsrcjar" value="junit-dep-${version}-src.jar" />
<property name="depdocjar" value="junit-dep-${version}-javadoc.jar" />
<property name="javadocdir" location="${dist}/javadoc" />
<property name="javadoczip" location="${dist}-javadoc.zip" />
<property name="hamcrestlib" location="lib/hamcrest-core-1.3.jar" />
<property name="hamcrestlibsources" location="lib/hamcrest-core-1.3-sources.jar" />
<property name="hamcrestsrc" location="${dist}/temp.hamcrest.source" />
<property name="maven.deploy.goal" value="org.apache.maven.plugins:maven-gpg-plugin:1.1:sign-and-deploy-file" />
<property name="compiler.release" value="8" />
<property name="compiler.source" value="1.${compiler.release}" />
<property name="compiler.target" value="${compiler.source}" />
<target name="init">
<tstamp/>
</target>
<target name="versiontag" depends="init">
<filter token="version" value="${version}" />
<copy
file="${versionfile}.template"
tofile="${versionfile}"
filtering="on"
overwrite="true"
/>
</target>
<target name="clean">
<!-- If two builds are made within a minute -->
<delete dir="${dist}" quiet="true" />
<!-- Delete all previous temporary build artifacts -->
<delete dir="${target}" quiet="true" />
<delete file="${zipfile}" quiet="true"/>
<delete file="${javadoczip}" />
</target>
<macrodef name="junit_compilation">
<attribute name="srcdir"/>
<attribute name="destdir"/>
<attribute name="classpath"/>
<sequential>
<mkdir dir="@{destdir}"/>
<javac
srcdir="@{srcdir}"
destdir="@{destdir}"
debug="on"
classpath="@{classpath}"
includeantruntime="false"
release="${compiler.release}"
source="${compiler.source}"
target="${compiler.target}"
>
<compilerarg value="-Xlint:unchecked" />
</javac>
</sequential>
</macrodef>
<target name="build" depends="versiontag">
<junit_compilation srcdir="${src}" destdir="${bin}" classpath="${hamcrestlib}"/>
<unjar src="${hamcrestlib}" dest="${bin}" />
<junit_compilation srcdir="${testsrc}" destdir="${testbin}" classpath="${hamcrestlib};${bin}"/>
</target>
<target name="jars" depends="build">
<mkdir dir="${dist}" />
<jar
jarfile="${dist}/${srcjar}"
basedir="${src}"
excludes="${unjarred}, **/*.class"
/>
<jar
jarfile="${dist}/${binjar}"
basedir="${bin}"
excludes="${unjarred}, **/*.java, build.xml">
<manifest>
<attribute name="Bundle-Description" value="JUnit is a unit testing framework for Java, created by Erich Gamma and Kent Beck."/>
<attribute name="Bundle-DocURL" value="http://www.junit.org"/>
<attribute name="Bundle-License" value="http://www.eclipse.org/legal/epl-v10.html"/>
<attribute name="Bundle-ManifestVersion" value="2"/>
<attribute name="Bundle-Name" value="JUnit"/>
<attribute name="Bundle-SymbolicName" value="org.junit"/>
<attribute name="Bundle-Vendor" value="JUnit"/>
<attribute name="Bundle-Version" value="${version-bundle}"/>
<attribute name="Export-Package" value="junit.extensions;version=&quot;${version-bundle}&quot;,junit.framework;version=&quot;${version-bundle}&quot;,junit.runner;version=&quot;${version-bundle}&quot;,junit.textui;version=&quot;${version-bundle}&quot;,org.junit.experimental.categories;version=&quot;${version-bundle}&quot;,org.junit.experimental.max;version=&quot;${version-bundle}&quot;,org.junit.experimental.results;version=&quot;${version-bundle}&quot;,org.junit.experimental.runners;version=&quot;${version-bundle}&quot;,org.junit.experimental.theories.internal;x-internal:=true;version=&quot;${version-bundle}&quot;,org.junit.experimental.theories.suppliers;version=&quot;${version-bundle}&quot;,org.junit.experimental.theories;version=&quot;${version-bundle}&quot;,org.junit.experimental;version=&quot;${version-bundle}&quot;,org.junit.function;version=&quot;${version-bundle}&quot;,org.junit.internal.builders;x-internal:=true;version=&quot;${version-bundle}&quot;,org.junit.internal.management;x-internal:=true;version=&quot;${version-bundle}&quot;,org.junit.internal.matchers;x-internal:=true;version=&quot;${version-bundle}&quot;,org.junit.internal.requests;x-internal:=true;version=&quot;${version-bundle}&quot;,org.junit.internal.runners.model;x-internal:=true;version=&quot;${version-bundle}&quot;,org.junit.internal.runners.rules;x-internal:=true;version=&quot;${version-bundle}&quot;,org.junit.internal.runners.statements;x-internal:=true;version=&quot;${version-bundle}&quot;,org.junit.internal.runners;x-internal:=true;version=&quot;${version-bundle}&quot;,org.junit.internal;x-internal:=true;version=&quot;${version-bundle}&quot;,org.junit.matchers;version=&quot;${version-bundle}&quot;,org.junit.rules;version=&quot;${version-bundle}&quot;,org.junit.runner.manipulation;version=&quot;${version-bundle}&quot;,org.junit.runner.notification;version=&quot;${version-bundle}&quot;,org.junit.runner;version=&quot;${version-bundle}&quot;,org.junit.runners.model;version=&quot;${version-bundle}&quot;,org.junit.runners.parameterized;version=&quot;${version-bundle}&quot;,org.junit.runners;version=&quot;${version-bundle}&quot;,org.junit.validator;version=&quot;${version-bundle}&quot;,org.junit;version=&quot;${version-bundle}&quot;"/>
<attribute name="Implementation-Title" value="JUnit"/>
<attribute name="Implementation-URL" value="http://junit.org"/>
<attribute name="Implementation-Vendor" value="JUnit"/>
<attribute name="Implementation-Vendor-Id" value="junit"/>
<attribute name="Implementation-Version" value="${version-base}"/>
<attribute name="Import-Package" value="junit.extensions,junit.framework,junit.runner,org.hamcrest.core,org.hamcrest,org.junit,org.junit.experimental.theories,org.junit.experimental.theories.internal,org.junit.function,org.junit.internal,org.junit.internal.builders,org.junit.internal.management,org.junit.internal.matchers,org.junit.internal.requests,org.junit.internal.runners,org.junit.internal.runners.model,org.junit.internal.runners.rules,org.junit.internal.runners.statements,org.junit.matchers,org.junit.rules,org.junit.runner,org.junit.runner.manipulation,org.junit.runner.notification,org.junit.runners,org.junit.runners.model,org.junit.runners.parameterized,org.junit.validator"/>
<attribute name="JavaPackages-ArtifactId" value="junit"/>
<attribute name="JavaPackages-GroupId" value="junit"/>
<attribute name="JavaPackages-Version" value="${version-base}"/>
<attribute name="Require-Capability" value="osgi.ee;filter:=&quot;(&amp;(osgi.ee=JavaSE)(version=${compiler.target}))&quot;"/>
</manifest>
</jar>
<jar
jarfile="${dist}/${depjar}"
basedir="${bin}"
excludes="${unjarred}, org/hamcrest/**, **/*.java, build.xml"
/>
</target>
<target name="all.maven.jars" depends="jars,javadoc">
<mkdir dir="${dist}" />
<jar
jarfile="${dist}/${depsrcjar}"
basedir="${src}"
excludes="${unjarred}, **/*.class"
/>
<jar
jarfile="${dist}/${depdocjar}"
basedir="${javadocdir}"
excludes="${unjarred}, org/hamcrest/**"
/>
</target>
<target name="samples-and-tests">
<copy todir="${dist}">
<fileset dir="${testbin}" />
<fileset dir="${testsrc}" />
<fileset dir="${testrsrc}" />
</copy>
</target>
<target name="javadoc">
<javadoc destdir="${javadocdir}"
source="${compiler.source}"
author="false"
version="false"
use="false"
windowtitle="JUnit API"
>
<excludepackage name="junit.*" />
<excludepackage name="org.junit.internal.*" />
<excludepackage name="org.junit.experimental.theories.internal.*" />
<sourcepath location="${src}" />
<sourcepath location="${hamcrestsrc}" />
</javadoc>
</target>
<target name="javadoczip">
<delete file="${javadoczip}" />
<antcall target="javadoc" />
<zip basedir="${javadocdir}" file="${javadoczip}" />
</target>
<target name="populate-dist"
depends="clean, build, jars, samples-and-tests, javadoc"
>
<copy todir="${dist}/doc">
<fileset dir="doc"/>
</copy>
<copy file="README.md" tofile="${dist}/README.md" />
<copy file="BUILDING" tofile="${dist}/BUILDING" />
<copy file="epl-v10.html" tofile="${dist}/epl-v10.html" />
<copy file="build.xml" tofile="${dist}/build.xml" />
</target>
<macrodef name="run-dist-tests">
<!-- Runs the tests against the built jar files -->
<element name="extra-args" implicit="yes" />
<sequential>
<java classname="org.junit.runner.JUnitCore" fork="yes" failonerror="true">
<extra-args />
<arg value="org.junit.tests.AllTests"/>
<classpath>
<pathelement location="${dist}" />
<pathelement location="${dist}/${binjar}" />
</classpath>
</java>
</sequential>
</macrodef>
<macrodef name="run-local-tests">
<!-- Runs the tests against the local class files -->
<sequential>
<java classname="org.junit.runner.JUnitCore" fork="yes" failonerror="true">
<arg value="org.junit.tests.AllTests"/>
<classpath>
<pathelement location="${bin}" />
<pathelement location="${testbin}" />
<pathelement location="${hamcrestlib}" />
</classpath>
</java>
</sequential>
</macrodef>
<target name="test" depends="build">
<run-local-tests />
</target>
<target name="dist" depends="populate-dist">
<run-dist-tests>
<jvmarg value="-Dignore.this=ignored"/>
</run-dist-tests>
</target>
<target name="profile" depends="populate-dist">
<run-dist-tests>
<jvmarg value="-agentlib:hprof=cpu=samples"/>
</run-dist-tests>
</target>
<target name="zip" depends="dist">
<zip zipfile="${zipfile}" basedir="." includes="${dist}/**" />
</target>
<target name="upload.to.sourceforge" depends="zip">
<ftp server="upload.sourceforge.net"
userid="anonymous"
password="saff@mit.edu"
remotedir="incoming"
>
<fileset dir="${dist}" includes="*.jar" />
<fileset file="${zipfile}" />
</ftp>
<echo message="To upload docs, use build/upload_docs.sh" />
</target>
<!-- to do automatic build upload, you need the maven ant tasks jar. -->
<!-- therefore, you must run ant as ant -lib build/lib stage.maven -->
<macrodef name="push.maven.artifact">
<attribute name="file" />
<attribute name="pom" />
<attribute name="packaging" />
<attribute name="url" />
<attribute name="repo.id" />
<element name="artifact.args" implicit="true" optional="true" />
<sequential>
<artifact:mvn failonerror="true">
<arg value="${maven.deploy.goal}" />
<arg value="-Durl=@{url}" />
<arg value="-DrepositoryId=@{repo.id}" />
<arg value="-DpomFile=@{pom}" />
<arg value="-Dfile=@{file}" />
<arg value="-Dpackaging=@{packaging}" />
<artifact.args />
<arg value="-Pgpg" />
</artifact:mvn>
</sequential>
</macrodef>
<macrodef name="push.maven.jar">
<attribute name="jar" />
<attribute name="pom" />
<attribute name="url" />
<attribute name="repo.id" />
<element name="artifact.args" implicit="true" optional="true" />
<sequential>
<echo message="Pushing JAR to Maven: @{jar} -> @{url}" />
<push.maven.artifact file="@{jar}" pom="@{pom}" packaging="jar"
url="@{url}" repo.id="@{repo.id}">
<artifact.args />
</push.maven.artifact>
</sequential>
</macrodef>
<macrodef name="push.maven.pom">
<attribute name="pom" />
<attribute name="url" />
<attribute name="repo.id" />
<element name="artifact.args" implicit="true" optional="true" />
<sequential>
<echo message="Pushing POM to Maven: @{pom} -> @{url}" />
<push.maven.artifact file="@{pom}" pom="@{pom}" packaging="pom"
url="@{url}" repo.id="@{repo.id}">
<artifact.args />
</push.maven.artifact>
</sequential>
</macrodef>
<macrodef name="push.junit.maven.artifact">
<attribute name="url" />
<attribute name="repo.id" />
<attribute name="is.snapshot" default="true" />
<sequential>
<local name="m.prefix" />
<property name="m.prefix" value="${dist}/junit-dep-${version}" />
<local name="m.jar" />
<property name="m.jar" value="${m.prefix}.jar" />
<local name="m.sources.jar" />
<property name="m.sources.jar" value="${m.prefix}-src.jar" />
<local name="m.javadoc.jar" />
<property name="m.javadoc.jar" value="${m.prefix}-javadoc.jar" />
<local name="m.pom" />
<property name="m.pom" value="${dist}/pom-junit.xml" />
<filter token="version" value="${version}" />
<copy
file="build/maven/junit-pom-template.xml"
tofile="${m.pom}"
filtering="on"
overwrite="true"
/>
<push.maven.jar jar="${m.jar}" pom="${m.pom}"
url="@{url}" repo.id="@{repo.id}" />
<if>
<equals arg1="@{is.snapshot}" arg2="false" />
<then>
<push.maven.jar jar="${m.sources.jar}" pom="${m.pom}"
url="@{url}" repo.id="@{repo.id}">
<arg value="-Dclassifier=sources" />
</push.maven.jar>
<push.maven.jar jar="${m.javadoc.jar}" pom="${m.pom}"
url="@{url}" repo.id="@{repo.id}">
<arg value="-Dclassifier=javadoc" />
</push.maven.jar>
</then>
</if>
</sequential>
</macrodef>
<macrodef name="push.junit-dep.maven.artifact">
<attribute name="url" />
<attribute name="repo.id" />
<sequential>
<local name="m.pom" />
<property name="m.pom" value="${dist}/pom-junit-dep.xml" />
<filter token="version" value="${version}" />
<copy
file="build/maven/junit-dep-pom-template.xml"
tofile="${m.pom}"
filtering="on"
overwrite="true"
/>
<push.maven.pom pom="${m.pom}"
url="@{url}" repo.id="@{repo.id}" />
</sequential>
</macrodef>
<target name="stage.maven" depends="all.maven.jars">
<property name="stage.url"
value="https://oss.sonatype.org/service/local/staging/deploy/maven2/" />
<property name="stage.repo.id" value="sonatype-nexus-staging" />
<push.junit.maven.artifact url="${stage.url}"
repo.id="${stage.repo.id}"
is.snapshot="false" />
<push.junit-dep.maven.artifact url="${stage.url}"
repo.id="${stage.repo.id}" />
</target>
<target name="snapshot.maven" depends="all.maven.jars">
<property name="snapshot.url"
value="https://oss.sonatype.org/content/repositories/snapshots/" />
<property name="snapshot.repo.id" value="sonatype-nexus-snapshots" />
<push.junit.maven.artifact url="${snapshot.url}"
repo.id="${snapshot.repo.id}" />
<push.junit-dep.maven.artifact url="${snapshot.url}"
repo.id="${snapshot.repo.id}" />
</target>
<target name="print.version">
<echo message="${version}" />
</target>
</project>

BIN
junit-4.13.2.tar.xz (Stored with Git LFS) Normal file

Binary file not shown.

140
junit-build.xml Normal file
View File

@ -0,0 +1,140 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="junit" default="package" basedir=".">
<!-- ====================================================================== -->
<!-- Build environment properties -->
<!-- ====================================================================== -->
<property file="build.properties"/>
<property name="project.artifactId" value="junit"/>
<property name="project.groupId" value="junit"/>
<property name="project.version" value="4.13.2"/>
<property name="compiler.release" value="8"/>
<property name="compiler.source" value="1.${compiler.release}"/>
<property name="compiler.target" value="${compiler.source}"/>
<property name="build.finalName" value="${project.artifactId}-${project.version}"/>
<property name="build.dir" value="target"/>
<property name="build.outputDir" value="${build.dir}/classes"/>
<property name="build.srcDir" value="src/main/java"/>
<property name="build.resourceDir" value="src/main/resources"/>
<property name="reporting.outputDirectory" value="${build.dir}/site"/>
<!-- ====================================================================== -->
<!-- Defining classpaths -->
<!-- ====================================================================== -->
<path id="build.classpath">
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
</path>
<!-- ====================================================================== -->
<!-- Cleaning up target -->
<!-- ====================================================================== -->
<target name="clean" description="Clean the output directory">
<delete dir="${build.dir}"/>
</target>
<!-- ====================================================================== -->
<!-- Compilation target -->
<!-- ====================================================================== -->
<target name="compile" description="Compile the code">
<mkdir dir="${build.outputDir}"/>
<javac destdir="${build.outputDir}"
encoding="ISO-8859-1"
nowarn="true"
debug="true"
optimize="false"
deprecation="true"
release="${compiler.release}"
target="${compiler.target}"
verbose="false"
fork="true"
memoryInitialSize="128m"
source="${compiler.source}">
<src>
<pathelement location="${build.srcDir}"/>
</src>
<classpath refid="build.classpath"/>
</javac>
<copy todir="${build.outputDir}">
<fileset dir="${build.resourceDir}"/>
</copy>
</target>
<!-- ====================================================================== -->
<!-- Javadoc target -->
<!-- ====================================================================== -->
<target name="javadoc" description="Generates the Javadoc of the application">
<javadoc sourcepath="${build.srcDir}"
packagenames="*"
destdir="${reporting.outputDirectory}/apidocs"
access="protected"
source="${compiler.source}"
verbose="false"
version="true"
use="true"
author="true"
splitindex="false"
nodeprecated="false"
nodeprecatedlist="false"
notree="false"
noindex="false"
nohelp="false"
nonavbar="false"
serialwarn="false"
charset="ISO-8859-1"
linksource="false"
breakiterator="false">
<classpath refid="build.classpath"/>
</javadoc>
</target>
<!-- ====================================================================== -->
<!-- Package target -->
<!-- ====================================================================== -->
<target name="package" depends="compile" description="Package the application">
<jar jarfile="${build.dir}/${build.finalName}.jar"
compress="true"
index="false"
basedir="${build.outputDir}"
excludes="**/package.html">
<manifest>
<attribute name="Automatic-Module-Name" value="junit"/>
<attribute name="Bundle-Description" value="JUnit is a unit testing framework for Java, created by Erich Gamma and Kent Beck."/>
<attribute name="Bundle-DocURL" value="http://www.junit.org"/>
<attribute name="Bundle-License" value="http://www.eclipse.org/legal/epl-v10.html"/>
<attribute name="Bundle-ManifestVersion" value="2"/>
<attribute name="Bundle-Name" value="JUnit"/>
<attribute name="Bundle-SymbolicName" value="org.junit"/>
<attribute name="Bundle-Vendor" value="JUnit"/>
<attribute name="Bundle-Version" value="${project.version}"/>
<attribute name="Export-Package" value="junit.extensions;version=&quot;${project.version}&quot;,junit.framework;version=&quot;${project.version}&quot;,junit.runner;version=&quot;${project.version}&quot;,junit.textui;version=&quot;${project.version}&quot;,org.junit.experimental.categories;version=&quot;${project.version}&quot;,org.junit.experimental.max;version=&quot;${project.version}&quot;,org.junit.experimental.results;version=&quot;${project.version}&quot;,org.junit.experimental.runners;version=&quot;${project.version}&quot;,org.junit.experimental.theories.internal;x-internal:=true;version=&quot;${project.version}&quot;,org.junit.experimental.theories.suppliers;version=&quot;${project.version}&quot;,org.junit.experimental.theories;version=&quot;${project.version}&quot;,org.junit.experimental;version=&quot;${project.version}&quot;,org.junit.function;version=&quot;${project.version}&quot;,org.junit.internal.builders;x-internal:=true;version=&quot;${project.version}&quot;,org.junit.internal.management;x-internal:=true;version=&quot;${project.version}&quot;,org.junit.internal.matchers;x-internal:=true;version=&quot;${project.version}&quot;,org.junit.internal.requests;x-internal:=true;version=&quot;${project.version}&quot;,org.junit.internal.runners.model;x-internal:=true;version=&quot;${project.version}&quot;,org.junit.internal.runners.rules;x-internal:=true;version=&quot;${project.version}&quot;,org.junit.internal.runners.statements;x-internal:=true;version=&quot;${project.version}&quot;,org.junit.internal.runners;x-internal:=true;version=&quot;${project.version}&quot;,org.junit.internal;x-internal:=true;version=&quot;${project.version}&quot;,org.junit.matchers;version=&quot;${project.version}&quot;,org.junit.rules;version=&quot;${project.version}&quot;,org.junit.runner.manipulation;version=&quot;${project.version}&quot;,org.junit.runner.notification;version=&quot;${project.version}&quot;,org.junit.runner;version=&quot;${project.version}&quot;,org.junit.runners.model;version=&quot;${project.version}&quot;,org.junit.runners.parameterized;version=&quot;${project.version}&quot;,org.junit.runners;version=&quot;${project.version}&quot;,org.junit.validator;version=&quot;${project.version}&quot;,org.junit;version=&quot;${project.version}&quot;"/>
<attribute name="Implementation-Title" value="JUnit"/>
<attribute name="Implementation-URL" value="http://junit.org"/>
<attribute name="Implementation-Vendor" value="JUnit"/>
<attribute name="Implementation-Vendor-Id" value="junit"/>
<attribute name="Implementation-Version" value="${project.version}"/>
<attribute name="Import-Package" value="junit.extensions,junit.framework,junit.runner,org.hamcrest.core,org.hamcrest,org.junit,org.junit.experimental.theories,org.junit.experimental.theories.internal,org.junit.function,org.junit.internal,org.junit.internal.builders,org.junit.internal.management,org.junit.internal.matchers,org.junit.internal.requests,org.junit.internal.runners,org.junit.internal.runners.model,org.junit.internal.runners.rules,org.junit.internal.runners.statements,org.junit.matchers,org.junit.rules,org.junit.runner,org.junit.runner.manipulation,org.junit.runner.notification,org.junit.runners,org.junit.runners.model,org.junit.runners.parameterized,org.junit.validator"/>
<attribute name="Require-Capability" value="osgi.ee;filter:=&quot;(&amp;(osgi.ee=JavaSE)(version=${compiler.target}))&quot;"/>
</manifest>
</jar>
</target>
<!-- ====================================================================== -->
<!-- A dummy target for the package named after the type it creates -->
<!-- ====================================================================== -->
<target name="jar" depends="package" description="Builds the jar for the application"/>
</project>

View File

@ -1,3 +1,24 @@
-------------------------------------------------------------------
Thu May 23 05:53:55 UTC 2024 - Fridrich Strba <fstrba@suse.com>
- Require hamcrest >= 2.2 to resolve choice of providers
-------------------------------------------------------------------
Sat Apr 27 11:44:02 UTC 2024 - Fridrich Strba <fstrba@suse.com>
- Generate anew the ant build system using the maven pom.xml
- Fetch sources from github by source service and filter out stale
hamcrest binaries.
- Port to hamcrest 2.2 unconditionally
- Added patch:
* 0002-remove-usages-of-deprecated-org.junit.Assert.assertT.patch
+ upstream patch to replace deprecated assertThat
-------------------------------------------------------------------
Wed Feb 21 13:55:54 UTC 2024 - Fridrich Strba <fstrba@suse.com>
- Use %patch -P N instead of deprecated %patchN.
-------------------------------------------------------------------
Thu Sep 21 07:53:02 UTC 2023 - Fridrich Strba <fstrba@suse.com>

View File

@ -1,7 +1,7 @@
#
# spec file for package junit
#
# Copyright (c) 2023 SUSE LLC
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -23,15 +23,16 @@ 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
Source0: %{name}-%{version}.tar.xz
Source1: %{name}-build.xml
Patch0: 0001-Port-to-hamcrest-2.2.patch
Patch1: 0002-remove-usages-of-deprecated-org.junit.Assert.assertT.patch
BuildRequires: ant
BuildRequires: fdupes
BuildRequires: hamcrest >= 1.3
BuildRequires: hamcrest >= 2.2
BuildRequires: java-devel >= 1.8
BuildRequires: javapackages-local
Requires: mvn(org.hamcrest:hamcrest-core)
BuildRequires: javapackages-local >= 6
Requires: hamcrest >= 2.2
Provides: %{name}-demo = %{version}-%{release}
Obsoletes: %{name}-demo < %{version}-%{release}
Provides: %{name}4-demo = %{version}-%{release}
@ -63,39 +64,32 @@ Obsoletes: %{name}4-manual < %{version}-%{release}
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} .
%setup -q
%patch -P 0 -p1
%patch -P 1 -p1
cp %{SOURCE1} build.xml
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=
build-jar-repository -s lib hamcrest
ant jar javadoc
%install
# jars
install -d -m 755 %{buildroot}%{_javadir}
install -m 644 %{name}%{version}/%{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}.jar
install -m 644 target/%{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
%{mvn_install_pom} 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}
cp -pr target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}
%fdupes -s %{buildroot}%{_javadocdir}/%{name}
%check

BIN
r4.13.2.tar.gz (Stored with Git LFS)

Binary file not shown.