Override JUnit Run Provider
I am writing a plugin to run tests for a custom test library.
My RunConfigurationProducer correctly creates a RunConfiguration from the context when the user clicks run on an individual test case.
However, if there is already a JUnit run configuration for this class then the junit configuration always takes preference.
If there is no junit configuration then it works fine.
I am overriding shouldReplace and isPreferredConfiguration (I have tried hardcoding these values to the 4 combinations of true/false).
I have also tried setting order="first" in the plugin xml.
No matter what I try, I cannot get intellij to pick the configuration created by my plugin instead of the junit one.
Please sign in to leave a comment.
Please post full sources of your RunConfigurationProducer
Now when the caret is a test (here that is detected by style.testPath(element)) then the run producer is correctly invoked and the correct run config is created.However if you have previously ran a JUnit configuration for this class, then JUnit always "grabs" the config and won't allow this run provider to take precedence. I've tried all combinations of shouldReplace / isPreferred as well as the order field in the plugin.xml
> However if you have previously ran a JUnit configuration for this class, then JUnit always "grabs" the config and won't allow this run provider to take precedence
This behaviour is correct and by intention. And don't say that truly correct but this behaviour is not due to error, but just implemented so.
Why it is a problem for you? Already created RC wins.