Fail to start JUnit test in 2017.2.5 (but gradle runs it fine)
I've gone back to a Kotlin (multi-module) project I've not touched in a month or two. I updated the Kotlin version to 1.1.50 - and can successfully build the project using gradle, executing the JUnit 5 unit tests.
However, when I try to run the tests from the IDE, they fail to launch with:
Testing started at 12:38 PM ...
objc[82054]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/bin/java (0x1052f24c0) and /Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre/lib/libinstrument.dylib (0x1053ba4e0). One of the two will be used. Which one is undefined.
Exception in thread "main" java.lang.BootstrapMethodError: java.lang.NoSuchMethodError: org.junit.platform.engine.TestDescriptor.containsTests(Lorg/junit/platform/engine/TestDescriptor;)Z
at org.junit.platform.launcher.TestPlan.from(TestPlan.java:79)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:147)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:90)
at org.jetbrains.spek.tooling.runner.junit.JUnitPlatformSpekRunner.run(JUnitPlatformSpekRunner.kt:107)
at org.jetbrains.spek.tooling.MainKt.main(Main.kt:58)
Caused by: java.lang.NoSuchMethodError: org.junit.platform.engine.TestDescriptor.containsTests(Lorg/junit/platform/engine/TestDescriptor;)Z
at java.lang.invoke.MethodHandleNatives.resolve(Native Method)
at java.lang.invoke.MemberName$Factory.resolve(MemberName.java:962)
at java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:987)
at java.lang.invoke.MethodHandles$Lookup.resolveOrFail(MethodHandles.java:1390)
at java.lang.invoke.MethodHandles$Lookup.linkMethodHandleConstant(MethodHandles.java:1746)
at java.lang.invoke.MethodHandleNatives.linkMethodHandleConstant(MethodHandleNatives.java:477)
... 5 more
Process finished with exit code 1
Any idea why IDEA fails to start the test runner?
Thanks,
--
Greg.
Please sign in to leave a comment.
Twiddling JUnit versions in Gradle seems to have fixed it.