From 87408c1b56853095020055efcbaf7d56f3997fad Mon Sep 17 00:00:00 2001 From: eabdullin Date: Thu, 13 Mar 2025 14:03:52 +0000 Subject: [PATCH] import CS mockito-5.8.0-13.module_el9+1171+eb38a622 --- .gitignore | 2 +- .mockito.metadata | 2 +- SOURCES/aggregator.pom | 16 + SOURCES/generate-tarball.sh | 24 + SOURCES/make-mockito-sourcetarball.sh | 20 - SOURCES/mockito-core-5.8.0.pom | 83 +++ SOURCES/mockito-core.pom | 698 ------------------------ SOURCES/mockito-junit-jupiter-5.8.0.pom | 77 +++ SOURCES/use-unbundled-asm.patch | 79 ++- SPECS/mockito.spec | 222 ++++++-- 10 files changed, 441 insertions(+), 782 deletions(-) create mode 100644 SOURCES/aggregator.pom create mode 100755 SOURCES/generate-tarball.sh delete mode 100755 SOURCES/make-mockito-sourcetarball.sh create mode 100644 SOURCES/mockito-core-5.8.0.pom delete mode 100644 SOURCES/mockito-core.pom create mode 100644 SOURCES/mockito-junit-jupiter-5.8.0.pom diff --git a/.gitignore b/.gitignore index 31dfe14..0a588c3 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/mockito-3.1.2.tar.xz +SOURCES/mockito-5.8.0.tar.gz diff --git a/.mockito.metadata b/.mockito.metadata index a96248e..7c8b05f 100644 --- a/.mockito.metadata +++ b/.mockito.metadata @@ -1 +1 @@ -15683d23b64ec2b289dccd9898efcbbde7741765 SOURCES/mockito-3.1.2.tar.xz +11de281f62d24cef6cf3b90dced0439dbca0956e SOURCES/mockito-5.8.0.tar.gz diff --git a/SOURCES/aggregator.pom b/SOURCES/aggregator.pom new file mode 100644 index 0000000..3dd438d --- /dev/null +++ b/SOURCES/aggregator.pom @@ -0,0 +1,16 @@ + + + 4.0.0 + org.fedoraproject.xmvn.mockito + aggregator + any + pom + + UTF-8 + + + . + subprojects/junit-jupiter + + diff --git a/SOURCES/generate-tarball.sh b/SOURCES/generate-tarball.sh new file mode 100755 index 0000000..1819d20 --- /dev/null +++ b/SOURCES/generate-tarball.sh @@ -0,0 +1,24 @@ +#!/bin/bash +set -e + +name=mockito +version="$(sed -n 's/Version:\s*//p' *.spec)" + +# RETRIEVE +wget "https://github.com/mockito/mockito/archive/v${version}.tar.gz" -O "${name}-${version}.orig.tar.gz" + +rm -rf tarball-tmp +mkdir tarball-tmp +pushd tarball-tmp +tar -xf "../${name}-${version}.orig.tar.gz" + +# CLEAN TARBALL +pushd "mockito-${version}" +find -name '*.jar' -delete +find -name '*.class' -delete +rm -rf gradlew gradlew.bat src/javadoc +popd + +tar -czf "../${name}-${version}.tar.gz" * +popd +rm -r tarball-tmp "${name}-${version}.orig.tar.gz" diff --git a/SOURCES/make-mockito-sourcetarball.sh b/SOURCES/make-mockito-sourcetarball.sh deleted file mode 100755 index 8b47268..0000000 --- a/SOURCES/make-mockito-sourcetarball.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -ex - -VERSION="$(sed -n 's/Version:\s*//p' *.spec)" -SRCDIR=mockito-${VERSION} - -git clone https://github.com/mockito/mockito.git ${SRCDIR} -pushd $SRCDIR -git archive --format=tar --prefix=${SRCDIR}/ v${VERSION} > ../${SRCDIR}.tar -popd - -rm -rf ${SRCDIR} - -tar -xf ${SRCDIR}.tar -rm ${SRCDIR}.tar -pushd ${SRCDIR} -find -name '*.jar' -delete -rm -rf gradlew gradlew.bat src/javadoc -popd - -tar -cvJf mockito-${VERSION}.tar.xz ${SRCDIR} diff --git a/SOURCES/mockito-core-5.8.0.pom b/SOURCES/mockito-core-5.8.0.pom new file mode 100644 index 0000000..1bc372e --- /dev/null +++ b/SOURCES/mockito-core-5.8.0.pom @@ -0,0 +1,83 @@ + + + 4.0.0 + org.mockito + mockito-core + 5.8.0 + mockito-core + Mockito mock objects library core API and implementation + https://github.com/mockito/mockito + + + MIT + https://opensource.org/licenses/MIT + repo + + + + + mockitoguy + Szczepan Faber + https://github.com/mockitoguy + + Core developer + + + + bric3 + Brice Dutheil + https://github.com/bric3 + + Core developer + + + + raphw + Rafael Winterhalter + https://github.com/raphw + + Core developer + + + + TimvdLippe + Tim van der Lippe + https://github.com/TimvdLippe + + Core developer + + + + + https://github.com/mockito/mockito.git + + + GitHub issues + https://github.com/mockito/mockito/issues + + + GH Actions + https://github.com/mockito/mockito/actions + + + + net.bytebuddy + byte-buddy + 1.14.10 + compile + + + net.bytebuddy + byte-buddy-agent + 1.14.10 + compile + + + org.objenesis + objenesis + 3.3 + runtime + + + diff --git a/SOURCES/mockito-core.pom b/SOURCES/mockito-core.pom deleted file mode 100644 index 8e20e00..0000000 --- a/SOURCES/mockito-core.pom +++ /dev/null @@ -1,698 +0,0 @@ - - - 4.0.0 - org.mockito - mockito-core - @VERSION@ - mockito-core - jar - https://github.com/mockito/mockito - Mockito mock objects library core API and implementation - - - - org.ow2.asm - asm - 7.2 - compile - - - net.bytebuddy - byte-buddy - 1.9.3 - compile - - - net.bytebuddy - byte-buddy-agent - 1.9.3 - compile - - - org.objenesis - objenesis - 3.1 - compile - - - org.opentest4j - opentest4j - 1.2 - compile - - - org.hamcrest - hamcrest - 2.2 - provided - - - junit - junit - 4.12 - provided - - - org.assertj - assertj-core - 3.13.2 - test - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.1 - - 1.8 - 1.8 - - - - org.apache.felix - maven-bundle-plugin - 3.5.0 - - ${project.build.directory}/osgi - - <_include>-osgi.bnd - - - - - process-classes - - manifest - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.6.0 - - - process-classes - - exec - - - - - cp - - ${project.build.sourceDirectory}/org/mockito/internal/creation/bytebuddy/inject/MockMethodDispatcher.class - ${project.build.outputDirectory}/org/mockito/internal/creation/bytebuddy/inject/MockMethodDispatcher.raw - - - - - org.apache.maven.plugins - maven-jar-plugin - 3.1.0 - - - ${project.build.directory}/osgi/MANIFEST.MF - - - **/MockMethodDispatcher.class - - - - - - - - The MIT License - https://github.com/mockito/mockito/blob/master/LICENSE - repo - - - - https://github.com/mockito/mockito.git - - - https://github.com/mockito/mockito/issues - GitHub issues - - - https://travis-ci.org/mockito/mockito - TravisCI - - - - mockitoguy - Szczepan Faber - - Core developer - - https://github.com/mockitoguy - - - bric3 - Brice Dutheil - - Core developer - - https://github.com/bric3 - - - raphw - Rafael Winterhalter - - Core developer - - https://github.com/raphw - - - TimvdLippe - Tim van der Lippe - - Core developer - - https://github.com/TimvdLippe - - - - - continuous-delivery-drone - https://github.com/continuous-delivery-drone - - - shipkit.org automated bot - https://github.com/shipkit-org - - - Marcin Zajączkowski - https://github.com/szpak - - - Pascal Schumacher - https://github.com/PascalSchumacher - - - Igor Czechowski - https://github.com/iczechowski - - - Bartosz Bańkowski - https://github.com/bbankowski - - - Erhard Pointl - https://github.com/epeee - - - Allon Murienik - https://github.com/mureinik - - - Christian Schwarz - https://github.com/ChristianSchwarz - - - Lukasz Szewc - https://github.com/lukasz-szewc - - - Marcin Grzejszczak - https://github.com/marcingrzejszczak - - - Marc Philipp - https://github.com/marcphilipp - - - Sangwoo Lee - https://github.com/marchpig - - - Philip P. Moltmann - https://github.com/moltmann - - - Tim Perry - https://github.com/pimterry - - - David J. M. Karlsen - https://github.com/davidkarlsen - - - Dawud-xx - https://github.com/Dawud-xx - - - Lovro Pandžić - https://github.com/lpandzic - - - Werner Beroux - https://github.com/wernight - - - Tsuyoshi Murakami - https://github.com/tmurakami - - - Serge Bishyr - https://github.com/SeriyBg - - - Dmitry Timofeev - https://github.com/dmitry-timofeev - - - jerzykrlk - https://github.com/jerzykrlk - - - alberskib - https://github.com/alberskib - - - Joseph Walton - https://github.com/josephw - - - Stephan Schroevers - https://github.com/Stephan202 - - - Michal Kordas - https://github.com/mkordas - - - Kamil Szymański - https://github.com/kamilszymanski - - - Hynek Mlnařík - https://github.com/hmlnarik - - - Hugh Hamill - https://github.com/hughwphamill - - - Hans Joachim Desserud - https://github.com/hansjoachim - - - Gunnar Wagenknecht - https://github.com/guw - - - Dmytro Chyzhykov - https://github.com/ffbit - - - r-smirnov - https://github.com/r-smirnov - - - ianparkinson - https://github.com/ianparkinson - - - dmac100 - https://github.com/dmac100 - - - Vineet Kumar - https://github.com/vin - - - Urs Metz - https://github.com/UrsMetz - - - Tarnowski Jan - https://github.com/tarnowskijan - - - Roman Elizarov - https://github.com/elizarov - - - Roland Hauser - https://github.com/SourcePond - - - Michał Borek - https://github.com/michalborek - - - Michael Pinnegar - https://github.com/Jazzepi - - - Marius Volkhart - https://github.com/MariusVolkhart - - - Lucas Cavalcanti - https://github.com/lucascs - - - Leonardo Carrasco - https://github.com/thesnowgoose - - - Krzysztof Wolny - https://github.com/vanta - - - Jeffrey Falgout - https://github.com/JeffreyFalgout - - - Ismael Juma - https://github.com/ijuma - - - Emory Merryman - https://github.com/AFnRFCb7 - - - Clark Brewer - https://github.com/brewerc - - - Carlos Aguayo - https://github.com/carlosaguayo - - - Arend v. Reinersdorff - https://github.com/arend-von-reinersdorff - - - Alberto Scotto - https://github.com/alb-i986 - - - yyvess - https://github.com/yyvess - - - 訾明华 - https://github.com/ziminghua - - - wuwen - https://github.com/wuwen5 - - - test111 - https://github.com/tradingreason - - - Xin Liu - https://github.com/L-KID - - - Wojtek Wilk - https://github.com/wwilk - - - Walter Scott Johnson - https://github.com/li-wjohnson - - - Walter Johnson - https://github.com/li-wjohnson - - - Vladislav - https://github.com/VChirp - - - Vivian Pennel - https://github.com/Vp3n - - - Venkata Jaswanth - https://github.com/aj-jaswanth - - - Tom Ball - https://github.com/tomball - - - Tokuhiro Matsuno - https://github.com/tokuhirom - - - Tim Cooke - https://github.com/trcooke - - - Stuart Blair - https://github.com/stuartblair - - - Simen Bekkhus - https://github.com/SimenB - - - Scott Markwell - https://github.com/smarkwell - - - Sanne Grinovero - https://github.com/Sanne - - - Roi Atalla - https://github.com/ra4king - - - Robert Stupp - https://github.com/snazy - - - Radim Kubacki - https://github.com/radimk - - - Philipp Jardas - https://github.com/phjardas - - - Oliver Drotbohm - https://github.com/odrotbohm - - - Niklas Baudy - https://github.com/vanniktech - - - Myrle Krantz - https://github.com/myrle-krantz - - - Matt Dean - https://github.com/mattbdean - - - Markus Wüstenberg - https://github.com/markuswustenberg - - - Maciej Kuster - https://github.com/NagRock - - - MEDDAH Julien - https://github.com/MeddahJ - - - Ludovic Meurillon - https://github.com/LudoMeurillon - - - Ludovic Chane - https://github.com/ludochane - - - Krisztian Milesz - https://github.com/mileszk - - - Kengo TODA - https://github.com/KengoTODA - - - Kayvan Najafzadeh - https://github.com/kayvannj - - - José Paumard - https://github.com/JosePaumard - - - Jonathan Lloyd - https://github.com/lloydjm77 - - - Johnny Lim - https://github.com/izeye - - - Jesse Englert - https://github.com/jpenglert - - - Jeremy Rickard - https://github.com/jrrickard - - - Ivan Vershinin - https://github.com/vershinin - - - Igor Kostenko - https://github.com/isanych - - - Igor Conrado Alves de Lima - https://github.com/igorcadelima - - - Gaëtan Muller - https://github.com/MGaetan89 - - - Felix W. Dekker - https://github.com/FWDekker - - - Evgeny Astafyev - https://github.com/astafev - - - Eugene Ivakhno - https://github.com/eugene-ivakhno - - - Erik Bakker - https://github.com/eamelink - - - Dmitriy Zaitsev - https://github.com/DmitriyZaitsev - - - Divyansh Gupta - https://github.com/divyansh-gupta - - - Dennis Cheung - https://github.com/hkdennis2k - - - Denis Zharkov - https://github.com/dzharkov - - - David Xia - https://github.com/davidxia - - - David Gageot - https://github.com/dgageot - - - Christian Persson - https://github.com/Saser - - - Bruno Krebs - https://github.com/brunokrebs - - - Ben Yu - https://github.com/fluentfuture - - - Bastien Jansen - https://github.com/bjansen - - - Bartosz Miller - https://github.com/BartoszMiller - - - Ariel Isaac - https://github.com/Ariel-Isaacm - - - Anuraag Agrawal - https://github.com/anuraaga - - - André Gonçalves - https://github.com/andrerigon - - - Andrey - https://github.com/andreyrmg - - - Andrei Solntsev - https://github.com/asolntsev - - - Allan Wang - https://github.com/AllanWang - - - Alex Simkin - https://github.com/SimY4 - - - rberghegger - https://github.com/rberghegger - - - philipa - https://github.com/philipa - - - paulduffin - https://github.com/paulduffin - - - mgrafl - https://github.com/mgrafl - - - jmetertea - https://github.com/jmetertea - - - geoffschoeman - https://github.com/geoffschoeman - - - bruceeddy - https://github.com/bruceeddy - - - ashleyfrieze - https://github.com/ashleyfrieze - - - Nirvanall - https://github.com/Nirvanall - - - LiamClark - https://github.com/LiamClark - - - diff --git a/SOURCES/mockito-junit-jupiter-5.8.0.pom b/SOURCES/mockito-junit-jupiter-5.8.0.pom new file mode 100644 index 0000000..ac4272e --- /dev/null +++ b/SOURCES/mockito-junit-jupiter-5.8.0.pom @@ -0,0 +1,77 @@ + + + 4.0.0 + org.mockito + mockito-junit-jupiter + 5.8.0 + mockito-junit-jupiter + Mockito JUnit 5 support + https://github.com/mockito/mockito + + + MIT + https://opensource.org/licenses/MIT + repo + + + + + mockitoguy + Szczepan Faber + https://github.com/mockitoguy + + Core developer + + + + bric3 + Brice Dutheil + https://github.com/bric3 + + Core developer + + + + raphw + Rafael Winterhalter + https://github.com/raphw + + Core developer + + + + TimvdLippe + Tim van der Lippe + https://github.com/TimvdLippe + + Core developer + + + + + https://github.com/mockito/mockito.git + + + GitHub issues + https://github.com/mockito/mockito/issues + + + GH Actions + https://github.com/mockito/mockito/actions + + + + org.mockito + mockito-core + 5.8.0 + compile + + + org.junit.jupiter + junit-jupiter-api + 5.10.1 + runtime + + + diff --git a/SOURCES/use-unbundled-asm.patch b/SOURCES/use-unbundled-asm.patch index 8914f7d..8ef5534 100644 --- a/SOURCES/use-unbundled-asm.patch +++ b/SOURCES/use-unbundled-asm.patch @@ -1,5 +1,5 @@ diff --git a/src/main/java/org/mockito/internal/creation/bytebuddy/InlineBytecodeGenerator.java b/src/main/java/org/mockito/internal/creation/bytebuddy/InlineBytecodeGenerator.java -index 34b1e89..326a64f 100644 +index 10b73c81a..5e2d8d2dc 100644 --- a/src/main/java/org/mockito/internal/creation/bytebuddy/InlineBytecodeGenerator.java +++ b/src/main/java/org/mockito/internal/creation/bytebuddy/InlineBytecodeGenerator.java @@ -18,8 +18,8 @@ import net.bytebuddy.dynamic.ClassFileLocator; @@ -13,64 +13,83 @@ index 34b1e89..326a64f 100644 import net.bytebuddy.matcher.ElementMatchers; import net.bytebuddy.pool.TypePool; import net.bytebuddy.utility.OpenedClassReader; +diff --git a/src/main/java/org/mockito/internal/creation/bytebuddy/MockMethodAdvice.java b/src/main/java/org/mockito/internal/creation/bytebuddy/MockMethodAdvice.java +index 1490501ea..743a04f36 100644 +--- a/src/main/java/org/mockito/internal/creation/bytebuddy/MockMethodAdvice.java ++++ b/src/main/java/org/mockito/internal/creation/bytebuddy/MockMethodAdvice.java +@@ -37,10 +37,10 @@ import net.bytebuddy.implementation.bind.annotation.Argument; + import net.bytebuddy.implementation.bind.annotation.This; + import net.bytebuddy.implementation.bytecode.StackSize; + import net.bytebuddy.implementation.bytecode.assign.Assigner; +-import net.bytebuddy.jar.asm.Label; +-import net.bytebuddy.jar.asm.MethodVisitor; +-import net.bytebuddy.jar.asm.Opcodes; +-import net.bytebuddy.jar.asm.Type; ++import org.objectweb.asm.Label; ++import org.objectweb.asm.MethodVisitor; ++import org.objectweb.asm.Opcodes; ++import org.objectweb.asm.Type; + import net.bytebuddy.pool.TypePool; + import net.bytebuddy.utility.OpenedClassReader; + diff --git a/src/test/java/org/mockito/internal/creation/bytebuddy/AbstractByteBuddyMockMakerTest.java b/src/test/java/org/mockito/internal/creation/bytebuddy/AbstractByteBuddyMockMakerTest.java -index 2b08c10..a19ffa1 100644 +index 93c8913ac..972753e78 100644 --- a/src/test/java/org/mockito/internal/creation/bytebuddy/AbstractByteBuddyMockMakerTest.java +++ b/src/test/java/org/mockito/internal/creation/bytebuddy/AbstractByteBuddyMockMakerTest.java -@@ -19,6 +19,7 @@ import org.mockito.plugins.MockMaker; - import org.mockito.stubbing.Answer; +@@ -21,6 +21,7 @@ import org.mockito.mock.SerializableMode; + import org.mockito.plugins.MockMaker; import org.mockitoutil.ClassLoaders; import org.mockitoutil.SimpleSerializationUtil; +import org.objectweb.asm.ClassVisitor; import org.objenesis.ObjenesisStd; - import java.io.Serializable; -@@ -138,7 +139,7 @@ public abstract class AbstractByteBuddyMockMakerTest { - public void instantiate_fine_when_objenesis_on_the_classpath() throws Exception { + public abstract class AbstractByteBuddyMockMakerTest +@@ -126,7 +127,7 @@ public abstract class AbstractByteBuddyMockMakerTest // given - ClassLoader classpath_with_objenesis = ClassLoaders.excludingClassLoader() -- .withCodeSourceUrlOf(Mockito.class, ByteBuddy.class, ObjenesisStd.class) -+ .withCodeSourceUrlOf(Mockito.class, ByteBuddy.class, ObjenesisStd.class, ClassVisitor.class) - .withCodeSourceUrlOf(coverageTool()) - .build(); + ClassLoader classpath_with_objenesis = + ClassLoaders.excludingClassLoader() +- .withCodeSourceUrlOf(Mockito.class, ByteBuddy.class, ObjenesisStd.class) ++ .withCodeSourceUrlOf(Mockito.class, ByteBuddy.class, ObjenesisStd.class, ClassVisitor.class) + .withCodeSourceUrlOf(coverageTool()) + .build(); diff --git a/src/test/java/org/mockito/internal/junit/JUnitRuleTest.java b/src/test/java/org/mockito/internal/junit/JUnitRuleTest.java -index 7d5968d..f5c1644 100644 +index f971893e4..63af9cd52 100644 --- a/src/test/java/org/mockito/internal/junit/JUnitRuleTest.java +++ b/src/test/java/org/mockito/internal/junit/JUnitRuleTest.java -@@ -4,6 +4,7 @@ - */ - package org.mockito.internal.junit; +@@ -8,6 +8,7 @@ import static org.junit.Assert.assertTrue; + import static org.mockito.Mockito.mockingDetails; + import static org.mockito.Mockito.when; +import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.mockito.Mock; -@@ -41,6 +42,7 @@ public class JUnitRuleTest { +@@ -42,6 +43,7 @@ public class JUnitRuleTest { @SuppressWarnings({"CheckReturnValue", "MockitoUsage"}) @Test + @Ignore public void does_not_check_invalid_mockito_usage_on_failure() throws Throwable { - //This intended behavior is questionable - //However, it was like that since the beginning of JUnit rule support + // This intended behavior is questionable + // However, it was like that since the beginning of JUnit rule support diff --git a/src/test/java/org/mockitointegration/NoJUnitDependenciesTest.java b/src/test/java/org/mockitointegration/NoJUnitDependenciesTest.java -index 85e0113..64f2083 100644 +index 7b156f0aa..d488e9628 100644 --- a/src/test/java/org/mockitointegration/NoJUnitDependenciesTest.java +++ b/src/test/java/org/mockitointegration/NoJUnitDependenciesTest.java -@@ -12,6 +12,7 @@ import org.junit.Test; +@@ -16,6 +16,7 @@ import org.junit.Test; import org.mockito.Mockito; import org.mockito.internal.configuration.plugins.Plugins; import org.mockitoutil.ClassLoaders; +import org.objectweb.asm.ClassVisitor; import org.objenesis.Objenesis; - import java.util.Set; -@@ -30,6 +31,7 @@ public class NoJUnitDependenciesTest { - Matcher.class, - ByteBuddy.class, - ByteBuddyAgent.class, -+ ClassVisitor.class, - Objenesis.class - ) - .withCodeSourceUrlOf(coverageTool()) + public class NoJUnitDependenciesTest { +@@ -32,6 +33,7 @@ public class NoJUnitDependenciesTest { + Matcher.class, + ByteBuddy.class, + ByteBuddyAgent.class, ++ ClassVisitor.class, + Objenesis.class) + .withCodeSourceUrlOf(coverageTool()) + .without("junit", "org.junit", "org.opentest4j") diff --git a/SPECS/mockito.spec b/SPECS/mockito.spec index b182350..d6f95f0 100644 --- a/SPECS/mockito.spec +++ b/SPECS/mockito.spec @@ -1,33 +1,40 @@ +%bcond_with bootstrap + Name: mockito -Version: 3.1.2 -Release: 2%{?dist} +Version: 5.8.0 +Release: 13%{?dist} Summary: Tasty mocking framework for unit tests in Java License: MIT URL: https://site.mockito.org/ BuildArch: noarch +ExclusiveArch: %{java_arches} noarch -# Source tarball and the script to generate it -Source0: %{name}-%{version}.tar.xz -Source1: make-mockito-sourcetarball.sh - +# ./generate-tarball.sh +Source0: %{name}-%{version}.tar.gz +Source1: generate-tarball.sh # A custom build script to allow building with maven instead of gradle -Source2: mockito-core.pom +Source2: aggregator.pom +# Maven central POMs for subprojects +Source3: https://repo1.maven.org/maven2/org/mockito/mockito-core/%{version}/mockito-core-%{version}.pom +Source4: https://repo1.maven.org/maven2/org/mockito/mockito-junit-jupiter/%{version}/mockito-junit-jupiter-%{version}.pom # Mockito expects byte-buddy to have a shaded/bundled version of ASM, but # we don't bundle in Fedora, so this patch makes mockito use ASM explicitly -Patch0: use-unbundled-asm.patch +Patch: use-unbundled-asm.patch +%if %{with bootstrap} +BuildRequires: javapackages-bootstrap +%else BuildRequires: maven-local BuildRequires: mvn(junit:junit) BuildRequires: mvn(net.bytebuddy:byte-buddy) BuildRequires: mvn(net.bytebuddy:byte-buddy-agent) -BuildRequires: mvn(org.apache.felix:maven-bundle-plugin) -BuildRequires: mvn(org.assertj:assertj-core) -BuildRequires: mvn(org.codehaus.mojo:exec-maven-plugin) -BuildRequires: mvn(org.hamcrest:hamcrest) +BuildRequires: mvn(net.bytebuddy:byte-buddy-dep) +BuildRequires: mvn(org.apache.maven.plugins:maven-antrun-plugin) +BuildRequires: mvn(org.junit.jupiter:junit-jupiter-api) BuildRequires: mvn(org.objenesis:objenesis) BuildRequires: mvn(org.opentest4j:opentest4j) -BuildRequires: mvn(org.ow2.asm:asm) +%endif %description Mockito is a mocking framework that tastes really good. It lets you write @@ -36,36 +43,89 @@ because the tests are very readable and they produce clean verification errors. %package javadoc -Summary: Javadocs for %{name} +Summary: API documentation for %{name} %description javadoc -This package contains the API documentation for %{name}. +API documentation for %{name}. + +%package junit-jupiter +Summary: Mockito JUnit 5 support +Requires: %{name} = %{version}-%{release} + +%description junit-jupiter +Mockito JUnit 5 support. %prep -%setup -q -%patch0 -p1 +%autosetup -p1 -# Use our custom build script -sed -e 's/@VERSION@/%{version}/' %{SOURCE2} > pom.xml +cp %{SOURCE2} aggregator.pom +cp %{SOURCE3} pom.xml +cp %{SOURCE4} subprojects/junit-jupiter/pom.xml -# OGGi metadata configuration -cat > osgi.bnd < + --add-opens=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED" # Compatibility alias %mvn_alias org.%{name}:%{name}-core org.%{name}:%{name}-all -%build -# See the usage of exec-maven-plugin in the pom -javac src/main/java/org/mockito/internal/creation/bytebuddy/inject/MockMethodDispatcher.java +%pom_add_dep junit:junit +%pom_add_dep net.bytebuddy:byte-buddy-dep +%pom_remove_dep org.objenesis:objenesis +%pom_add_dep org.objenesis:objenesis +%pom_add_dep org.opentest4j:opentest4j -%mvn_build -- -Dproject.build.sourceEncoding=UTF-8 +%pom_remove_dep org.junit.jupiter:junit-jupiter-api subprojects/junit-jupiter +%pom_add_dep org.junit.jupiter:junit-jupiter-api subprojects/junit-jupiter + +mkdir -p src/main/resources/mockito-extensions +echo 'member-accessor-module' > src/main/resources/mockito-extensions/org.mockito.plugins.MemberAccessor +echo 'mock-maker-subclass' > src/main/resources/mockito-extensions/org.mockito.plugins.MockMaker + +# see gradle/mockito-core/inline-mock.gradle +%pom_xpath_inject 'pom:project/pom:build/pom:plugins' ' + + org.apache.maven.plugins + maven-antrun-plugin + any + + + process-classes + + + + + + + run + + + + + + org.apache.maven.plugins + maven-jar-plugin + any + + + org/mockito/internal/creation/bytebuddy/inject/*.class + + + +' + +%mvn_package :aggregator __noinstall + +%build +%mvn_build -f -- -Dmaven.compiler.release=11 -Dproject.build.sourceEncoding=UTF-8 -f aggregator.pom + +%mvn_package org.mockito:mockito-junit-jupiter junit-jupiter %install %mvn_install @@ -77,7 +137,99 @@ javac src/main/java/org/mockito/internal/creation/bytebuddy/inject/MockMethodDis %files javadoc -f .mfiles-javadoc %license LICENSE +%files junit-jupiter -f .mfiles-junit-jupiter + %changelog +* Fri Nov 29 2024 Mikolaj Izdebski - 5.8.0-11 +- Update javapackages test plan to f42 + +* Thu Jul 18 2024 Fedora Release Engineering - 5.8.0-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Tue Feb 27 2024 Jiri Vanek - 5.8.0-5 +- Rebuilt for java-21-openjdk as system jdk + +* Fri Feb 23 2024 Jiri Vanek - 5.8.0-4 +- bump of release for for java-21-openjdk as system jdk + +* Thu Jan 25 2024 Fedora Release Engineering - 5.8.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Sun Jan 21 2024 Fedora Release Engineering - 5.8.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Wed Dec 13 2023 Marian Koncek - 5.8.0-1 +- Update to upstream version 5.8.0 + +* Fri Sep 01 2023 Marian Koncek - 5.5.0-1 +- Update to upstream version 5.5.0 + +* Thu Jul 20 2023 Fedora Release Engineering - 3.12.4-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Thu Jan 19 2023 Fedora Release Engineering - 3.12.4-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Thu Jul 21 2022 Fedora Release Engineering - 3.12.4-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Sat Apr 09 2022 Didik Supriadi - 3.12.4-4 +- Set javac compiler release to Java 8 + +* Sat Feb 05 2022 Jiri Vanek - 3.12.4-3 +- Rebuilt for java-17-openjdk as system jdk + +* Thu Jan 27 2022 Mikolaj Izdebski - 3.12.4-2 +- Don't build mockito-junit-jupiter in bootstrap mode + +* Sat Jan 22 2022 Jerry James - 3.12.4-1 +- Version 3.12.4 +- Add inline and junit-jupiter subpackages +- Drop OpenJDK 17 workarounds + +* Thu Jan 20 2022 Fedora Release Engineering - 3.7.13-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Wed Nov 03 2021 Mikolaj Izdebski - 3.7.13-4 +- Workaround build issue with OpenJDK 17 + +* Thu Jul 22 2021 Fedora Release Engineering - 3.7.13-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Mon May 17 2021 Mikolaj Izdebski - 3.7.13-2 +- Bootstrap build +- Non-bootstrap build + +* Thu Feb 04 2021 Marian Koncek - 3.7.13-1 +- Update to upstream version 3.7.13 + +* Tue Jan 26 2021 Fedora Release Engineering - 3.5.13-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Fri Oct 9 2020 Stuart Gathman - 3.5.13-1 +- Update to version 3.5.13 + +* Wed Sep 30 2020 Marian Koncek - 3.5.13-1 +- Update to ustream version 3.5.13 + +* Sun Aug 23 2020 Jerry James - 3.5.5-1 +- Update to version 3.5.5 + +* Fri Aug 14 2020 Jerry James - 2.28.2-1 +- Update to version 2.28.2 + +* Tue Jul 28 2020 Fedora Release Engineering - 2.23.9-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Wed Jul 22 2020 Marian Koncek - 3.4.5-1 +- Update to upstream version 3.4.5 + +* Sat Jul 11 2020 Jiri Vanek - 2.23.9-7 +- Rebuilt for JDK-11, see https://fedoraproject.org/wiki/Changes/Java11 + +* Wed Jan 29 2020 Fedora Release Engineering - 2.23.9-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + * Tue Nov 05 2019 Mikolaj Izdebski - 3.1.2-2 - Mass rebuild for javapackages-tools 201902 @@ -87,9 +239,15 @@ javac src/main/java/org/mockito/internal/creation/bytebuddy/inject/MockMethodDis * Thu Sep 19 2019 Marian Koncek - 3.0.8-1 - Update to upstream version 3.0.8 +* Thu Jul 25 2019 Fedora Release Engineering - 2.23.9-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + * Fri May 24 2019 Mikolaj Izdebski - 2.23.9-4 - Mass rebuild for javapackages-tools 201901 +* Fri Feb 01 2019 Fedora Release Engineering - 2.23.9-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + * Wed Dec 12 2018 Mat Booth - 2.23.9-3 - Set the source encoding for the build