Extending JUnit plugin
Answered
Hi!
I've been trying to extend JUnit plugin in order to access JUnitConfiguration (extend it or access it's methods). Compiling project I get:
JUnitConfiguration runProfile = (JUnitConfiguration) environment.getRunProfile();
^
class file for com.intellij.execution.JavaTestConfigurationWithDiscoverySupport not found
I've added JUnit in build.gradle:
intellij {
plugins 'JUnit'
}
Maybe there's another way required to access JUnitConfiguration?
Thanks in advance!
Please sign in to leave a comment.
It is located in Java plugin, so Java plugin needs to be added as well as dependency, see https://blog.jetbrains.com/platform/2019/06/java-functionality-extracted-as-a-plugin/
Thanks a lot!
I'm running into a similar situation:
This is how my plugin.xml file looks like:
and this is how my gradle file looks like:
I'm positive “JUnit” is correct, as adding that makes my compile-time dependency on JUnitConfiguration compile. But when running my plugin, I get a
What may I be missing here?
Thanks
Please see for Java plugin dependency: https://plugins.jetbrains.com/docs/intellij/plugin-compatibility.html#java
You must also add a dependency on JUnit plugin in plugin.xml: https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
If
java.lang.NoClassDefFoundError
occurs at runtime, it means that either Step 3 was omitted or loading the plugin dependency failed (please check log files from Development Instance).