Once I started writing unit tests for the objects I was persisting into the HRD in App Engine via JDO, I've noticed that the coverage for all of my classes was below 100%. This didn't seem right to me because I was certain that I was testing everything.
The coverage tool that I was using was EclEmma
. After reading around and experimenting a little, I was certain that EMMA
can't handle the instrumentation that the JDO post-compilation step does to the classes.
This is the kind of result I was getting with the EclEmma plugin:
As soon as I switched to the eCobertura
plugin, my code coverage for the same class went to 100%.
There are some drawbacks of using eCobertura, it doesn't feel as mature and doesn't have as nice an interface or configuration screens, it's also noticeably slower. However, despite all of these, I am going to stick with it because it gives me accurate results.
A quick disclaimer...
Although I put in a great effort into researching all the topics I cover, mistakes can happen.
Use of any information from my blog posts should be at own risk and I do not hold any liability towards any information misuse or damages caused by following any of my posts.
All content and opinions expressed on this Blog are my own and do not represent the opinions of my employer (Oracle).
Use of any information contained in this blog post/article is subject to this disclaimer