summaryrefslogtreecommitdiff
path: root/dev-java/mockito
diff options
context:
space:
mode:
Diffstat (limited to 'dev-java/mockito')
-rw-r--r--dev-java/mockito/Manifest1
-rw-r--r--dev-java/mockito/mockito-2.28.2-r1.ebuild106
2 files changed, 107 insertions, 0 deletions
diff --git a/dev-java/mockito/Manifest b/dev-java/mockito/Manifest
index ff44de2dcd74..e6e7a5bcfa20 100644
--- a/dev-java/mockito/Manifest
+++ b/dev-java/mockito/Manifest
@@ -4,6 +4,7 @@ DIST mockito-2.28.2.tar.gz 875085 BLAKE2B d0aab378c028530724156f999700506fe64f5b
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-r4.ebuild 712 BLAKE2B bbb94a982384032ed4e2fd38cb32be5feb2b3a7aa35ed054c62d73d5b2dbf8853b594cebfadfa49d3134f89131a4cd875ea0ebbac051c23e00d39378fbe11498 SHA512 34bdf3f6c8182307a41b28371c0e8406aea00e3f47184fde5097076c008992e6cf52341413ccedc003c3685f88d7b52d5aaee161632cec7bb909c1958f3be6b4
+EBUILD mockito-2.28.2-r1.ebuild 3477 BLAKE2B 830a2e20bd8359d9a2e74738de481492d4cffa9af38a6ecbed0443264e78655316954b1f32ac3cc8a8aec3db3a37b4c1457711f25ff36b88518a3298e6514d8e SHA512 f7fb07a48f3361a51c123be12aeb72713b6ebd4b21722e7acbb343feae5b38aa831ec3a743a1639a77b62e4aa51daefb1ce9d41433d1f2150c0d3cab9b2a1b0a
EBUILD mockito-2.28.2.ebuild 3376 BLAKE2B eacb33f6976ae1665d984de0a811470335c9e2490bbb78459ed309b4557236d8dfaa140827028fcf110e9ffa28166084e75b898d571b1bf27d88eaa3f4ac5a2e SHA512 77b40fa3984e0fff77846365c21eb8306d6d81a2e8fa1e19f275258e25be764381a2f13d1a4232e1d14c6d97db733db8bd5e927766bd9136f9bd0d115bcb0f17
EBUILD mockito-4.11.0.ebuild 1228 BLAKE2B 27c976b0ee2e782d471c91ef89708a62002c6e8a385ea67d865ff5430a34ec932146ee57493ce9684c7d566b1d9f1f54b709287bf0b2fb93b465b7596c641957 SHA512 189d3b3d14f847efce028a87c1706a26ded43f45e28299177bfb86f18d11398b2f03428ed48d9c4944cc277e199cb85424b0735a34fa78fbe82ab368bf7b119d
MISC metadata.xml 317 BLAKE2B 209b27a429c1fdeca71c1e215f8fc43bfc66c961b1a3ad3dfcda16d5ea1df51e54cea248f4f152966aa1f91059b91c21fb734c6995f8033150dbda5e1813d121 SHA512 1f7be64d432b4004d2bbf1ec2c6776ec8618875356ea0308b8409f322d48bf3440d692732406ddb3fa7a273c9754c4cc5a6f6cd9808348d0ba8beb7159887a5b
diff --git a/dev-java/mockito/mockito-2.28.2-r1.ebuild b/dev-java/mockito/mockito-2.28.2-r1.ebuild
new file mode 100644
index 000000000000..6b413be4b92e
--- /dev/null
+++ b/dev-java/mockito/mockito-2.28.2-r1.ebuild
@@ -0,0 +1,106 @@
+# Copyright 1999-2024 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 ~arm64 ~ppc64"
+
+# Tests need a version of byte-buddy supporting Java 21. #930103
+CP_DEPEND="
+ dev-java/asm:9
+ >=dev-java/byte-buddy-1.15.10:0
+ dev-java/hamcrest-core:1.3
+ dev-java/junit:4
+ dev-java/objenesis:0
+ dev-java/opentest4j:0
+"
+
+DEPEND="${CP_DEPEND}
+ >=virtual/jdk-1.8:*
+ test? ( dev-java/assertj-core:3 )
+"
+
+RDEPEND="${CP_DEPEND}
+ >=virtual/jre-1.8:*
+"
+
+# see https://bugs.gentoo.org/903897
+PATCHES=(
+ "${FILESDIR}/mockito-2.28.2-skip-failing-tests.patch"
+ "${FILESDIR}/mockito-2.28.2-fix-unused-stubbings-test.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
+}