How to run a single method in a JUnit 4 test class? [duplicate]
问题 This question already has answers here : Run single test from a JUnit class using command-line (3 answers) Closed 6 years ago . I have looked at all the similar questions, but in my opinion, none of them give a solid answer to this. I have a test class (JUnit 4 but also interested in JUnit 3) and I want to run individual test methods from within those classes programmatically/dynamically (not from the command line). Say, there are 5 test methods but I only want to run 2. How can I achieve