You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> Task :dependencies
------------------------------------------------------------
Root project
------------------------------------------------------------
annotationProcessor - Annotation processors and their dependencies for source set 'main'.
No dependencies
apiElements - API elements for main. (n)
No dependencies
archives - Configuration for archive artifacts. (n)
No dependencies
compileClasspath - Compile classpath for source set 'main'.
\--- org.hibernate:hibernate-entitymanager:5.2.12.Final
+--- org.jboss.logging:jboss-logging:3.3.0.Final
+--- org.hibernate:hibernate-core:5.2.12.Final
| +--- org.jboss.logging:jboss-logging:3.3.0.Final
| +--- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final
| +--- org.javassist:javassist:3.20.0-GA
| +--- antlr:antlr:2.7.7
| +--- org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:1.0.1.Final
| +--- org.jboss:jandex:2.0.3.Final
| +--- com.fasterxml:classmate:1.3.0
| +--- dom4j:dom4j:1.6.1
| \--- org.hibernate.common:hibernate-commons-annotations:5.0.1.Final
| \--- org.jboss.logging:jboss-logging:3.3.0.Final
+--- dom4j:dom4j:1.6.1
+--- org.hibernate.common:hibernate-commons-annotations:5.0.1.Final (*)
+--- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final
+--- org.javassist:javassist:3.20.0-GA
+--- net.bytebuddy:byte-buddy:1.6.14
\--- org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:1.0.1.Final
compileOnly - Compile only dependencies for source set 'main'. (n)
No dependencies
default - Configuration for default artifacts. (n)
No dependencies
implementation - Implementation only dependencies for source set 'main'. (n)
\--- org.hibernate:hibernate-entitymanager:5.2.12.Final (n)
runtimeClasspath - Runtime classpath of source set 'main'.
\--- org.hibernate:hibernate-entitymanager:5.2.12.Final
+--- org.jboss.logging:jboss-logging:3.3.0.Final
+--- org.hibernate:hibernate-core:5.2.12.Final
| +--- org.jboss.logging:jboss-logging:3.3.0.Final
| +--- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final
| +--- org.javassist:javassist:3.20.0-GA
| +--- antlr:antlr:2.7.7
| +--- org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:1.0.1.Final
| +--- org.jboss:jandex:2.0.3.Final
| +--- com.fasterxml:classmate:1.3.0
| +--- dom4j:dom4j:1.6.1
| \--- org.hibernate.common:hibernate-commons-annotations:5.0.1.Final
| \--- org.jboss.logging:jboss-logging:3.3.0.Final
+--- dom4j:dom4j:1.6.1
+--- org.hibernate.common:hibernate-commons-annotations:5.0.1.Final (*)
+--- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final
+--- org.javassist:javassist:3.20.0-GA
+--- net.bytebuddy:byte-buddy:1.6.14
\--- org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:1.0.1.Final
runtimeElements - Elements of runtime for main. (n)
No dependencies
runtimeOnly - Runtime only dependencies for source set 'main'. (n)
No dependencies
testAnnotationProcessor - Annotation processors and their dependencies for source set 'test'.
No dependencies
testCompileClasspath - Compile classpath for source set 'test'.
+--- org.hibernate:hibernate-entitymanager:5.2.12.Final
| +--- org.jboss.logging:jboss-logging:3.3.0.Final
| +--- org.hibernate:hibernate-core:5.2.12.Final
| | +--- org.jboss.logging:jboss-logging:3.3.0.Final
| | +--- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final
| | +--- org.javassist:javassist:3.20.0-GA
| | +--- antlr:antlr:2.7.7
| | +--- org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:1.0.1.Final
| | +--- org.jboss:jandex:2.0.3.Final
| | +--- com.fasterxml:classmate:1.3.0
| | +--- dom4j:dom4j:1.6.1
| | \--- org.hibernate.common:hibernate-commons-annotations:5.0.1.Final
| | \--- org.jboss.logging:jboss-logging:3.3.0.Final
| +--- dom4j:dom4j:1.6.1
| +--- org.hibernate.common:hibernate-commons-annotations:5.0.1.Final (*)
| +--- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final
| +--- org.javassist:javassist:3.20.0-GA
| +--- net.bytebuddy:byte-buddy:1.6.14 -> 1.12.9
| \--- org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:1.0.1.Final
+--- junit:junit:4.13
| \--- org.hamcrest:hamcrest-core:1.3
\--- org.mockito:mockito-inline:4.5.1
\--- org.mockito:mockito-core:4.5.1
+--- net.bytebuddy:byte-buddy:1.12.9
\--- net.bytebuddy:byte-buddy-agent:1.12.9
testCompileOnly - Compile only dependencies for source set 'test'. (n)
No dependencies
testImplementation - Implementation only dependencies for source set 'test'. (n)
+--- junit:junit:4.13 (n)
\--- org.mockito:mockito-inline:4.5.1 (n)
testRuntimeClasspath - Runtime classpath of source set 'test'.
+--- org.hibernate:hibernate-entitymanager:5.2.12.Final
| +--- org.jboss.logging:jboss-logging:3.3.0.Final
| +--- org.hibernate:hibernate-core:5.2.12.Final
| | +--- org.jboss.logging:jboss-logging:3.3.0.Final
| | +--- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final
| | +--- org.javassist:javassist:3.20.0-GA
| | +--- antlr:antlr:2.7.7
| | +--- org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:1.0.1.Final
| | +--- org.jboss:jandex:2.0.3.Final
| | +--- com.fasterxml:classmate:1.3.0
| | +--- dom4j:dom4j:1.6.1
| | \--- org.hibernate.common:hibernate-commons-annotations:5.0.1.Final
| | \--- org.jboss.logging:jboss-logging:3.3.0.Final
| +--- dom4j:dom4j:1.6.1
| +--- org.hibernate.common:hibernate-commons-annotations:5.0.1.Final (*)
| +--- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final
| +--- org.javassist:javassist:3.20.0-GA
| +--- net.bytebuddy:byte-buddy:1.6.14 -> 1.12.9
| \--- org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:1.0.1.Final
+--- junit:junit:4.13
| \--- org.hamcrest:hamcrest-core:1.3
\--- org.mockito:mockito-inline:4.5.1
\--- org.mockito:mockito-core:4.5.1
+--- net.bytebuddy:byte-buddy:1.12.9
+--- net.bytebuddy:byte-buddy-agent:1.12.9
\--- org.objenesis:objenesis:3.2
testRuntimeOnly - Runtime only dependencies for source set 'test'. (n)
No dependencies
(*) - dependencies omitted (listed previously)
(n) - Not resolved (configuration is not meant to be resolved)
A web-based, searchable dependency report is available by adding the --scan option.
Above is dependencies for the project. While hibernate depends on old byte-buddy version(1.6.4)(listed in runtimeClasspath), mockito depends on recent version(1.12.9) of byte-code(listed in testRuntimeClasspath). When test is executed, the recent version(1.12.9) of byte-buddy in testRuntimeClasspath should be added to classpath, but instead the extension adds old version(1.6.4) of byte-buddy and leads to exception below.
java.lang.IllegalStateException: Could not initialize plugin: interface org.mockito.plugins.MockMaker (alternate: null)
at org.mockito.internal.configuration.plugins.PluginLoader$1.invoke([PluginLoader.java:88](command:_java.test.openStackTrace?%5B%22%5Ctat%20org.mockito.internal.configuration.plugins.PluginLoader%241.invoke(PluginLoader.java%3A88)%22%2C%22vscode-java-test-sample%22%5D))
at com.sun.proxy.$Proxy21.isTypeMockable(Unknown Source)
at org.mockito.internal.util.MockUtil.typeMockabilityOf([MockUtil.java:33](command:_java.test.openStackTrace?%5B%22%5Ctat%20org.mockito.internal.util.MockUtil.typeMockabilityOf(MockUtil.java%3A33)%22%2C%22vscode-java-test-sample%22%5D))
at org.mockito.internal.util.MockCreationValidator.validateType([MockCreationValidator.java:22](command:_java.test.openStackTrace?%5B%22%5Ctat%20org.mockito.internal.util.MockCreationValidator.validateType(MockCreationValidator.java%3A22)%22%2C%22vscode-java-test-sample%22%5D))
at org.mockito.internal.creation.MockSettingsImpl.validatedSettings([MockSettingsImpl.java:250](command:_java.test.openStackTrace?%5B%22%5Ctat%20org.mockito.internal.creation.MockSettingsImpl.validatedSettings(MockSettingsImpl.java%3A250)%22%2C%22vscode-java-test-sample%22%5D))
at org.mockito.internal.creation.MockSettingsImpl.build([MockSettingsImpl.java:232](command:_java.test.openStackTrace?%5B%22%5Ctat%20org.mockito.internal.creation.MockSettingsImpl.build(MockSettingsImpl.java%3A232)%22%2C%22vscode-java-test-sample%22%5D))
at org.mockito.internal.MockitoCore.mock([MockitoCore.java:94](command:_java.test.openStackTrace?%5B%22%5Ctat%20org.mockito.internal.MockitoCore.mock(MockitoCore.java%3A94)%22%2C%22vscode-java-test-sample%22%5D))
at org.mockito.Mockito.mock([Mockito.java:1965](command:_java.test.openStackTrace?%5B%22%5Ctat%20org.mockito.Mockito.mock(Mockito.java%3A1965)%22%2C%22vscode-java-test-sample%22%5D))
at org.mockito.Mockito.mock([Mockito.java:1880](command:_java.test.openStackTrace?%5B%22%5Ctat%20org.mockito.Mockito.mock(Mockito.java%3A1880)%22%2C%22vscode-java-test-sample%22%5D))
at vscode.java.test.sample.AppTest.sampleTest([AppTest.java:12](command:_java.test.openStackTrace?%5B%22%5Ctat%20vscode.java.test.sample.AppTest.sampleTest(AppTest.java%3A12)%22%2C%22vscode-java-test-sample%22%5D))
Caused by: java.lang.IllegalStateException: Failed to load interface org.mockito.plugins.MockMaker implementation declared in sun.misc.CompoundEnumeration@23a5fd2
at org.mockito.internal.configuration.plugins.PluginInitializer.loadImpl([PluginInitializer.java:58](command:_java.test.openStackTrace?%5B%22%5Ctat%20org.mockito.internal.configuration.plugins.PluginInitializer.loadImpl(PluginInitializer.java%3A58)%22%2C%22vscode-java-test-sample%22%5D))
at org.mockito.internal.configuration.plugins.PluginLoader.loadPlugin([PluginLoader.java:69](command:_java.test.openStackTrace?%5B%22%5Ctat%20org.mockito.internal.configuration.plugins.PluginLoader.loadPlugin(PluginLoader.java%3A69)%22%2C%22vscode-java-test-sample%22%5D))
at org.mockito.internal.configuration.plugins.PluginLoader.loadPlugin([PluginLoader.java:54](command:_java.test.openStackTrace?%5B%22%5Ctat%20org.mockito.internal.configuration.plugins.PluginLoader.loadPlugin(PluginLoader.java%3A54)%22%2C%22vscode-java-test-sample%22%5D))
at org.mockito.internal.configuration.plugins.PluginRegistry.([PluginRegistry.java:28](command:_java.test.openStackTrace?%5B%22%5Ctat%20org.mockito.internal.configuration.plugins.PluginRegistry.%3Cinit%3E(PluginRegistry.java%3A28)%22%2C%22vscode-java-test-sample%22%5D))
at org.mockito.internal.configuration.plugins.Plugins.([Plugins.java:22](command:_java.test.openStackTrace?%5B%22%5Ctat%20org.mockito.internal.configuration.plugins.Plugins.%3Cclinit%3E(Plugins.java%3A22)%22%2C%22vscode-java-test-sample%22%5D))
at org.mockito.internal.MockitoCore.([MockitoCore.java:77](command:_java.test.openStackTrace?%5B%22%5Ctat%20org.mockito.internal.MockitoCore.%3Cclinit%3E(MockitoCore.java%3A77)%22%2C%22vscode-java-test-sample%22%5D))
at org.mockito.Mockito.([Mockito.java:1614](command:_java.test.openStackTrace?%5B%22%5Ctat%20org.mockito.Mockito.%3Cclinit%3E(Mockito.java%3A1614)%22%2C%22vscode-java-test-sample%22%5D))
... 27 more
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance([Constructor.java:423](command:_java.test.openStackTrace?%5B%22%5Ctat%20java.lang.reflect.Constructor.newInstance(Constructor.java%3A423)%22%2C%22vscode-java-test-sample%22%5D))
at org.mockito.internal.configuration.plugins.PluginInitializer.loadImpl([PluginInitializer.java:53](command:_java.test.openStackTrace?%5B%22%5Ctat%20org.mockito.internal.configuration.plugins.PluginInitializer.loadImpl(PluginInitializer.java%3A53)%22%2C%22vscode-java-test-sample%22%5D))
... 33 more
Caused by: java.lang.NoSuchMethodError: net.bytebuddy.asm.AsmVisitorWrapper$ForDeclaredMethods.constructor(Lnet/bytebuddy/matcher/ElementMatcher;[Lnet/bytebuddy/asm/AsmVisitorWrapper$ForDeclaredMethods$MethodVisitorWrapper;)Lnet/bytebuddy/asm/AsmVisitorWrapper$ForDeclaredMethods;
at org.mockito.internal.creation.bytebuddy.InlineBytecodeGenerator.([InlineBytecodeGenerator.java:136](command:_java.test.openStackTrace?%5B%22%5Ctat%20org.mockito.internal.creation.bytebuddy.InlineBytecodeGenerator.%3Cinit%3E(InlineBytecodeGenerator.java%3A136)%22%2C%22vscode-java-test-sample%22%5D))
at org.mockito.internal.creation.bytebuddy.InlineDelegateByteBuddyMockMaker.([InlineDelegateByteBuddyMockMaker.java:315](command:_java.test.openStackTrace?%5B%22%5Ctat%20org.mockito.internal.creation.bytebuddy.InlineDelegateByteBuddyMockMaker.%3Cinit%3E(InlineDelegateByteBuddyMockMaker.java%3A315)%22%2C%22vscode-java-test-sample%22%5D))
at org.mockito.internal.creation.bytebuddy.InlineByteBuddyMockMaker.([InlineByteBuddyMockMaker.java:23](command:_java.test.openStackTrace?%5B%22%5Ctat%20org.mockito.internal.creation.bytebuddy.InlineByteBuddyMockMaker.%3Cinit%3E(InlineByteBuddyMockMaker.java%3A23)%22%2C%22vscode-java-test-sample%22%5D))
... 38 more
The test works correctly if a recent version of byte-buddy is added to runtimeClasspath(not testRuntimeClasspath) with implementation configuration. Please check working commit tag for working sample. Thanks.
The text was updated successfully, but these errors were encountered:
Java test runner extension does not resolve correct test classpath.
Vs Code Info
Test Runner for Java version :
v0.35.0
Sample Code Repository
Please checkout to the commit tag
error
to reproduce the issue.Project dependency.
Above is dependencies for the project. While
hibernate
depends on oldbyte-buddy
version(1.6.4)(listed inruntimeClasspath
),mockito
depends on recent version(1.12.9) ofbyte-code
(listed intestRuntimeClasspath
). When test is executed, the recent version(1.12.9) ofbyte-buddy
intestRuntimeClasspath
should be added to classpath, but instead the extension adds old version(1.6.4) ofbyte-buddy
and leads to exception below.The test works correctly if a recent version of
byte-buddy
is added toruntimeClasspath
(nottestRuntimeClasspath
) withimplementation
configuration. Please checkworking
commit tag for working sample. Thanks.The text was updated successfully, but these errors were encountered: