I have to check if a certain Class<?>
object contains JUnit tests (both JUnit3 and JUnit4).
What is the best way to do that?
I have to check if a certain Class<?>
object contains JUnit tests (both JUnit3 and JUnit4).
What is the best way to do that?
Use Java reflection on the classes to find out.
For version 3 the class must extend TestCase.
For version 4 you can scan for annotations, see this: How to get annotations of a member variable?
Basically you have to do as if you were JUnit, maybe you can even reuse some of the existing JUnit code.