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 this programmatically/dynamically (not from the command line, Eclipse etc.).
Also, there is the case where there is a @Before
annotated method in the test class. So, when running an individual test method, the @Before
should run beforehand as well. How can that be overcome?
Thanks in advance.