cobertura

cobertura on maven multi module project

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-28 22:39:21
I have a Maven project with 4 modules - 3 of them contain code and some tests (testing equals and hashcode of the classes) whereas the 4th module is for testing the 3 other modules. Now I want to run the cobertura code coverage tool to get an overview which classes are well tested and which are not. I did some investigations on that topic and it seems that cobertura is not aware of generating the right code coverage percentages and line coverages, if some sources which are tested are located within other modules. I have read over some links like SeamTestCoverageWithCobertura and Using the

Cobertura & Java 7 support

北城以北 提交于 2019-11-28 22:37:40
Any ideas when cobertura will support java 7? Found http://sourceforge.net/tracker/index.php?func=detail&aid=3295711&group_id=130558&atid=720018 We preferred cobertura over emma and other code coverage tools and looks like we have to redo all those again, now that none of them support java 7 yet. Thanks Cobertura 2.0.3 supports Java 7, the cobertura-maven-plugin version 2.6 which uses this version has been just released T.K. I was able to get it to work by adding the following argument: -XX:-UseSplitVerifier I got it from here . I think the answer is: it won't. There is discussion on the

What are the differences between the three methods of code coverage analysis?

好久不见. 提交于 2019-11-28 19:31:59
This sonar page basically lists the various methods employed by different code coverage analysis tools: Source code instrumentation (Used by Clover ) Offline byte code instrumentation (Used by Cobertura ) On-the-fly byte code instrumentation (Used by Jacoco ) What are these three methods and which one is the most efficient and why?If the answer to the question of efficiency is "it depends" , then please explain why? Source code instrumentation consists in adding instructions to the source code before compiling it. These instructions are used to trace which parts of the codes have been executed

Differences between Line and Branch coverage

一笑奈何 提交于 2019-11-28 15:14:43
问题 I use the Cobertura Maven plugin for one of my project. But I have a question about the generated report: What is the difference between line and branch coverage? 回答1: Line coverage measures how many statements you took (a statement is usually a line of code, not including comments, conditionals, etc). Branch coverages checks if you took the true and false branch for each conditional (if, while, for). You'll have twice as many branches as conditionals. Why do you care? Consider the example:

How to make SonarQube module analyze the project only once when sonar analysis is bound to maven lifecycle in a multi-module project?

只谈情不闲聊 提交于 2019-11-28 04:08:48
问题 What I am trying to achieve is integrate SonarQube analysis into the build process, so that whenever mvn clean install is run, the code is analyzed with SonarQube. We want to use it for local analysis and also for build on Jenkins. If new issues are found, than the build should fail (we want to use build breaker plugin for that). This way the developer would know that by his code his is going to introduce new issues, and will have to fix them for the build to work. When I run mvn sonar:sonar

running junits and cobertura with maven

跟風遠走 提交于 2019-11-27 21:56:49
In our project, we run both junits and cobertura using maven. The problem I am facing is that, junit test cases are running twice, once before the jar creation process and then once again for generating cobertura coverage reports. When running cobertura and junits with ant, we run junits only once since, cobertura runs along with junits. Is there a way to configure the above case with maven. I know we can use "maven.test.skip" property to skip junits. But when I do this, I am not able to see junit xml & html file reports. Also, in maven how to configure junits to run in batch or parallel ?

cobertura on maven multi module project

余生长醉 提交于 2019-11-27 21:07:55
问题 I have a Maven project with 4 modules - 3 of them contain code and some tests (testing equals and hashcode of the classes) whereas the 4th module is for testing the 3 other modules. Now I want to run the cobertura code coverage tool to get an overview which classes are well tested and which are not. I did some investigations on that topic and it seems that cobertura is not aware of generating the right code coverage percentages and line coverages, if some sources which are tested are located

JUnit: testing helper class with only static methods

谁说我不能喝 提交于 2019-11-27 10:48:15
问题 I am testing a helper class with only static methods with JUnit4 and Cobertura. Testing methods was easy task and is done already. However, cobertura shows that the class is not covered by tests completely, as it is not instantiated anywhere. I don't want to create an instance of this class (it is a helper class), so first solution is to hide constructor (which is generally good approach for helper class). Then cobertura complains that the empty private constructor is not covered by tests. Is

Exclude methods from code coverage with Cobertura

折月煮酒 提交于 2019-11-26 19:50:33
Is there a way to exclude code from inclusion into Cobertura coverage reports? We have some methods that should not be included in the coverage report and therefore not drive down the coverage numbers. I know that Clover has such a functionality, but I have not found anything similar for Cobertura. Juha Syrjälä You can exclude classes from instrumentation. Then they should not appear on reports. See exclude statements below. You can also ignore calls to some methods. See ignore statement below. If you are using maven, see maven plugin manual . <configuration> <instrumentation> <ignores>

Testng, Emma, Cobertura, coverage and JDK 7 result in ClassFormatError and VerifyError

我只是一个虾纸丫 提交于 2019-11-26 16:07:43
I have switched to the newest JDK 7 and I am having problems with running testng unit test on byte code that is fiddled by emma coverage tool. None of my test cases are run correctly and for most of them I am receiving such errors. java.lang.ClassFormatError: Illegal local variable table length 10 in method measurement.meter.AbstractSerialPortMeter.<init>(Lmeasurement/meter/SerialPort;)V at measurement.meter.Elc3133aTest.setUp(Elc3133aTest.java:42) I have found an article here JSR 292 Goodness Fast Code Coverage Tool Less 10k , which is saying that "JSR 292 introduces a new bytecode