Questions tagged [maven-cobertura-plugin]

This tag is for questions related to the maven plugin that executes the Cobertura code coverage utility.

This tag is for questions related to the maven plugin that executes the Cobertura code coverage utility. It can generate a report about the coverages of junit tests in your project.

79 questions
1
vote
1 answer

Cobertura check is not failing the build

I created a basic maven package. The src/main/java directory contains: public class Blah { public int blah(){ return 1; } public int bluh(){ return 2; } } The src/test/java directory contains: import static…
dknight
  • 1,243
  • 10
  • 23
1
vote
0 answers

Jenkins cobertura plugin - comparison of code coverage reports

does anybody know if Cobertura provides possibility to automatically compare code coverage reports of two builds? If needed, I am always doing it manually in separate tabs in browser, which takes some time for larger modules
Jan Hruby
  • 1,477
  • 1
  • 13
  • 26
1
vote
0 answers

Cobertura does not work with Java 9

I have been using Java 8, now trying to upgrade to java 9. Most of the things works except generation of unit test cases report, I am using Cobertura. With Java 9 I get following error, seems like Cobertura still references tools.jar which is…
Atul Sureka
  • 3,085
  • 7
  • 39
  • 64
1
vote
0 answers

Can I fail my Maven build based on an existing Karma coverage report?

I use Maven to build a multi-component project. One of the components is a web app with HTML and JavaScript. Maven invokes NPM and Karma to run that component's unit and integration tests, written in QUnit. This yields two independent Cobertura…
Florian
  • 4,821
  • 2
  • 19
  • 44
1
vote
1 answer

Cobertura report not increasing the code coverage with Powermock

I am using Cobertura maven plugin [version 2.7] to understand the code coverage for my tests. I am using PowerMock [version 1.6.6] to mock dependent objects. But when I run mvn cobertura:cobertura and check the report, the coverage remains the same.…
1
vote
0 answers

Cobertura Exception in thread "main" java.lang.NoClassDefFoundError: net/sourceforge/cobertura/coveragedata/LightClassmapListener

I am trying to build a jar file with Cobertura and I am getting this error when I run the file. I downloaded all the files and put them all together in my '/lib' folder; so I have all Cobertura files there. Here is my build.properties file #…
user5412293
1
vote
1 answer

Cobertura not showing coverage for inherited class

I am facing one issue with cobertura coverage in generated report. mvn cobertura:cobertura I have a class like public class ChildClass extends ReqBuilder This line I am not able to cover. Why we…
Pradeep
  • 1,947
  • 3
  • 22
  • 45
1
vote
1 answer

Trying to get jacoco report for my project using jenkins. But its giving wrong report. it includes __cobertura* methods also

I am trying to get jacoco report for my project using jenkins. But its giving wrong report. it includes __cobertura* methods also. effective pom here I am getting correct report using maven install from eclipse. But if I build using jenkins for…
1
vote
0 answers

cobertura maven plugin NoClassDefFound error

I have tried to integrate cobetura with maven. whenever I run cobertura:cobertura I get the following error 2016-08-27 23:26:46.018:WARN:oejs.ServletHandler:qtp2124261761-22: Error for /test/order-received/ java.lang.NoClassDefFoundError:…
user373201
  • 10,945
  • 34
  • 112
  • 168
1
vote
0 answers

maven Cobertura reports not working as expected

I am using maven with cobertura plugin for my application. The test class what I have written is for controller and running fine without any issues in eclipse.There are so many dependencies on other classes.I am using mockito and powermockito both…
Pradeep
  • 1,947
  • 3
  • 22
  • 45
1
vote
1 answer

Does cobertura maven plugin don't work with java8 Default Method declaration in interfaces?

I've declared my interface with java8 defult method declaration: public interface MyInterface { default String myMethod(String str) { //IMPLEMENTATION } } Next, i executed maven goal: mvn cobertura:cobertura The log shows error…
Hemã Vidal
  • 1,742
  • 2
  • 17
  • 28
1
vote
1 answer

How to use Cobertura maven plugin, so that the bytecode is not altered?

I recently tried to include cobertura plugin for our project. But I ran to a strange problem. Now, if I try to do this: mvn clean package cobertura:check-integration-test My project assembles just fine. But after deploy here is what I get as a…
SPIRiT_1984
  • 2,717
  • 3
  • 29
  • 46
1
vote
1 answer

Cobertura generating incorrect code coverage

I have a huge code base configured using maven. My codebase is divided in different maven modules and thus I have a main pom file and each sub module has its own pom file. But still these modules call each other's functionality. Junit tests are…
amit
  • 181
  • 2
  • 4
  • 20
1
vote
2 answers

Cobertura Checks Fail on Travis CI

In my Maven build, I use Cobertura to check that there is a certain minimal coverage: org.codehaus.mojo cobertura-maven-plugin 2.5.2
rolve
  • 10,083
  • 4
  • 55
  • 75
1
vote
2 answers

How to ignore Logger related If conditions while using Cobertura?

I am trying to increase JUnit test case coverage using Cobertura. The code has quite a lot of Loggers, and also If conditions to check whether Info or Debug is enabled. Ex: if (LOGGER.isInfoEnabled()) { LOGGER.info("Some info..."); } Now…
ybbs
  • 49
  • 1
  • 8