We are using Emma to get runtime code coverage of a middleware server product. We have chosen Emma for getting test coverage because of its the ability to collect run time coverage stats. Emma instruments the necessary jars of our product first and generate meta data files (*.em). When we execute the automated test framework against our product (which is a web service application server built on OSGI), it gathers the run time coverage data and when the server is stopped, it creates the coverage data file (*.ec). Hence, when we stop the server, it quits the current coverage session. Therefore, we cannot restart server and continue getting the coverage. Some of our tests in the automated test framework requires us to restart server multiple times. Because of this issue, we cannot get coverage after the server is restarted. We could not figure out a way to avoid this issue. We appreciate if anyone can help us to finding a solution.
Thanks
Charitha
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
starting the OSGi framework (or any Java app) multiple times for code coverage should not be a problem. By default EMMA merges the results in the .ec file, see .
If your OSGi implementation is based on Equinox, you might also check out the , which allows you to hook EMMA in any OSGi/Equinox app **without** instrumenting the JARs beforehand.
Hi folks,
We are using Emma to get runtime code coverage of a middleware server product. We have chosen Emma for getting test coverage because of its the ability to collect run time coverage stats. Emma instruments the necessary jars of our product first and generate meta data files (*.em). When we execute the automated test framework against our product (which is a web service application server built on OSGI), it gathers the run time coverage data and when the server is stopped, it creates the coverage data file (*.ec). Hence, when we stop the server, it quits the current coverage session. Therefore, we cannot restart server and continue getting the coverage. Some of our tests in the automated test framework requires us to restart server multiple times. Because of this issue, we cannot get coverage after the server is restarted. We could not figure out a way to avoid this issue. We appreciate if anyone can help us to finding a solution.
Thanks
Charitha
Hi Charitha,
starting the OSGi framework (or any Java app) multiple times for code coverage should not be a problem. By default EMMA merges the results in the .ec file, see .
If your OSGi implementation is based on Equinox, you might also check out the , which allows you to hook EMMA in any OSGi/Equinox app **without** instrumenting the JARs beforehand.
Best regards,
-marc
: http://emma.sourceforge.net/reference_single/reference.html#prop-ref.table.file
: http://www.eclemma.org/devdoc/headless.html
Thank you Marc for your quick response. We will try with your instructions and see.