From 2750dc3c5912236f2261f838e5386bf26d3a9620 Mon Sep 17 00:00:00 2001 From: Jerry James Date: Sun, 23 Jan 2022 16:30:03 -0700 Subject: [PATCH] Version 3.12.4 - Add inline and junit-jupiter subpackages - Drop OpenJDK 17 workarounds --- .gitignore | 1 + mockito-core.pom | 10 ++-- mockito-inline-3.12.4.pom | 71 ++++++++++++++++++++++++++++ mockito-junit-jupiter-3.12.4.pom | 77 ++++++++++++++++++++++++++++++ mockito.spec | 81 ++++++++++++++++++++++++++------ sources | 2 +- use-unbundled-asm.patch | 37 +++++++++++---- 7 files changed, 250 insertions(+), 29 deletions(-) create mode 100644 mockito-inline-3.12.4.pom create mode 100644 mockito-junit-jupiter-3.12.4.pom diff --git a/.gitignore b/.gitignore index 6783466..5e65016 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ /*.src.rpm /mockito-3.5.13.tar.gz /mockito-3.7.13.tar.gz +/mockito-3.12.4.tar.gz diff --git a/mockito-core.pom b/mockito-core.pom index e305fc9..c29986a 100644 --- a/mockito-core.pom +++ b/mockito-core.pom @@ -20,19 +20,19 @@ net.bytebuddy byte-buddy - 1.9.3 + 1.11.13 compile net.bytebuddy byte-buddy-agent - 1.9.3 + 1.11.13 compile org.objenesis objenesis - 3.1 + 3.2 compile @@ -50,13 +50,13 @@ junit junit - 4.12 + 4.13.2 provided org.assertj assertj-core - 3.13.2 + 3.20.2 test diff --git a/mockito-inline-3.12.4.pom b/mockito-inline-3.12.4.pom new file mode 100644 index 0000000..d201ef9 --- /dev/null +++ b/mockito-inline-3.12.4.pom @@ -0,0 +1,71 @@ + + + 4.0.0 + org.mockito + mockito-inline + 3.12.4 + mockito-inline + Mockito preconfigured inline mock maker (intermediate and to be superseeded by automatic usage in a future version) + https://github.com/mockito/mockito + + + The MIT License + https://github.com/mockito/mockito/blob/main/LICENSE + 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 + 3.12.4 + compile + + + diff --git a/mockito-junit-jupiter-3.12.4.pom b/mockito-junit-jupiter-3.12.4.pom new file mode 100644 index 0000000..37a0867 --- /dev/null +++ b/mockito-junit-jupiter-3.12.4.pom @@ -0,0 +1,77 @@ + + + 4.0.0 + org.mockito + mockito-junit-jupiter + 3.12.4 + mockito-junit-jupiter + Mockito JUnit 5 support + https://github.com/mockito/mockito + + + The MIT License + https://github.com/mockito/mockito/blob/main/LICENSE + 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 + 3.12.4 + compile + + + org.junit.jupiter + junit-jupiter-api + 5.7.2 + runtime + + + diff --git a/mockito.spec b/mockito.spec index 59e36b3..ce1eb38 100644 --- a/mockito.spec +++ b/mockito.spec @@ -1,8 +1,8 @@ %bcond_with bootstrap Name: mockito -Version: 3.7.13 -Release: 5%{?dist} +Version: 3.12.4 +Release: 1%{?dist} Summary: Tasty mocking framework for unit tests in Java License: MIT URL: https://site.mockito.org/ @@ -15,6 +15,10 @@ Source1: generate-tarball.sh # A custom build script to allow building with maven instead of gradle Source2: mockito-core.pom +# Maven central POMs for subprojects +Source3: https://repo1.maven.org/maven2/org/mockito/mockito-inline/%{version}/mockito-inline-%{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 @@ -23,12 +27,15 @@ BuildRequires: maven-local %if %{with bootstrap} BuildRequires: javapackages-bootstrap %else +BuildRequires: mvn(biz.aQute.bnd:biz.aQute.bnd) 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.apiguardian:apiguardian-api) BuildRequires: mvn(org.assertj:assertj-core) BuildRequires: mvn(org.hamcrest:hamcrest) +BuildRequires: mvn(org.junit.jupiter:junit-jupiter-api) BuildRequires: mvn(org.objenesis:objenesis) BuildRequires: mvn(org.opentest4j:opentest4j) BuildRequires: mvn(org.ow2.asm:asm) @@ -46,21 +53,28 @@ Summary: Javadocs for %{name} %description javadoc This package contains the API documentation for %{name}. +%package inline +Summary: Mockito preconfigured inline mock maker +Requires: %{name} = %{version}-%{release} + +%description inline +Mockito preconfigured inline mock maker (intermediate and to be +superseded by automatic usage in a future version). + +%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 # Disable failing test # TODO check status: https://github.com/mockito/mockito/issues/2162 sed -i '/add_listeners_concurrently_sanity_check/i @org.junit.Ignore' src/test/java/org/mockitousage/debugging/StubbingLookupListenerCallbackTest.java -# When ran under OpenJDK 17 test fails with "Access to private -# java.lang.String java.io.ObjectStreamClass.name was denied" error -rm src/test/java/org/mockitousage/serialization/AcrossClassLoaderSerializationTest.java - -# These tests fail for unknown reason under OpenJDK 17 -rm src/test/java/org/mockitousage/stubbing/CloningParameterTest.java - # Use our custom build script sed -e 's/@VERSION@/%{version}/' %{SOURCE2} > pom.xml @@ -69,7 +83,7 @@ sed -e 's/@VERSION@/%{version}/' %{SOURCE2} > pom.xml %pom_add_plugin :maven-surefire-plugin . " --add-opens=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED" -# OGGi metadata configuration +# OSGi metadata configuration cat > osgi.bnd < osgi-junit-jupiter.bnd < - 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 diff --git a/sources b/sources index 3e924cd..25b135c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (mockito-3.7.13.tar.gz) = 96092dd0e2b872229a5f5a77b7d505d5f0a3a93beb7f67c9251ad1446d17c2984474cb75dc4191e2d64ab5070ac251e015615f4b88ba2b0c9fbb1a0d9a84500c +SHA512 (mockito-3.12.4.tar.gz) = 09d76f8e7ac0ca63ddcde6d38204e12059d0478483b195a34edee213eaf04fc4c5ce61031851ee5b7ca6960a7804b638b18429ddf1c94ef4927d445f261f94ee diff --git a/use-unbundled-asm.patch b/use-unbundled-asm.patch index 9edcf60..8ef5534 100644 --- a/use-unbundled-asm.patch +++ b/use-unbundled-asm.patch @@ -1,8 +1,8 @@ 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 187f1ea..f8fa355 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 -@@ -30,8 +30,8 @@ import net.bytebuddy.dynamic.ClassFileLocator; +@@ -18,8 +18,8 @@ import net.bytebuddy.dynamic.ClassFileLocator; import net.bytebuddy.dynamic.scaffold.MethodGraph; import net.bytebuddy.dynamic.scaffold.TypeValidation; import net.bytebuddy.implementation.Implementation; @@ -13,19 +13,38 @@ index 187f1ea..f8fa355 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 f5b807a..c9ca662 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 -@@ -26,6 +26,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; - public abstract class AbstractByteBuddyMockMakerTest { -@@ -154,7 +155,7 @@ public abstract class AbstractByteBuddyMockMakerTest { + public abstract class AbstractByteBuddyMockMakerTest +@@ -126,7 +127,7 @@ public abstract class AbstractByteBuddyMockMakerTest // given ClassLoader classpath_with_objenesis = ClassLoaders.excludingClassLoader() @@ -35,7 +54,7 @@ index f5b807a..c9ca662 100644 .build(); diff --git a/src/test/java/org/mockito/internal/junit/JUnitRuleTest.java b/src/test/java/org/mockito/internal/junit/JUnitRuleTest.java -index f971893..63af9cd 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 @@ -8,6 +8,7 @@ import static org.junit.Assert.assertTrue; @@ -55,7 +74,7 @@ index f971893..63af9cd 100644 // 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 9cd47da..356a3e0 100644 +index 7b156f0aa..d488e9628 100644 --- a/src/test/java/org/mockitointegration/NoJUnitDependenciesTest.java +++ b/src/test/java/org/mockitointegration/NoJUnitDependenciesTest.java @@ -16,6 +16,7 @@ import org.junit.Test;