Retrocess with version >3.15 JUnit 4 Runner
See original GitHub issueClone this repository.
It’s an Android Project what tries to use KotlinTest JUnit4 Runner. There’s a single test in this repository, called ExampleUnitTest
. It’s a simply assertion that 4 is 2+2.
When trying to execute this test using KotlinTest version 3.1.5
, it works correctly, using the following dependency:
testImplementation “io.kotlintest:kotlintest-runner-junit4:3.1.5”
However, if this version is promoted to anything above it, for instance:
testImplementation “io.kotlintest:kotlintest-runner-junit4:3.1.6”
Note that this happen with any version above 3.1.5, including the latest 3.1.8.
The test fails with this exception:
Exception in thread "main" java.lang.NoClassDefFoundError: org/junit/platform/launcher/TestExecutionListener
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at com.intellij.junit5.JUnit5IdeaTestRunner.createListeners(JUnit5IdeaTestRunner.java:39)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:45)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: java.lang.ClassNotFoundException: org.junit.platform.launcher.TestExecutionListener
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 16 more
Process finished with exit code 1
It seems to be a sometimes-happen issue, and sometimes I’ll get a green test. Most of the times I’ll get the above exception
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:24 (22 by maintainers)
Top GitHub Comments
This is hapenning with Intellij 2018.1 and 2018.2
For now, I couldn’t reproduce this specific scenario anymore.
If I come through this again, I’ll open a new ticket.
I’ll close this one for now.