summaryrefslogtreecommitdiff
path: root/dev-java/mockito
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-04-07 11:29:55 +0100
committerV3n3RiX <venerix@koprulu.sector>2023-04-07 11:29:55 +0100
commita17b25a10359070f9527893d861369d378021aa9 (patch)
tree02188942c1da9eb507b509fbd36c9b7a5aff86c8 /dev-java/mockito
parentefbb52742172c497c5245486906aade0fb6220e8 (diff)
gentoo auto-resync : 07:04:2023 - 11:29:55
Diffstat (limited to 'dev-java/mockito')
-rw-r--r--dev-java/mockito/Manifest3
-rw-r--r--dev-java/mockito/files/mockito-2.28.2-skip-failing-tests.patch82
-rw-r--r--dev-java/mockito/mockito-2.28.2.ebuild103
3 files changed, 188 insertions, 0 deletions
diff --git a/dev-java/mockito/Manifest b/dev-java/mockito/Manifest
index 341c61a86ac2..ca8d3a3d1bd2 100644
--- a/dev-java/mockito/Manifest
+++ b/dev-java/mockito/Manifest
@@ -1,5 +1,8 @@
+AUX mockito-2.28.2-skip-failing-tests.patch 2622 BLAKE2B 70862d1fe8376ad2514fa53c15e1f6e83dde17d7ff1a8a09701897d89b27ca6a339c532b2615436da727b10c8ec69a0fadda5c841ebb64be12fbd8e8ded6b5ad SHA512 646649ec712b958f02c862ee8d2a52259e5458812f838d9d2622544154c35270a5f5a731c8193850fc804ede87fde1a7d54abef8d4136b5619ac01664f9539e8
+DIST mockito-2.28.2.tar.gz 875085 BLAKE2B d0aab378c028530724156f999700506fe64f5bf19371dc9b957e34924d3d17b8191f093054c6dde4f5879d61ddf9614a60b1fd597aae09b92abf559c08fbcdf7 SHA512 9921fe9ffbdff4d7a9a8de56aa5078e68eb6bee38f379f58059dcc42da07a59b7e5953309d646e1fb760f7135f5076e201529370cc5df56d685f7acb08311ea5
DIST mockito-4.11.0.tar.gz 1050218 BLAKE2B 7f7298e233c9cdb0b475aa201300a1063fd8efc587f3a4de0cb1caedd6f6506a32f8e9b0548fa5898892515ec96625153a1a2ad65fc8070b7dc6c254206fbbfd SHA512 b1de01c8e9b2fc4eef0013af562efeac7e22babdebbd8c7842ecd55071627e11c5e6ab575436990ea70d4ceefb56fc260333278c8d4b833e454956bf89841fc5
DIST mockito-core-1.9.5-sources.jar 723074 BLAKE2B e553a923542a1a2574ee0cda5979d168cc3e9644dbbc9fceed2301ae1bac150c4e35dbc4432d50e2479efea2a6cd35ec19c62c3598f61709f1f5dc8959cc0155 SHA512 271e626c3b5be9a7d7c82a2f0bf44077aabd51924b0956a88633ace7fe8c134d8cd1f89ce348ce0d15ccce55a50027e303836d2d2f430500317b6136d308d3d4
EBUILD mockito-1.9.5-r3.ebuild 713 BLAKE2B d46334ba15f68eef38b979b4c8bd84ad51fdfd61f2d33f77f3230876802c753a6fdbbb0422edae5de79f931b314c7bfbc63266de9dabbc9327ed7b1a302d517a SHA512 73886d139804085b34e67902a67af34358c7abd1083bbd2e21d6cec7b149d273307312d42351236fe6628e237685c4e1f62bcfc7333e1af32017fb97183e7f34
+EBUILD mockito-2.28.2.ebuild 3325 BLAKE2B 482449d78d6f9f254ace1d669981f766423e5d38351d4c794b38875bdd6b80668db8fd6a636f0d3202b7216cb70fda81ebd587dc2f9bf60cf9f23561d336cce2 SHA512 ac0109f40d058dd98975478d420f95a85f9bee75fbc24e5fa630a89aaca1871f696876434cebacdbda380f2f64c607742948193e93751fdb0c3a98e9b326e9e2
EBUILD mockito-4.11.0.ebuild 1237 BLAKE2B baf80f24433502cae15d281ca1f2f020c22c3dd82d8a4e0068ceb6f82e0c336b2b6fc65ea77e3eab305c3402d73326886d8a166de38c2b67a5a5c121ff6d1fba SHA512 e23720020cfd5047ae59927a66dc8d2a709b50f47b71035493e06ec1fc2b83dac08bbdacd06fb131d610047e7f55f91cefcff1be28ec8b65f08407b2eb1647a5
MISC metadata.xml 317 BLAKE2B 209b27a429c1fdeca71c1e215f8fc43bfc66c961b1a3ad3dfcda16d5ea1df51e54cea248f4f152966aa1f91059b91c21fb734c6995f8033150dbda5e1813d121 SHA512 1f7be64d432b4004d2bbf1ec2c6776ec8618875356ea0308b8409f322d48bf3440d692732406ddb3fa7a273c9754c4cc5a6f6cd9808348d0ba8beb7159887a5b
diff --git a/dev-java/mockito/files/mockito-2.28.2-skip-failing-tests.patch b/dev-java/mockito/files/mockito-2.28.2-skip-failing-tests.patch
new file mode 100644
index 000000000000..06bf5bcd6346
--- /dev/null
+++ b/dev-java/mockito/files/mockito-2.28.2-skip-failing-tests.patch
@@ -0,0 +1,82 @@
+# https://bugs.gentoo.org/903897
+--- a/src/test/java/org/mockito/internal/creation/bytebuddy/AbstractByteBuddyMockMakerTest.java
++++ b/src/test/java/org/mockito/internal/creation/bytebuddy/AbstractByteBuddyMockMakerTest.java
+@@ -6,6 +6,7 @@ package org.mockito.internal.creation.bytebuddy;
+
+ import net.bytebuddy.ByteBuddy;
+ import org.junit.Test;
++import org.junit.Ignore;
+ import org.mockito.Mockito;
+ import org.mockito.internal.creation.MockSettingsImpl;
+ import org.mockito.internal.handler.MockHandlerImpl;
+@@ -134,7 +135,7 @@ public abstract class AbstractByteBuddyMockMakerTest<MM extends MockMaker> {
+ }
+ }
+
+- @Test
++ @Test @Ignore
+ public void instantiate_fine_when_objenesis_on_the_classpath() throws Exception {
+ // given
+ ClassLoader classpath_with_objenesis = ClassLoaders.excludingClassLoader()
+--- a/src/test/java/org/mockitousage/matchers/VarargsTest.java
++++ b/src/test/java/org/mockitousage/matchers/VarargsTest.java
+@@ -19,6 +19,7 @@ import org.assertj.core.api.ObjectAssert;
+ import org.junit.Ignore;
+ import org.junit.Rule;
+ import org.junit.Test;
++import org.junit.Ignore;
+ import org.junit.rules.ExpectedException;
+ import org.mockito.ArgumentCaptor;
+ import org.mockito.Captor;
+@@ -78,7 +79,7 @@ public class VarargsTest {
+ verify(mock).varargs((String[]) isNotNull());
+ }
+
+- @Test
++ @Test @Ignore
+ public void shouldMatchVarArgs_oneNullArg_eqNull() {
+ Object arg = null;
+ mock.varargs(arg);
+@@ -86,7 +87,7 @@ public class VarargsTest {
+ verify(mock).varargs(eq(null));
+ }
+
+- @Test
++ @Test @Ignore
+ public void shouldMatchVarArgs_oneNullArg_isNull() {
+ Object arg = null;
+ mock.varargs(arg);
+@@ -94,7 +95,7 @@ public class VarargsTest {
+ verify(mock).varargs(isNull());
+ }
+
+- @Test
++ @Test @Ignore
+ public void shouldMatchVarArgs_nullArrayArg() {
+ Object[] argArray = null;
+ mock.varargs(argArray);
+@@ -118,21 +119,21 @@ public class VarargsTest {
+ verify(mock).varargs((String[])any()); // any() -> VarargMatcher
+ }
+
+- @Test
++ @Test @Ignore
+ public void shouldMatchVarArgs_oneArgsOneAnyMatcher() {
+ mock.varargs(1);
+
+ verify(mock).varargs(any()); // any() -> VarargMatcher
+ }
+
+- @Test
++ @Test @Ignore
+ public void shouldMatchVarArgs_twoArgsOneAnyMatcher() {
+ mock.varargs(1, 2);
+
+ verify(mock).varargs(any()); // any() -> VarargMatcher
+ }
+
+- @Test
++ @Test @Ignore
+ public void shouldMatchVarArgs_twoArgsTwoAnyMatcher() {
+ mock.varargs(1, 2);
+
diff --git a/dev-java/mockito/mockito-2.28.2.ebuild b/dev-java/mockito/mockito-2.28.2.ebuild
new file mode 100644
index 000000000000..c055b2705a67
--- /dev/null
+++ b/dev-java/mockito/mockito-2.28.2.ebuild
@@ -0,0 +1,103 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+JAVA_PKG_IUSE="doc source test"
+MAVEN_ID="org.mockito:mockito-core:${PV}"
+JAVA_TESTING_FRAMEWORKS="junit-4"
+
+inherit java-pkg-2 java-pkg-simple
+
+DESCRIPTION="Mockito mock objects library core API and implementation"
+HOMEPAGE="https://github.com/mockito/mockito"
+SRC_URI="https://github.com/mockito/mockito/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/${P}"
+
+LICENSE="MIT"
+SLOT="2"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
+
+CP_DEPEND="
+ dev-java/asm:9
+ dev-java/byte-buddy:0
+ dev-java/objenesis:0
+"
+
+DEPEND="
+ dev-java/junit:4
+ dev-java/opentest4j:0
+ >=virtual/jdk-1.8:*
+ ${CP_DEPEND}
+ test? ( dev-java/assertj-core:3 )
+"
+
+RDEPEND="
+ >=virtual/jre-1.8:*
+ ${CP_DEPEND}
+"
+
+# see https://bugs.gentoo.org/903897
+PATCHES=( "${FILESDIR}/mockito-2.28.2-skip-failing-tests.patch" )
+
+JAVA_AUTOMATIC_MODULE_NAME="org.mockito"
+JAVA_CLASSPATH_EXTRA="junit-4 opentest4j"
+JAVA_SRC_DIR="src/main/java"
+
+JAVA_TEST_EXCLUDES=(
+ org.mockito.internal.junit.JUnitRuleTest # We run it in JAVA_TEST_RUN_ONLY
+ org.mockito.internal.util.reflection.DummyClassForTests # No runnable methods
+ org.mockito.internal.util.reflection.DummyParentClassForTests # No runnable methods
+ org.mockito.junit.TestableJUnitRunner # No runnable methods
+ org.mockitoutil.TestBase # No runnable methods
+)
+JAVA_TEST_GENTOO_CLASSPATH="assertj-core-3,junit-4"
+JAVA_TEST_RUN_ONLY=(
+ # This needs to run separately, otherwise one of its 4 tests would fail.
+ org.mockito.internal.junit.JUnitRuleTest
+)
+JAVA_TEST_SRC_DIR="src/test/java"
+
+src_prepare() {
+ java-pkg-2_src_prepare
+ default
+ # dev-java/byte-buddy is built from byte-buddy-dep without shaded stuff.
+ sed \
+ -e 's:net.bytebuddy.jar.asm:org.objectweb.asm:' \
+ -i src/main/java/org/mockito/internal/creation/bytebuddy/MockMethodAdvice.java \
+ -i src/main/java/org/mockito/internal/creation/bytebuddy/InlineBytecodeGenerator.java || die
+}
+
+src_compile() {
+ java-pkg-simple_src_compile
+ mv target/classes/org/mockito/internal/creation/bytebuddy/inject/MockMethodDispatcher.{class,raw} || die
+ jar ufv mockito.jar -C target/classes org/mockito/internal/creation/bytebuddy/inject/MockMethodDispatcher.raw || die
+}
+
+src_test() {
+ # Increasing number of test failures with higher Java versions
+ # Test failures are documented in https://bugs.gentoo.org/903897
+ local vm_version="$(java-config -g PROVIDES_VERSION)"
+ if ver_test "${vm_version}" -ge 11; then
+ JAVA_TEST_EXCLUDES+=(
+ org.mockito.internal.stubbing.defaultanswers.ReturnsMocksTest
+ org.mockitousage.bugs.GenericsMockitoAnnotationsTest
+ )
+ fi
+ if ver_test "${vm_version}" -ge 17; then
+ JAVA_TEST_EXCLUDES+=(
+ org.concurrentmockito.ThreadsRunAllTestsHalfManualTest
+ org.mockitousage.matchers.InvalidUseOfMatchersTest
+ org.mockitousage.serialization.DeepStubsSerializableTest
+ org.mockitousage.stubbing.StubbingWithDelegateTest
+ )
+ JAVA_TEST_EXTRA_ARGS+=( --add-opens=java.base/java.io=ALL-UNNAMED )
+ JAVA_TEST_EXTRA_ARGS+=( --add-opens=java.base/java.lang=ALL-UNNAMED )
+ JAVA_TEST_EXTRA_ARGS+=( --add-opens=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED )
+ fi
+ # First run what needs to run separately
+ java-pkg-simple_src_test
+ # And then the other tests
+ JAVA_TEST_RUN_ONLY=""
+ java-pkg-simple_src_test
+}