Cobertura

Today the autobuild failed reporting us that our trial license of clover had expired. Instead of buying a $1500 license I decided to check cobertura.

Cobertura is a free Java tool that calculates the percentage of code accessed by tests. It can be used to identify which parts of your Java program are lacking test coverage. It is based on jcoverage.

Cobertura is availlable from the codehaus sandbox, and I had to follow the instructions on the main sandbox page to get the plugin to be downloaded from the repository.

Normally this should be all. In this case, this was point where it got nasty!

The ‘mvn site’ command failed reporting a missing class (java.lang.NoClassDefFoundError: org/apache/maven/wagon/util/FileUtils). Searching for this problem yielded only 1 useful repsonse: the error is fixed in svn….

The scm url on the projectsite didn’t work so I googled arround to find the the repository:

http://svn.mojo.codehaus.org/trunk/mojo/mojo-sandbox/cobertura-maven-plugin/

After downloading the sources:

http://svn.mojo.codehaus.org/trunk/mojo/mojo-sandbox/cobertura-maven-plugin.tar.gz?view=tar

and building the plugin (and tagging it as a new version) by hand it actually worked:

coverage

Since the picture shows actual production code I had to scale it down / obfuscate it… but if you are interested, the cobertura website contains a sample report.


1 Response to “Cobertura”

  1. 1 dimi123

Leave a Reply





About

Welcome to the weblog of Peter Maas. Here you'll find various posts related to stuff I like (like my kids and espresso) and stuff I do (like developing software).

JavaOne 2008 Pictures


Scribbled Sun Logo golden_gate_warning_sign Golden Gate Hotel room pub javaone 2008 goodybag Stretched Limo Joshua Bloch at JavaOne2008 Stage being build in the nearby park smashmouth javaone2008 keynote Acme Anvile at CommunityOne Keynote sea_lion alcatraz Community One Keynote nearby hotel Cable Car line Rudie Moscone Center - JavaOne Okke en Rudie
View more photos >

Categories



Meld u aan voor PayPal en begin direct met het accepteren van creditcardbetalingen.