The lastest version of EMMA - 2.1.5320 - introduces a new command line tool called ctl which allows coverage data to be captured remotely and prior to JVM exit. This works well in J2EE environments and is intended for such. Instrumentation still needs to be done prior to running tests (referred to as off-line mode) using EMMAs tool - instr. See:
which documents the few easy steps. I recently used EMMA to capture coverage data in J2EE environment but found it to be more useful when obtaining coverage metrics against a standalone component (.jar) to enhance the coverage as I developed tests.
As I understand it the best way to capture coverage data in J2EE environments is by using offline instrumentation - custom class loaders won't work very well and as such runtime patching of the bytecode is not useful.
I want to start testing EMMA and Clover on some real code from the JbossAS 4.2 testsuite - would you recommend any particular tests that I should test the code coverage tools with ? The testsuite is quite big but it is split in different categories. I'd like to get one test of each category and try the tools on it, but it's not easy for me to pick the right tests.
After smcgowan's comment I took a look at emma 2.1.5320 - I usually prefer to go with released code that's why I looked at 2.0.5312 first. What struck me is the fact that "2.1.5320" which is tagged "emma-testing" is year and a half old. I took the time to look at the emma forums at sf.net and the project's cvs repository. It seems like the project is not actively developed - the most recent changes in the CVS repository seem to be 10 months old. Also some of the comments on the forums indicate that the project is not being actively developed. In particular:
Nevertheless, emma looks to be a very good tool. I hope to come with
some real test results soon.
If you haven't selected some tests to focus on, you could try tests-jacc-security.