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

cobertura code coverage and report generation only with class files is possible?

I am trying to use the cobertura- ant for code coverage. Here can i use the class files directly for instrumentation and use a DE compiler to get the java files for report generation? will it give the coverage correctly? Since i have only the class…
0
votes
1 answer

How to package Maven 2 generated-classes by Cobertura?

i have a Maven 2 project setup which nicely packages a war file using a pom.xml now i want to introduce Cobertura to that. I can succesfully instrument the classes but when i want to package the instrumented classes and deploy them to my jboss…
Marco
  • 15,101
  • 33
  • 107
  • 174
0
votes
2 answers

BUILD FAILURE in maven

I am trying to build my new-webapp module using maven, and whenever I am doing mvn install from the command prompt using cygwin, it gives me this error - $ mvn install [INFO] Scanning for projects... [INFO] [INFO]…
AKIWEB
  • 19,008
  • 67
  • 180
  • 294
0
votes
1 answer

How to exclude a sub-project with gradle cobertura plugin

We are using gradle-cobertura-plugin, and have a main project with lots of subprojects, but have to exclude cobertura for some subprojects. Tried using the following: project('test-modules:functional-tests') { cobertura { skip = true …
Paddy
  • 3,472
  • 5
  • 29
  • 48
0
votes
1 answer

cobertura maven pluginGenerate aggregate reports does not work

I discovered generating aggregate reports in multi-module projects only works if the maven aggregator pom project is also the parent project for sub modules. This really does not work for a lot enterprise level projects in which maven aggregator is…
Bobo
  • 8,777
  • 18
  • 66
  • 85
0
votes
0 answers

How can I get cobertura code coverage for Android MonkeyRunner tests?

We have been able to get cobertura code coverage for robolectic, using the steps mentioned at https://github.com/stephanenicolas/Quality-Tools-for-Android. For UI Automation, we are using MonkeyRunner. We have Emma code coverage setup for…
user1819441
  • 127
  • 2
  • 12
0
votes
1 answer

How much bytecodes does cobertura add to the source code?

Cobertura uses Offline byte code instrumentation, which means it will add instructions after the compilation into the byte-code. I have a very large generated method which now I'm trying to refactor. Itself is under 64KB JVM limitation, but after…
Edmond
  • 614
  • 2
  • 11
  • 26
0
votes
1 answer

coverage.xml not generated even though build successful in jenkins and cobertura instrumentation was successful

I am using Maven with jenkins and sonar to build src and generate reports on Sonar. I see build was successful in Jenkins (sonar added as post build action) but fails to create coverage.xml in local system. Due to which code coverage is unavailable…
Venkat
  • 273
  • 2
  • 3
  • 13
0
votes
1 answer

Cobertura does not recognize fully tested class

I am currently struggling with Cobertura not recognising code coverage for a given class in certain circumstances. Although the class is fully tested (method coverage 100%), Cobertura displays a coverage of 0%. There are other classes as well in…
u6f6o
  • 2,050
  • 3
  • 29
  • 54
0
votes
2 answers

Cobertura maven plugin incorrect version

I am using cobertura and when I specify version 2.5 it downloads 1.9. Why? My pom: org.codehaus.mojo cobertura-maven-plugin 2.5.2 …
0
votes
0 answers

Android Annotations and Cobertura: how to exclude the generated classes

We're using Android Annotations, Cobertura, and maven. Cobertura is pulling in the _ classes for unit test coverage. How can we exclude them? I tried adding the following to my pom but it only worked halfway. The classes no longer show in the report…
Ginger McMurray
  • 1,275
  • 2
  • 20
  • 42
0
votes
1 answer

Can't find JUnit on Mac

So I am trying to build a project from this tutorial. I run ant, and get the error. The first thing I see is ...error: package junit.framework does not exist [javac] import junit.framework.TestCase; The tutorial was very unspecific…
EasilyBaffled
  • 3,822
  • 10
  • 50
  • 87
0
votes
1 answer

ASM 4.1 visitLdcInsn Illegal type in constant pool

I am using ASM 4.1. I understand that the method visitLdcInsn requires version 49 or higher, however I am wondering how I could get visitLdcInsn to work with version 49 and lower. I know a solution is for people to compile with a higher version, but…
Steve
  • 1,145
  • 1
  • 11
  • 25
0
votes
1 answer

Sonar 3.4.1 Configuration is not showing CodeCoverage category -- why?

I am using Sonar 3.4.1, however the CodeCoverage Settings are not appearing on the General Settings configuration. General Settings Category CheckStyle Cobertura Database Cleaner ... Has anyone seen…
Mark
  • 139
  • 1
  • 9
0
votes
1 answer

nullpointer exception for logger

the below code is not working @BeforeClass public static void setUp() { service=new BusManager(); logger = mock(Logger.class); when(logger.isDebugEnabled()).thenReturn(true); doAnswer(new…
pratap m
  • 106
  • 2
  • 11