NOTE: This article is 3 years or older so its information may no longer be relevant. Read on at your own discretion! Comments for this article have automatically been locked, refer to the FAQ
for more details.
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.
Hope you found this post useful...
...so please read on! I love writing articles that provide beneficial information,
tips and examples to my readers. All information on my blog is provided free of
charge and I encourage you to share it as you wish. There is a small favour I ask in return however -
engage in comments below, provide feedback, and if you see mistakes let me know.
If you want to show additional support and help me pay for web hosting and
domain name registration,
donations, no matter how small, are always welcome!
Use of any information contained in this blog post/article is subject to this disclaimer
Other posts you may like...