How to run only selected Unit Tests from a class programatically?
Answered
Say I'd like to run 2 test methods in a Test class which has 100 tests. I know that this is possible because the Rerun Failed Tests action does exactly this. I've found a class related to this functionality:
AbstractRerunFailedTestsAction
but I don't know how to use it.
Please sign in to leave a comment.
Create "fake" run configuration from com.intellij.execution.junit.JUnitConfiguration and set tests to run accordingly programmatically, then execute as in com.intellij.execution.testframework.actions.AbstractRerunFailedTestsAction#execute.