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.

1 comment
Comment actions Permalink

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.

 

0

Please sign in to leave a comment.