I'm working with a large project with 50,000 source files about 5000 tests spread over 2000 classes. These are mostly JUnit 3 with a smattering of JUnit 4. These tests are run on a frequent (daily or weekly) basis from batch files to ensure the product is working and not suffering from regressions or other issues.
I want to enumerate through the source or class files and produce a list of classes and methods that represent the test cases in the project. I can compare this list to determine which tests are not being run by the batch files.
Is there any simple way to do this such as functionality in JUnit? Or is there functionality in JUnit I could programatically drive to get it, e.g. to scan a dir full of class files and figure out which are tests. I realise that I could write code to individually load each class and start examining it for certain characteristics but if something exists I'd like to be able to use it.
The second part of the question, is there any commonly used way to to annotate tests? If I could annotate tests I could potentially filter them and generate batch files on the fly that run them according to the filter criteria. e.g. run all tests which need a network connection, run all tests that use subsystem A and so on.
Is there anything which would help me do this? I realise I could roll my own annotation with a comma separated list of values or something, but perhaps this sort of thing has been formalised and there are tools that work with it.