Version 3.12.4
- Add inline and junit-jupiter subpackages - Drop OpenJDK 17 workarounds
This commit is contained in:
parent
acc6bab7e8
commit
2750dc3c59
1
.gitignore
vendored
1
.gitignore
vendored
@ -4,3 +4,4 @@
|
||||
/*.src.rpm
|
||||
/mockito-3.5.13.tar.gz
|
||||
/mockito-3.7.13.tar.gz
|
||||
/mockito-3.12.4.tar.gz
|
||||
|
@ -20,19 +20,19 @@
|
||||
<dependency>
|
||||
<groupId>net.bytebuddy</groupId>
|
||||
<artifactId>byte-buddy</artifactId>
|
||||
<version>1.9.3</version>
|
||||
<version>1.11.13</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.bytebuddy</groupId>
|
||||
<artifactId>byte-buddy-agent</artifactId>
|
||||
<version>1.9.3</version>
|
||||
<version>1.11.13</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.objenesis</groupId>
|
||||
<artifactId>objenesis</artifactId>
|
||||
<version>3.1</version>
|
||||
<version>3.2</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@ -50,13 +50,13 @@
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.12</version>
|
||||
<version>4.13.2</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.assertj</groupId>
|
||||
<artifactId>assertj-core</artifactId>
|
||||
<version>3.13.2</version>
|
||||
<version>3.20.2</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
71
mockito-inline-3.12.4.pom
Normal file
71
mockito-inline-3.12.4.pom
Normal file
@ -0,0 +1,71 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-inline</artifactId>
|
||||
<version>3.12.4</version>
|
||||
<name>mockito-inline</name>
|
||||
<description>Mockito preconfigured inline mock maker (intermediate and to be superseeded by automatic usage in a future version)</description>
|
||||
<url>https://github.com/mockito/mockito</url>
|
||||
<licenses>
|
||||
<license>
|
||||
<name>The MIT License</name>
|
||||
<url>https://github.com/mockito/mockito/blob/main/LICENSE</url>
|
||||
<distribution>repo</distribution>
|
||||
</license>
|
||||
</licenses>
|
||||
<developers>
|
||||
<developer>
|
||||
<id>mockitoguy</id>
|
||||
<name>Szczepan Faber</name>
|
||||
<url>https://github.com/mockitoguy</url>
|
||||
<roles>
|
||||
<role>Core developer</role>
|
||||
</roles>
|
||||
</developer>
|
||||
<developer>
|
||||
<id>bric3</id>
|
||||
<name>Brice Dutheil</name>
|
||||
<url>https://github.com/bric3</url>
|
||||
<roles>
|
||||
<role>Core developer</role>
|
||||
</roles>
|
||||
</developer>
|
||||
<developer>
|
||||
<id>raphw</id>
|
||||
<name>Rafael Winterhalter</name>
|
||||
<url>https://github.com/raphw</url>
|
||||
<roles>
|
||||
<role>Core developer</role>
|
||||
</roles>
|
||||
</developer>
|
||||
<developer>
|
||||
<id>TimvdLippe</id>
|
||||
<name>Tim van der Lippe</name>
|
||||
<url>https://github.com/TimvdLippe</url>
|
||||
<roles>
|
||||
<role>Core developer</role>
|
||||
</roles>
|
||||
</developer>
|
||||
</developers>
|
||||
<scm>
|
||||
<url>https://github.com/mockito/mockito.git</url>
|
||||
</scm>
|
||||
<issueManagement>
|
||||
<system>GitHub issues</system>
|
||||
<url>https://github.com/mockito/mockito/issues</url>
|
||||
</issueManagement>
|
||||
<ciManagement>
|
||||
<system>GH Actions</system>
|
||||
<url>https://github.com/mockito/mockito/actions</url>
|
||||
</ciManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<version>3.12.4</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
77
mockito-junit-jupiter-3.12.4.pom
Normal file
77
mockito-junit-jupiter-3.12.4.pom
Normal file
@ -0,0 +1,77 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-junit-jupiter</artifactId>
|
||||
<version>3.12.4</version>
|
||||
<name>mockito-junit-jupiter</name>
|
||||
<description>Mockito JUnit 5 support</description>
|
||||
<url>https://github.com/mockito/mockito</url>
|
||||
<licenses>
|
||||
<license>
|
||||
<name>The MIT License</name>
|
||||
<url>https://github.com/mockito/mockito/blob/main/LICENSE</url>
|
||||
<distribution>repo</distribution>
|
||||
</license>
|
||||
</licenses>
|
||||
<developers>
|
||||
<developer>
|
||||
<id>mockitoguy</id>
|
||||
<name>Szczepan Faber</name>
|
||||
<url>https://github.com/mockitoguy</url>
|
||||
<roles>
|
||||
<role>Core developer</role>
|
||||
</roles>
|
||||
</developer>
|
||||
<developer>
|
||||
<id>bric3</id>
|
||||
<name>Brice Dutheil</name>
|
||||
<url>https://github.com/bric3</url>
|
||||
<roles>
|
||||
<role>Core developer</role>
|
||||
</roles>
|
||||
</developer>
|
||||
<developer>
|
||||
<id>raphw</id>
|
||||
<name>Rafael Winterhalter</name>
|
||||
<url>https://github.com/raphw</url>
|
||||
<roles>
|
||||
<role>Core developer</role>
|
||||
</roles>
|
||||
</developer>
|
||||
<developer>
|
||||
<id>TimvdLippe</id>
|
||||
<name>Tim van der Lippe</name>
|
||||
<url>https://github.com/TimvdLippe</url>
|
||||
<roles>
|
||||
<role>Core developer</role>
|
||||
</roles>
|
||||
</developer>
|
||||
</developers>
|
||||
<scm>
|
||||
<url>https://github.com/mockito/mockito.git</url>
|
||||
</scm>
|
||||
<issueManagement>
|
||||
<system>GitHub issues</system>
|
||||
<url>https://github.com/mockito/mockito/issues</url>
|
||||
</issueManagement>
|
||||
<ciManagement>
|
||||
<system>GH Actions</system>
|
||||
<url>https://github.com/mockito/mockito/actions</url>
|
||||
</ciManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<version>3.12.4</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-api</artifactId>
|
||||
<version>5.7.2</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
81
mockito.spec
81
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 . "<configuration>
|
||||
<argLine>--add-opens=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED</argLine></configuration>"
|
||||
|
||||
# OGGi metadata configuration
|
||||
# OSGi metadata configuration
|
||||
cat > osgi.bnd <<EOF
|
||||
Automatic-Module-Name: org.mockito
|
||||
Bundle-SymbolicName: org.mockito
|
||||
@ -79,11 +93,19 @@ Private-Package: org.mockito.*
|
||||
-removeheaders: Bnd-LastModified,Include-Resource,Private-Package
|
||||
EOF
|
||||
|
||||
# OSGi metadata configuration for the junit-jupiter jar
|
||||
cat > osgi-junit-jupiter.bnd <<EOF
|
||||
Automatic-Module-Name: org.mockito.junit.jupiter
|
||||
Bundle-SymbolicName: org.mockito.junit-jupiter
|
||||
Bundle-Name: Mockito Extension Library for JUnit 5.
|
||||
Import-Package: org.junit.jupiter.api.extension;version="[5.7,6)",org.junit.platform.commons.support;version="[1.7,2)",org.mockito*;version="%{version}",*
|
||||
-removeheaders: Bnd-LastModified,Include-Resource
|
||||
Export-Package: org.mockito.junit.jupiter;version="%{version}";uses:="org.junit.jupiter.api.extension,org.mockito.quality"
|
||||
EOF
|
||||
|
||||
# Compatibility alias
|
||||
%mvn_alias org.%{name}:%{name}-core org.%{name}:%{name}-all
|
||||
|
||||
sed -i 's/net\.bytebuddy\.jar\.asm/org.objectweb.asm/' src/main/java/org/mockito/internal/creation/bytebuddy/MockMethodAdvice.java
|
||||
|
||||
%build
|
||||
# See the usage of exec-maven-plugin in the pom
|
||||
mkdir -p target/classes/
|
||||
@ -92,6 +114,28 @@ mv target/classes/org/mockito/internal/creation/bytebuddy/inject/MockMethodDispa
|
||||
|
||||
%mvn_build -f -- -Dproject.build.sourceEncoding=UTF-8
|
||||
|
||||
# Build the inline subproject
|
||||
cd subprojects/inline/src/main/resources
|
||||
jar cf ../../../../../target/mockito-inline.jar mockito-extensions
|
||||
cd -
|
||||
%mvn_artifact %{SOURCE3} target/mockito-inline.jar
|
||||
%mvn_package org.mockito:mockito-inline inline
|
||||
|
||||
# Build the junit-jupiter subproject
|
||||
cd subprojects/junit-jupiter
|
||||
mkdir -p target/classes/
|
||||
CLASSPATH=$(build-classpath apiguardian junit5/junit-jupiter-api junit5/junit-platform-commons)
|
||||
javac -d target/classes/ \
|
||||
-cp ../../target/mockito-core-%{version}.jar:$CLASSPATH \
|
||||
src/main/java/org/mockito/junit/jupiter/*.java
|
||||
jar -cf ../../target/mockito-junit-jupiter.unwrapped.jar -C target/classes org
|
||||
cd -
|
||||
bnd wrap --properties osgi-junit-jupiter.bnd --version %{version} \
|
||||
--output target/mockito-junit-jupiter.jar \
|
||||
target/mockito-junit-jupiter.unwrapped.jar
|
||||
%mvn_artifact %{SOURCE4} target/mockito-junit-jupiter.jar
|
||||
%mvn_package org.mockito:mockito-junit-jupiter junit-jupiter
|
||||
|
||||
%install
|
||||
%mvn_install
|
||||
|
||||
@ -99,10 +143,19 @@ mv target/classes/org/mockito/internal/creation/bytebuddy/inject/MockMethodDispa
|
||||
%license LICENSE
|
||||
%doc README.md doc/design-docs/custom-argument-matching.md
|
||||
|
||||
%files inline -f .mfiles-inline
|
||||
|
||||
%files junit-jupiter -f .mfiles-junit-jupiter
|
||||
|
||||
%files javadoc -f .mfiles-javadoc
|
||||
%license LICENSE
|
||||
|
||||
%changelog
|
||||
* Sat Jan 22 2022 Jerry James <loganjerry@gmail.com> - 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 <releng@fedoraproject.org> - 3.7.13-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
|
||||
|
||||
|
2
sources
2
sources
@ -1 +1 @@
|
||||
SHA512 (mockito-3.7.13.tar.gz) = 96092dd0e2b872229a5f5a77b7d505d5f0a3a93beb7f67c9251ad1446d17c2984474cb75dc4191e2d64ab5070ac251e015615f4b88ba2b0c9fbb1a0d9a84500c
|
||||
SHA512 (mockito-3.12.4.tar.gz) = 09d76f8e7ac0ca63ddcde6d38204e12059d0478483b195a34edee213eaf04fc4c5ce61031851ee5b7ca6960a7804b638b18429ddf1c94ef4927d445f261f94ee
|
||||
|
@ -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<MM extends MockMaker> {
|
||||
@@ -154,7 +155,7 @@ public abstract class AbstractByteBuddyMockMakerTest<MM extends MockMaker> {
|
||||
public abstract class AbstractByteBuddyMockMakerTest<MM extends MockMaker>
|
||||
@@ -126,7 +127,7 @@ public abstract class AbstractByteBuddyMockMakerTest<MM extends MockMaker>
|
||||
// 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;
|
||||
|
Loading…
Reference in New Issue
Block a user