In the past, the API test coverage report
is generated based on static scanning. This means the scanner will read
the physical .class files of the JUnit testcases and determine what APIs
are being refereneced. This approach has limitation because it does not
allow the parser to trace through the run time method invocations (methods
called within a method). As a result, developers have to write extra code
to bring the coverage up.
After working with the TPTP folks, we
now have a way to do run time scanning. Here's what you need to do:
1. In org.eclipse.wtp.releng/testScript/test.xml,
instead of using the "runtests" target to run your JUnit tests,
use the "runapitests" target. You need to supply an extra parameter
called "package.includes". The value of "package.includes"
is used to filter out packages that you are not interested in. This is
a required parameter because run time scanning is time consuming, providing
filters helps the scan process to complete faster. Here's an example (for
the J2EE JUnit testcases):
Don't go crazy on this because run time
scanning will increase the time to run the JUnit testcases by quite a bit.
Feel free to let me know if you have any questions. Now, there's no excuse
on why you don't have full JUnit testcoverage :)
IBM Rational Software - Performance Analyst
IBM Toronto Lab.
8200 Warden Ave. Markham, Ontario, L6G 1C7
Internal mail: D3/R8V/8200/MKM (D3-268)
T/L: 969 3531
Tel: (905) 413 3531
Fax: (905) 413 4920