Compare commits

...

No commits in common. 'c9' and 'stream-javapackages-tools-202201-rhel-9.1.0' have entirely different histories.

8
.gitignore vendored

@ -1 +1,7 @@
SOURCES/mockito-3.7.13.tar.gz
/mockito-*.tar.xz
/.build-*.log
/noarch/
/*.src.rpm
/mockito-3.5.13.tar.gz
/mockito-3.7.13.tar.gz
/mockito-3.12.4.tar.gz

@ -1 +0,0 @@
e95d6ff6732c8b2e2ff61ca4e68b89f5ff2539f9 SOURCES/mockito-3.7.13.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>

@ -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>

@ -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>

@ -1,12 +1,13 @@
%bcond_with bootstrap
Name: mockito
Version: 3.7.13
Version: 3.12.4
Release: 5%{?dist}
Summary: Tasty mocking framework for unit tests in Java
License: MIT
URL: https://site.mockito.org/
BuildArch: noarch
ExclusiveArch: %{java_arches} noarch
# ./generate-tarball.sh
Source0: %{name}-%{version}.tar.gz
@ -15,20 +16,27 @@ 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
BuildRequires: maven-local
%if %{with bootstrap}
BuildRequires: javapackages-bootstrap
%else
BuildRequires: maven-local
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,9 +54,25 @@ 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).
%if %{without bootstrap}
%package junit-jupiter
Summary: Mockito JUnit 5 support
Requires: %{name} = %{version}-%{release}
%description junit-jupiter
Mockito JUnit 5 support.
%endif
%prep
%setup -q
%patch0 -p1
%autosetup -p1
# Disable failing test
# TODO check status: https://github.com/mockito/mockito/issues/2162
@ -57,7 +81,12 @@ sed -i '/add_listeners_concurrently_sanity_check/i @org.junit.Ignore' src/test/j
# Use our custom build script
sed -e 's/@VERSION@/%{version}/' %{SOURCE2} > pom.xml
# OGGi metadata configuration
# Workaround easymock incompatibility with Java 17 that should be fixed
# in easymock 4.4: https://github.com/easymock/easymock/issues/274
%pom_add_plugin :maven-surefire-plugin . "<configuration>
<argLine>--add-opens=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED</argLine></configuration>"
# OSGi metadata configuration
cat > osgi.bnd <<EOF
Automatic-Module-Name: org.mockito
Bundle-SymbolicName: org.mockito
@ -67,18 +96,50 @@ 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/
javac -d target/classes/ src/main/java/org/mockito/internal/creation/bytebuddy/inject/MockMethodDispatcher.java
javac --release 8 -d target/classes/ src/main/java/org/mockito/internal/creation/bytebuddy/inject/MockMethodDispatcher.java
mv target/classes/org/mockito/internal/creation/bytebuddy/inject/MockMethodDispatcher.{class,raw}
%mvn_build -- -Dproject.build.sourceEncoding=UTF-8
%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
%if %{without bootstrap}
# 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 --release 8 -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
%endif
%install
%mvn_install
@ -87,19 +148,41 @@ 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
%if %{without bootstrap}
%files junit-jupiter -f .mfiles-junit-jupiter
%endif
%files javadoc -f .mfiles-javadoc
%license LICENSE
%changelog
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 3.7.13-5
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 3.12.4-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Sat Apr 09 2022 Didik Supriadi <didiksupriadi41@fedoraproject.org> - 3.12.4-4
- Set javac compiler release to Java 8
* Sat Feb 05 2022 Jiri Vanek <jvanek@redhat.com> - 3.12.4-3
- Rebuilt for java-17-openjdk as system jdk
* Thu Jan 27 2022 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.12.4-2
- Don't build mockito-junit-jupiter in bootstrap mode
* 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
* Wed Jun 09 2021 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.7.13-4
- Rebuild to workaround DistroBaker issue
* Wed Nov 03 2021 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.7.13-4
- Workaround build issue with OpenJDK 17
* Tue Jun 08 2021 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.7.13-3
- Bootstrap Maven for CentOS Stream 9
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.13-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Mon May 17 2021 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.7.13-2
- Bootstrap build

@ -0,0 +1 @@
SHA512 (mockito-3.12.4.tar.gz) = 3c0bc50a533bfd6626b993567fb585666a839ed408d51bfdd0b6d0b62a1fe6ba1678c7d2f2af4df7f3176bd2ff4ca94a166cd0c1b43ea993beefa3e30f1bc792

@ -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…
Cancel
Save