Cobertura is a free Java code coverage reporting 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 should work on any platform with with Java 5 or newer. The Cobertura download packages include all the dependencies required (ASM, log4j, etc.)
Cobertura can be used either from the command line or via Ant tasks. You can even mix and match the command line and Ant tasks.
You must first tell Ant about the Cobertura Ant tasks using a taskdef statement. The best place to do this is near the top of your build.xml script, before any target statements.
<property name="cobertura.dir" value="C:/javastuff/cobertura" /> <path id="cobertura.classpath"> <fileset dir="${cobertura.dir}"> <include name="cobertura.jar" /> <include name="lib/**/*.jar" /> </fileset> </path> <taskdef classpathref="cobertura.classpath" resource="tasks.properties" />
Alternatively you can specify a classpath and a set of classes to include and exclude, and Cobertura will look through the classpath and only instrument the specified classes. When this method is used, Cobertura will instrument archives inside of archives. For example, if you have a war file which contains a jar file at WEB-INF/lib, Cobertura will extract the war, instrument the classes within the jar, then build a new war containing the instrumented jar.
View MANUFACTURERS Wallboard
Theme by Danetsoft and Danang Probo Sayekti