Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add wider support for org.mockito:mockito-core #471

Open
Djhopper opened this issue Mar 26, 2024 · 0 comments
Open

Add wider support for org.mockito:mockito-core #471

Djhopper opened this issue Mar 26, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Djhopper
Copy link

Describe the bug
Mockito is currently supported only for mocking interfaces. This is a fairly big caveat, sufficient I feel for it not to be included in https://www.graalvm.org/native-image/libraries-and-frameworks/ without a disclaimer.

To Reproduce
Steps to reproduce the behavior:

Small diff from master to make it mock a class rather than an instance.

[dahoppe@dahoppelnx graalvm-reachability-metadata]$ git diff HEAD^ HEAD
diff --git a/tests/src/org.mockito/mockito-core/4.8.1/src/test/java/org_mockito/mockito_core/MyService.java b/tests/src/org.mockito/mockito-core/4.8.1/src/test/java/org_mockito/mockito_core/MyService.java
index 3ff1323..588e2f7 100644
--- a/tests/src/org.mockito/mockito-core/4.8.1/src/test/java/org_mockito/mockito_core/MyService.java
+++ b/tests/src/org.mockito/mockito-core/4.8.1/src/test/java/org_mockito/mockito_core/MyService.java
@@ -6,6 +6,8 @@
  */
 package org_mockito.mockito_core;
 
-public interface MyService {
-    String getGreeting();
+public class MyService {
+    String getGreeting() {
+        return "Hello, world!";
+    }
 }
diff --git a/tests/src/org.mockito/mockito-core/4.8.1/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker b/tests/src/org.mockito/mockito-core/4.8.1/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker
deleted file mode 100644
index 5494acd..0000000
--- a/tests/src/org.mockito/mockito-core/4.8.1/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker
+++ /dev/null
@@ -1 +0,0 @@
-org.mockito.internal.creation.proxy.ProxyMockMaker

Run tests:

./gradlew test -Pcoordinates=org.mockito:mockito-core:4.8.1

Expected behavior
Test should still pass.

Logs
Build fails like so:

```
[dahoppe@dahoppelnx graalvm-reachability-metadata]$ ./gradlew test -Pcoordinates=org.mockito:mockito-core:4.8.1

> Configure project :
GraalVM Reachability Metadata TCK
---------------------------------

> Task :test-org.mockito-mockito-core-4.8.1
====================
Testing library: org.mockito:mockito-core:4.8.1
Command: `/home/dahoppe/Repos/graalvm-reachability-metadata/gradlew nativeTest`
Executing test...
-------
Command: [/home/dahoppe/Repos/graalvm-reachability-metadata/gradlew, nativeTest]
Starting a Gradle Daemon, 1 busy and 1 incompatible and 6 stopped Daemons could not be reused, use --status for details
> Task :tck-build-logic:extractPluginRequests UP-TO-DATE
> Task :tck-build-logic:generatePluginAdapters UP-TO-DATE
> Task :tck-build-logic:compileJava UP-TO-DATE
> Task :tck-build-logic:compileGroovy UP-TO-DATE
> Task :tck-build-logic:compileGroovyPlugins UP-TO-DATE
> Task :tck-build-logic:pluginDescriptors UP-TO-DATE
> Task :tck-build-logic:processResources UP-TO-DATE
> Task :tck-build-logic:classes UP-TO-DATE
> Task :tck-build-logic:jar UP-TO-DATE
> Task :compileJava NO-SOURCE
> Task :processResources NO-SOURCE
> Task :classes UP-TO-DATE
> Task :compileTestJava UP-TO-DATE
> Task :jar UP-TO-DATE
> Task :processTestResources UP-TO-DATE
> Task :testClasses UP-TO-DATE
> Task :test UP-TO-DATE
> Task :generateTestResourcesConfigFile UP-TO-DATE

> Task :nativeTestCompile
[native-image-plugin] Args are: [-cp, /home/dahoppe/Repos/graalvm-reachability-metadata/tests/src/org.mockito/mockito-core/4.8.1/build/libs/org.mockito.mockito-core_tests.jar:/home/dahoppe/.gradle/caches/modules-2/files-2.1/org.graalvm.buildtools/junit-platform-native/0.9.28/8080b84eee8ed37d8a937d8a0f22184071b7867a/junit-platform-native-0.9.28.jar:/home/dahoppe/.gradle/caches/modules-2/files-2.1/org.junit.jupiter/junit-jupiter/5.10.0/8fea1d9c58b2156f1b998f2f18da04bc9e087f74/junit-jupiter-5.10.0.jar:/home/dahoppe/.gradle/caches/modules-2/files-2.1/org.junit.vintage/junit-vintage-engine/5.10.0/af4e0a3cb6901aa53d6401003fc10638014b39b1/junit-vintage-engine-5.10.0.jar:/home/dahoppe/.gradle/caches/modules-2/files-2.1/org.junit.platform/junit-platform-console/1.10.0/9901db09e60bf678e4a22fd4be564f10aa7c585/junit-platform-console-1.10.0.jar:/home/dahoppe/.gradle/caches/modules-2/files-2.1/org.junit.platform/junit-platform-reporting/1.10.0/d0bf1dc2f224e41439c65af66cd75dc13dec670e/junit-platform-reporting-1.10.0.jar:/home/dahoppe/.gradle/caches/modules-2/files-2.1/org.junit.platform/junit-platform-launcher/1.10.0/89a1922534ed102be1fb2a8c0b2c6151297a12bf/junit-platform-launcher-1.10.0.jar:/home/dahoppe/.gradle/caches/modules-2/files-2.1/org.junit.jupiter/junit-jupiter-params/5.10.0/9041c7365495a897a64782ea5a6fdb99dab1814e/junit-jupiter-params-5.10.0.jar:/home/dahoppe/.gradle/caches/modules-2/files-2.1/org.junit.jupiter/junit-jupiter-engine/5.10.0/90587932d718fc51a48112d33045a18476c542ad/junit-jupiter-engine-5.10.0.jar:/home/dahoppe/.gradle/caches/modules-2/files-2.1/org.junit.jupiter/junit-jupiter-api/5.10.0/2fe4ba3d31d5067878e468c96aa039005a9134d3/junit-jupiter-api-5.10.0.jar:/home/dahoppe/.gradle/caches/modules-2/files-2.1/org.junit.platform/junit-platform-engine/1.10.0/276c4edcf64fabb5a139fa7b4f99330d7a93b804/junit-platform-engine-1.10.0.jar:/home/dahoppe/.gradle/caches/modules-2/files-2.1/org.junit.platform/junit-platform-commons/1.10.0/d533ff2c286eaf963566f92baf5f8a06628d2609/junit-platform-commons-1.10.0.jar:/home/dahoppe/.gradle/caches/modules-2/files-2.1/org.mockito/mockito-core/4.8.1/d8eb9dec8747d08645347bb8c69088ac83197975/mockito-core-4.8.1.jar:/home/dahoppe/.gradle/caches/modules-2/files-2.1/org.assertj/assertj-core/3.22.0/c300c0c6a24559f35fa0bd3a5472dc1edcd0111e/assertj-core-3.22.0.jar:/home/dahoppe/.gradle/caches/modules-2/files-2.1/net.bytebuddy/byte-buddy/1.12.16/7817a8128b38ff8cb8570c8f3c85c1a41002a09d/byte-buddy-1.12.16.jar:/home/dahoppe/.gradle/caches/modules-2/files-2.1/net.bytebuddy/byte-buddy-agent/1.12.16/c2d5dd150c17028c494e7f02a17f4a995dcb4e9f/byte-buddy-agent-1.12.16.jar:/home/dahoppe/.gradle/caches/modules-2/files-2.1/org.objenesis/objenesis/3.2/7fadf57620c8b8abdf7519533e5527367cb51f09/objenesis-3.2.jar:/home/dahoppe/.gradle/caches/modules-2/files-2.1/junit/junit/4.13.2/8ac9e16d933b6fb43bc7f576336b8f4d7eb5ba12/junit-4.13.2.jar:/home/dahoppe/.gradle/caches/modules-2/files-2.1/org.opentest4j/opentest4j/1.3.0/152ea56b3a72f655d4fd677fc0ef2596c3dd5e6e/opentest4j-1.3.0.jar:/home/dahoppe/.gradle/caches/modules-2/files-2.1/org.hamcrest/hamcrest-core/1.3/42a25dc3219429f0e5d060061f71acb49bf010a0/hamcrest-core-1.3.jar:/home/dahoppe/Repos/graalvm-reachability-metadata/tests/src/org.mockito/mockito-core/4.8.1/build/classes/java/test:/home/dahoppe/Repos/graalvm-reachability-metadata/tests/src/org.mockito/mockito-core/4.8.1/build/resources/test:/home/dahoppe/Repos/graalvm-reachability-metadata/tests/src/org.mockito/mockito-core/4.8.1/build/test-results/test/testlist, --no-fallback, --verbose, -Ob, -o, /home/dahoppe/Repos/graalvm-reachability-metadata/tests/src/org.mockito/mockito-core/4.8.1/build/native/nativeTestCompile/org.mockito.mockito-core_tests-tests, -H:ConfigurationFileDirectories=/home/dahoppe/Repos/graalvm-reachability-metadata/tests/src/org.mockito/mockito-core/4.8.1/build/native/generated/generateTestResourcesConfigFile,/home/dahoppe/Repos/graalvm-reachability-metadata/metadata/org.mockito/mockito-core/4.8.1, --features=org.graalvm.junit.platform.JUnitPlatformFeature, -H:+StrictConfiguration, org.graalvm.junit.platform.NativeImageJUnitLauncher]
[native-image-plugin] GraalVM Toolchain detection is disabled
[native-image-plugin] GraalVM location read from environment variable: JAVA_HOME
[native-image-plugin] Native Image executable path: /home/dahoppe/javas/graalvm-ce-java17-22.3.2/lib/svm/bin/native-image
Apply file:///home/dahoppe/Repos/graalvm-reachability-metadata/tests/src/org.mockito/mockito-core/4.8.1/build/resources/test/META-INF/native-image/test/proxy-config.json
Apply jar:file:///home/dahoppe/javas/graalvm-ce-java17-22.3.2/lib/svm/library-support.jar!/META-INF/native-image/com.oracle.svm/thirdparty/native-image.properties
Apply jar:file:///home/dahoppe/javas/graalvm-ce-java17-22.3.2/lib/svm/library-support.jar!/META-INF/native-image/com.oracle.svm/polyglot/native-image.properties
Executing [
/home/dahoppe/javas/graalvm-ce-java17-22.3.2/bin/java \
-XX:+UseParallelGC \
-XX:+UnlockExperimentalVMOptions \
-XX:+EnableJVMCI \
-Dtruffle.TrustAllTruffleRuntimeProviders=true \
-Dtruffle.TruffleRuntime=com.oracle.truffle.api.impl.DefaultTruffleRuntime \
-Dgraalvm.ForcePolyglotInvalid=true \
-Dgraalvm.locatorDisabled=true \
-Dsubstratevm.IgnoreGraalVersionCheck=true \
--add-exports=java.base/com.sun.crypto.provider=org.graalvm.nativeimage.builder \
--add-exports=java.base/jdk.internal.access.foreign=org.graalvm.nativeimage.builder \
--add-exports=java.base/jdk.internal.event=org.graalvm.nativeimage.builder \
--add-exports=java.base/jdk.internal.loader=org.graalvm.nativeimage.builder,org.graalvm.truffle \
--add-exports=java.base/jdk.internal.logger=org.graalvm.nativeimage.builder \
--add-exports=java.base/jdk.internal.misc=org.graalvm.nativeimage.builder,org.graalvm.nativeimage.objectfile,org.graalvm.nativeimage.pointsto \
--add-exports=java.base/jdk.internal.module=jdk.internal.vm.compiler,org.graalvm.nativeimage.base,org.graalvm.nativeimage.builder \
--add-exports=java.base/jdk.internal.org.objectweb.asm=org.graalvm.nativeimage.builder \
--add-exports=java.base/jdk.internal.perf=org.graalvm.nativeimage.builder \
--add-exports=java.base/jdk.internal.platform=org.graalvm.nativeimage.builder \
--add-exports=java.base/jdk.internal.ref=org.graalvm.nativeimage.builder,org.graalvm.nativeimage.objectfile \
--add-exports=java.base/jdk.internal.reflect=org.graalvm.nativeimage.builder \
--add-exports=java.base/jdk.internal.util=org.graalvm.nativeimage.builder \
--add-exports=java.base/jdk.internal.vm.annotation=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.invoke.util=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.net=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.nio.ch=org.graalvm.nativeimage.builder,org.graalvm.nativeimage.objectfile \
--add-exports=java.base/sun.reflect.annotation=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.reflect.generics.factory=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.reflect.generics.reflectiveObjects=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.reflect.generics.repository=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.reflect.generics.scope=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.reflect.generics.tree=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.security.jca=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.security.provider=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.security.ssl=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.security.util=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.security.x509=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.text.spi=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.util.calendar=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.util.cldr=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.util.locale.provider=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.util.locale=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.util.resources=org.graalvm.nativeimage.builder \
--add-exports=java.base/sun.util=org.graalvm.nativeimage.builder \
--add-exports=java.desktop/sun.java2d.pipe=org.graalvm.nativeimage.builder \
--add-exports=java.desktop/sun.java2d=org.graalvm.nativeimage.builder \
--add-exports=java.management/com.sun.jmx.mbeanserver=org.graalvm.nativeimage.builder \
--add-exports=java.management/sun.management=org.graalvm.nativeimage.builder,org.graalvm.nativeimage.pointsto \
--add-exports=java.xml.crypto/org.jcp.xml.dsig.internal.dom=org.graalvm.nativeimage.builder \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.aarch64=jdk.internal.vm.compiler,org.graalvm.nativeimage.builder,org.graalvm.nativeimage.objectfile \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.amd64=jdk.internal.vm.compiler,org.graalvm.nativeimage.builder,org.graalvm.nativeimage.objectfile \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.code.site=jdk.internal.vm.compiler,org.graalvm.nativeimage.builder \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.code.stack=jdk.internal.vm.compiler,org.graalvm.nativeimage.builder \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.code=jdk.internal.vm.compiler,org.graalvm.nativeimage.builder,org.graalvm.nativeimage.objectfile,org.graalvm.nativeimage.pointsto \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.common=jdk.internal.vm.compiler,org.graalvm.nativeimage.builder,org.graalvm.nativeimage.pointsto \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.hotspot.aarch64=jdk.internal.vm.compiler \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.hotspot.amd64=jdk.internal.vm.compiler \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.hotspot.riscv64=jdk.internal.vm.compiler \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.hotspot=jdk.internal.vm.compiler,org.graalvm.nativeimage.builder \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.meta=jdk.internal.vm.compiler,org.graalvm.nativeimage.builder,org.graalvm.nativeimage.objectfile,org.graalvm.nativeimage.pointsto \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.riscv64=jdk.internal.vm.compiler \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.runtime=jdk.internal.vm.compiler,org.graalvm.nativeimage.builder,org.graalvm.nativeimage.pointsto \
--add-exports=jdk.internal.vm.ci/jdk.vm.ci.services=jdk.internal.vm.compiler,org.graalvm.nativeimage.builder \
--add-exports=jdk.jfr/jdk.jfr.events=org.graalvm.nativeimage.builder \
--add-exports=jdk.jfr/jdk.jfr.internal.handlers=org.graalvm.nativeimage.builder \
--add-exports=jdk.jfr/jdk.jfr.internal.jfc=org.graalvm.nativeimage.builder \
--add-exports=jdk.jfr/jdk.jfr.internal=org.graalvm.nativeimage.builder \
--add-exports=jdk.management/com.sun.management.internal=org.graalvm.nativeimage.builder \
-XX:+UseJVMCINativeLibrary \
-Xss10m \
-Xms1g \
-Xmx12963908808 \
-Djava.awt.headless=true \
-Dorg.graalvm.version=22.3.2 \
-Dcom.oracle.graalvm.isaot=true \
-Djava.system.class.loader=com.oracle.svm.hosted.NativeImageSystemClassLoader \
-Xshare:off \
-Djdk.internal.lambda.disableEagerInitialization=true \
-Djdk.internal.lambda.eagerlyInitialize=false \
-Djava.lang.invoke.InnerClassLambdaMetafactory.initializeLambdas=false \
-Djunit.platform.listeners.uid.tracking.output.dir=/home/dahoppe/Repos/graalvm-reachability-metadata/tests/src/org.mockito/mockito-core/4.8.1/build/test-results/test/testlist \
--add-modules=ALL-DEFAULT \
--module-path \
/home/dahoppe/javas/graalvm-ce-java17-22.3.2/lib/truffle/truffle-api.jar:/home/dahoppe/javas/graalvm-ce-java17-22.3.2/lib/svm/builder/svm.jar:/home/dahoppe/javas/graalvm-ce-java17-22.3.2/lib/svm/builder/objectfile.jar:/home/dahoppe/javas/graalvm-ce-java17-22.3.2/lib/svm/builder/pointsto.jar:/home/dahoppe/javas/graalvm-ce-java17-22.3.2/lib/svm/builder/native-image-base.jar \
--module \
org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner \
-watchpid \
952213 \
-imagecp \
/home/dahoppe/Repos/graalvm-reachability-metadata/tests/src/org.mockito/mockito-core/4.8.1/build/libs/org.mockito.mockito-core_tests.jar:/home/dahoppe/.gradle/caches/modules-2/files-2.1/org.graalvm.buildtools/junit-platform-native/0.9.28/8080b84eee8ed37d8a937d8a0f22184071b7867a/junit-platform-native-0.9.28.jar:/home/dahoppe/.gradle/caches/modules-2/files-2.1/org.junit.jupiter/junit-jupiter/5.10.0/8fea1d9c58b2156f1b998f2f18da04bc9e087f74/junit-jupiter-5.10.0.jar:/home/dahoppe/.gradle/caches/modules-2/files-2.1/org.junit.vintage/junit-vintage-engine/5.10.0/af4e0a3cb6901aa53d6401003fc10638014b39b1/junit-vintage-engine-5.10.0.jar:/home/dahoppe/.gradle/caches/modules-2/files-2.1/org.junit.platform/junit-platform-console/1.10.0/9901db09e60bf678e4a22fd4be564f10aa7c585/junit-platform-console-1.10.0.jar:/home/dahoppe/.gradle/caches/modules-2/files-2.1/org.junit.platform/junit-platform-reporting/1.10.0/d0bf1dc2f224e41439c65af66cd75dc13dec670e/junit-platform-reporting-1.10.0.jar:/home/dahoppe/.gradle/caches/modules-2/files-2.1/org.junit.platform/junit-platform-launcher/1.10.0/89a1922534ed102be1fb2a8c0b2c6151297a12bf/junit-platform-launcher-1.10.0.jar:/home/dahoppe/.gradle/caches/modules-2/files-2.1/org.junit.jupiter/junit-jupiter-params/5.10.0/9041c7365495a897a64782ea5a6fdb99dab1814e/junit-jupiter-params-5.10.0.jar:/home/dahoppe/.gradle/caches/modules-2/files-2.1/org.junit.jupiter/junit-jupiter-engine/5.10.0/90587932d718fc51a48112d33045a18476c542ad/junit-jupiter-engine-5.10.0.jar:/home/dahoppe/.gradle/caches/modules-2/files-2.1/org.junit.jupiter/junit-jupiter-api/5.10.0/2fe4ba3d31d5067878e468c96aa039005a9134d3/junit-jupiter-api-5.10.0.jar:/home/dahoppe/.gradle/caches/modules-2/files-2.1/org.junit.platform/junit-platform-engine/1.10.0/276c4edcf64fabb5a139fa7b4f99330d7a93b804/junit-platform-engine-1.10.0.jar:/home/dahoppe/.gradle/caches/modules-2/files-2.1/org.junit.platform/junit-platform-commons/1.10.0/d533ff2c286eaf963566f92baf5f8a06628d2609/junit-platform-commons-1.10.0.jar:/home/dahoppe/.gradle/caches/modules-2/files-2.1/org.mockito/mockito-core/4.8.1/d8eb9dec8747d08645347bb8c69088ac83197975/mockito-core-4.8.1.jar:/home/dahoppe/.gradle/caches/modules-2/files-2.1/org.assertj/assertj-core/3.22.0/c300c0c6a24559f35fa0bd3a5472dc1edcd0111e/assertj-core-3.22.0.jar:/home/dahoppe/.gradle/caches/modules-2/files-2.1/net.bytebuddy/byte-buddy/1.12.16/7817a8128b38ff8cb8570c8f3c85c1a41002a09d/byte-buddy-1.12.16.jar:/home/dahoppe/.gradle/caches/modules-2/files-2.1/net.bytebuddy/byte-buddy-agent/1.12.16/c2d5dd150c17028c494e7f02a17f4a995dcb4e9f/byte-buddy-agent-1.12.16.jar:/home/dahoppe/.gradle/caches/modules-2/files-2.1/org.objenesis/objenesis/3.2/7fadf57620c8b8abdf7519533e5527367cb51f09/objenesis-3.2.jar:/home/dahoppe/.gradle/caches/modules-2/files-2.1/junit/junit/4.13.2/8ac9e16d933b6fb43bc7f576336b8f4d7eb5ba12/junit-4.13.2.jar:/home/dahoppe/.gradle/caches/modules-2/files-2.1/org.opentest4j/opentest4j/1.3.0/152ea56b3a72f655d4fd677fc0ef2596c3dd5e6e/opentest4j-1.3.0.jar:/home/dahoppe/.gradle/caches/modules-2/files-2.1/org.hamcrest/hamcrest-core/1.3/42a25dc3219429f0e5d060061f71acb49bf010a0/hamcrest-core-1.3.jar:/home/dahoppe/Repos/graalvm-reachability-metadata/tests/src/org.mockito/mockito-core/4.8.1/build/classes/java/test:/home/dahoppe/Repos/graalvm-reachability-metadata/tests/src/org.mockito/mockito-core/4.8.1/build/resources/test:/home/dahoppe/Repos/graalvm-reachability-metadata/tests/src/org.mockito/mockito-core/4.8.1/build/test-results/test/testlist \
-imagemp \
/home/dahoppe/javas/graalvm-ce-java17-22.3.2/lib/svm/library-support.jar \
-H:CLibraryPath=/home/dahoppe/javas/graalvm-ce-java17-22.3.2/lib/svm/clibraries/linux-amd64 \
-H:Path=/home/dahoppe/Repos/graalvm-reachability-metadata/tests/src/org.mockito/mockito-core/4.8.1/build/native/nativeTestCompile \
-H:DynamicProxyConfigurationResources@file:///home/dahoppe/Repos/graalvm-reachability-metadata/tests/src/org.mockito/mockito-core/4.8.1/build/resources/test/META-INF/native-image/test/proxy-config.json=META-INF/native-image/test/proxy-config.json \
-H:FallbackThreshold=0 \
-H:Optimize=b \
-H:Name=/home/dahoppe/Repos/graalvm-reachability-metadata/tests/src/org.mockito/mockito-core/4.8.1/build/native/nativeTestCompile/org.mockito.mockito-core_tests-tests \
-H:ConfigurationFileDirectories=/home/dahoppe/Repos/graalvm-reachability-metadata/tests/src/org.mockito/mockito-core/4.8.1/build/native/generated/generateTestResourcesConfigFile,/home/dahoppe/Repos/graalvm-reachability-metadata/metadata/org.mockito/mockito-core/4.8.1 \
-H:Features=org.graalvm.junit.platform.JUnitPlatformFeature \
-H:+StrictConfiguration \
'-H:Class@explicit main-class=org.graalvm.junit.platform.NativeImageJUnitLauncher' \
'-H:Features@jar:file:///home/dahoppe/javas/graalvm-ce-java17-22.3.2/lib/svm/library-support.jar!/META-INF/native-image/com.oracle.svm/thirdparty/native-image.properties=com.oracle.svm.thirdparty.gson.GsonFeature' \
'-H:Features@jar:file:///home/dahoppe/javas/graalvm-ce-java17-22.3.2/lib/svm/library-support.jar!/META-INF/native-image/com.oracle.svm/polyglot/native-image.properties=com.oracle.svm.polyglot.groovy.GroovyIndyInterfaceFeature,com.oracle.svm.polyglot.scala.ScalaFeature'
]
You enabled -Ob for this image build. This will configure some optimizations to reduce image build time.
This feature should only be used during development and never for deployment.
========================================================================================================================
GraalVM Native Image: Generating '/home/dahoppe/Repos/graalvm-reachability-metadata/tests/src/org.mockito/mockito-core/4.8.1/build/native/nativeTestCompile/org.mockito.mockito-core_tests-tests' (executable)...
========================================================================================================================
Warning: Could not resolve kotlin.jvm.JvmInline for reflection configuration. Reason: java.lang.ClassNotFoundException: kotlin.jvm.JvmInline.
Warning: Could not resolve org.mockito.configuration.MockitoConfiguration for reflection configuration. Reason: java.lang.ClassNotFoundException: org.mockito.configuration.MockitoConfiguration.
WARNING: Cannot register dynamic proxy for interface list: org_mockito.mockito_core.MyService. Reason: Class org_mockito.mockito_core.MyService is not an interface.
[1/7] Initializing...                                                                                    (6.0s @ 0.32GB)
 Version info: 'GraalVM 22.3.2 Java 17 CE'
 Java version info: '17.0.7+7-jvmci-22.3-b18'
 C compiler: gcc (redhat, x86_64, 8.5.0)
 Garbage collector: Serial GC
 1 user-specific feature(s)
 - org.graalvm.junit.platform.JUnitPlatformFeature
[junit-platform-native] Running in 'test listener' mode using files matching pattern [junit-platform-unique-ids*] found in folder [/home/dahoppe/Repos/graalvm-reachability-metadata/tests/src/org.mockito/mockito-core/4.8.1/build/test-results/test/testlist] and its subfolders.
[2/7] Performing analysis...  [******]                                                                  (32.8s @ 2.12GB)
   7,410 (83.92%) of  8,830 classes reachable
  10,641 (62.12%) of 17,130 fields reachable
  31,959 (51.99%) of 61,476 methods reachable
     195 classes,    93 fields, and   849 methods registered for reflection
      59 classes,    59 fields, and    52 methods registered for JNI access
       4 native libraries: dl, pthread, rt, z
[3/7] Building universe...                                                                               (3.6s @ 1.08GB)
[4/7] Parsing methods...      [**]                                                                       (3.1s @ 2.95GB)
[5/7] Inlining methods...     [***]                                                                      (2.4s @ 3.91GB)
[6/7] Compiling methods...    [****]                                                                    (19.7s @ 3.96GB)
[7/7] Creating image...                                                                                  (3.3s @ 1.34GB)
  12.90MB (44.87%) for code area:    19,767 compilation units
  15.60MB (54.25%) for image heap:  189,497 objects and 67 resources
 260.20KB ( 0.88%) for other data
  28.75MB in total
------------------------------------------------------------------------------------------------------------------------
Top 10 packages in code area:                               Top 10 object types in image heap:
 908.73KB java.util                                            2.86MB byte[] for code metadata
 622.58KB java.lang.invoke                                     1.75MB java.lang.String
 484.25KB c.s.org.apache.xerces.internal.impl.xs.traversers    1.73MB java.lang.Class
 415.51KB com.sun.crypto.provider                              1.48MB byte[] for general heap data
 412.63KB com.sun.org.apache.xerces.internal.impl              1.36MB byte[] for java.lang.String
 407.25KB java.lang                                          752.11KB byte[] for embedded resources
 340.85KB com.sun.org.apache.xerces.internal.impl.xs         636.80KB com.oracle.svm.core.hub.DynamicHubCompanion
 308.79KB java.util.concurrent                               532.88KB java.util.HashMap$Node
 280.67KB org.assertj.core.internal.bytebuddy.jar.asm        513.00KB int[][]
 279.12KB jdk.internal.org.objectweb.asm                     343.50KB java.lang.String[]
   8.40MB for 308 more packages                                3.55MB for 1738 more object types
------------------------------------------------------------------------------------------------------------------------
                        2.4s (3.2% of total time) in 22 GCs | Peak RSS: 5.01GB | CPU load: 5.60
------------------------------------------------------------------------------------------------------------------------
Produced artifacts:
 /home/dahoppe/Repos/graalvm-reachability-metadata/tests/src/org.mockito/mockito-core/4.8.1/build/native/nativeTestCompile/org.mockito.mockito-core_tests-tests (executable)
 /home/dahoppe/Repos/graalvm-reachability-metadata/tests/src/org.mockito/mockito-core/4.8.1/build/native/nativeTestCompile/org.mockito.mockito-core_tests-tests.build_artifacts.txt (txt)
========================================================================================================================
Finished generating '/home/dahoppe/Repos/graalvm-reachability-metadata/tests/src/org.mockito/mockito-core/4.8.1/build/native/nativeTestCompile/org.mockito.mockito-core_tests-tests' in 1m 14s.
[native-image-plugin] Native Image written to: /home/dahoppe/Repos/graalvm-reachability-metadata/tests/src/org.mockito/mockito-core/4.8.1/build/native/nativeTestCompile

> Task :nativeTest FAILED
JUnit Platform on Native Image - report
----------------------------------------

org_mockito.mockito_core.MockitoTest > test() FAILED


Failures (1):
  JUnit Jupiter:MockitoTest:test()
    MethodSource [className = 'org_mockito.mockito_core.MockitoTest', methodName = 'test', methodParameterTypes = '']
    => com.oracle.svm.core.jdk.UnsupportedFeatureError: Proxy class defined by interfaces [interface org.mockito.plugins.MockMaker] not found. Generating proxy classes at runtime is not supported. Proxy classes need to be defined at image build time by specifying the list of interfaces that they implement. To define proxy classes use -H:DynamicProxyConfigurationFiles=<comma-separated-config-files> and -H:DynamicProxyConfigurationResources=<comma-separated-config-resources> options.
       org.graalvm.nativeimage.builder/com.oracle.svm.core.util.VMError.unsupportedFeature(VMError.java:89)
       org.graalvm.nativeimage.builder/com.oracle.svm.core.reflect.proxy.DynamicProxySupport.getProxyClass(DynamicProxySupport.java:171)
       java.base@17.0.7/java.lang.reflect.Proxy.getProxyConstructor(Proxy.java:47)
       java.base@17.0.7/java.lang.reflect.Proxy.newProxyInstance(Proxy.java:1037)
       org.mockito.internal.configuration.plugins.PluginLoader.loadPlugin(PluginLoader.java:77)
       org.mockito.internal.configuration.plugins.PluginLoader.loadPlugin(PluginLoader.java:50)
       org.mockito.internal.configuration.plugins.PluginRegistry.<init>(PluginRegistry.java:27)
       org.mockito.internal.configuration.plugins.Plugins.<clinit>(Plugins.java:22)
       org.mockito.internal.MockitoCore.<clinit>(MockitoCore.java:73)
       org.mockito.Mockito.<clinit>(Mockito.java:1647)
       [...]

Test run finished after 75 ms
[         3 containers found      ]
[         0 containers skipped    ]
[         3 containers started    ]
[         0 containers aborted    ]
[         3 containers successful ]
[         0 containers failed     ]
[         1 tests found           ]
[         0 tests skipped         ]
[         1 tests started         ]
[         0 tests aborted         ]
[         0 tests successful      ]
[         1 tests failed          ]


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':nativeTest'.
> Process 'command '/home/dahoppe/Repos/graalvm-reachability-metadata/tests/src/org.mockito/mockito-core/4.8.1/build/native/nativeTestCompile/org.mockito.mockito-core_tests-tests'' finished with non-zero exit value 1

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1m 22s
15 actionable tasks: 2 executed, 13 up-to-date

> Task :test-org.mockito-mockito-core-4.8.1 FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':test-org.mockito-mockito-core-4.8.1'.
> Test for org.mockito:mockito-core:4.8.1 failed with exit code 1.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1m 25s
9 actionable tasks: 1 executed, 8 up-to-date

```

System Info (please complete the following information):

  • OS: Oracle Linux 8
  • GraalVM Version - OpenJDK 64-Bit Server VM GraalVM CE 22.3.2
  • Java Version - 17
  • Plugin version - org.mockito:mockito-core:4.8.1

Additional context
Oracle internal slack thread: https://dyn.slack.com/archives/CJAB85R1C/p1711037981248469

@Djhopper Djhopper added the bug Something isn't working label Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant