Questions tagged [cobertura]

Cobertura is a free and open-source Java tool based on jcoverage that calculates the percentage of code and branches covered by tests.

Cobertura is a free and open-source Java tool (commonly called a code coverage tool) based on jcoverage that calculates the percentage of code and branches covered by tests.

Cobertura does this by instrumenting the compiled bytecode. It can be run from the command line, via an Ant task, via a Maven plugin, or via the eCobertura Eclipse plugin. Builds can be made to fail if the code coverage reported by Cobertura does not meet a user-set threshold value. XML and HTML reports can be generated as output.

649 questions
0
votes
1 answer

Prevent test errors in 'mvn site' goal with ROME dependency and cobertura-maven-plugin

In a Maven based project some of the JUnit tests fail, but only during a Maven site build. When executing mvn clean package all tests pass. But when executing: mvn clean site some of the tests generate the message: Could not initialize class…
Kwebble
  • 2,065
  • 14
  • 23
0
votes
1 answer

Cobertura code coverage test on Maven plugin

I'm trying to generate a code coverage report for a simple Maven plugin I've developed. Cobertura generates the report with the three classes in my project correctly, but it reports 0% code coverage even though the tests execute successfully. I've…
0
votes
2 answers

what is the performacne impact on instrumented jars vs non instrumented jars

What would be the performance impact if I instrument my java classes with cobertura or clover and deploy vs not instrument jars and deploy ? Will this have any significant difference in how application performs ? I tried this test on my web…
pbathala
  • 1,390
  • 2
  • 18
  • 39
0
votes
2 answers

cobertura:check seems to be missing parameters

I'm using cobertura with Maven to generate code coverage reports. We'd like to be able to fail the build when not enough code is covered by test cases. Based on the maven-cobertura-plugin's web page for "check", I configured my pom file like…
FrustratedWithFormsDesigner
  • 26,726
  • 31
  • 139
  • 202
0
votes
1 answer

How to run cobertura code coverage for few test classes not all of my test classes?

I am using Cobertura in eclipse to generate the code coverage for my java maven project and it works fine. I have around 15 tests classes. Whenever I am running maven build, it generates code coverage for all those 15 classes. Is there any way, I…
john
  • 11,311
  • 40
  • 131
  • 251
0
votes
1 answer

What's the performance cost of using Cobertura to create system test coverage reports?

I want to instrument my entire application, launch it, and then execute some system test runs. How much slower will my application run (manually testing so no ant JVM launch issues)? 1.5X, 2X, 10X, 20X,...
Lance Kind
  • 949
  • 12
  • 32
0
votes
1 answer

import netbeans generated Cobertura report xml into Sonar

I have generated my cobertura code covergage report using ant from netbeans but not able to import cobertura generated xml report into sonar. My plugin version using is as below : sonar-java-plugin-2.2 sonar-cobertura-plugin-1.6 Sonarqube version…
0
votes
1 answer

How to increase the conditional coverage using jmockit for cobertura?

I am trying to increase the code coverage for following below method using jmockit - Below is my method in DataLogger class for which I am trying to increase the coverage - public void logDebug(final Object... objects) { if…
AKIWEB
  • 19,008
  • 67
  • 180
  • 294
0
votes
1 answer

JAXB code runs fine everywhere except under Maven / Cobertura

I have a following piece of pretty standard JAXB code StringReader is = new StringReader(rspString); Unmarshaller ums = Util.createUnMarshaller(cL, Schemas.RECEIPT_SCHEMA, GetReceiptCallResponse.class); UnmarshallerHandler umsHandler =…
Vlad
  • 9,180
  • 5
  • 48
  • 67
0
votes
0 answers

Invalid cobertura report

I have to set up code coverage reports in Jenkins. I use gcovr to generate the reports. gcovr generates the report file.xml and this file is full. And I have got the following trouble: …
Vladimir Voitekhovski
  • 1,472
  • 5
  • 21
  • 33
0
votes
1 answer

Cobertura instrument war

I am attempting to instrument wars with Cobertura 1.9.4.1. For this, I use the following ant task, which is invoked using the maven-antrun-plugin:
Dormouse
  • 1,617
  • 1
  • 23
  • 33
0
votes
1 answer

logger.isDebugEnabled() is killing my code coverage. I'm planning to exclude it while running cobertura

I tried by adding in org.slf4j.* in cobertura.exclude. but there is no use. my buildfile require 'buildr/java/cobertura' require 'buildr/scala' require 'buildr/myProject' ..... ..... compile.options.other = %w(-encoding UTF-8) cobertura.exclude=…
0
votes
1 answer

Coverage report of multi module project

I am having a issue with generating code coverage report and getting an analysis of unit tests covering the project code. I have used Sonar to get a report on project but the unit test coverage section do not show anything. I have done some research…
Amit Kumar
  • 2,685
  • 2
  • 37
  • 72
0
votes
1 answer

cobertura via command line

I have a sample code with me which compiles and runs properly on my windows machine. My sample code consist of simple .java file and after compilation i got .class file also. I need to do code coverage for that using cobertura. I tried giving…
mRajKap
  • 1
  • 1
  • 1
0
votes
1 answer

how to check if class file or jar file is instrumented?

First Question - Is there any way i can verify that the specific jar files or class files has been instrumented using cobertura? Second Question - Can you please let me know if following ant scipt is fine. I dont get any output from this. nor…
Rajesh Kumar
  • 355
  • 3
  • 19