cobertura

Measure unit code coverage % for function/method on Cyclomatic Complexity?

Deadly 提交于 2019-12-11 10:35:50
问题 Is there an approach to collect/report on unit test coverage based on a complexity ratio such as Cyclomatic Complexity on a method/function level? The reason/intent is to provide a measurable metric to show any areas that have a higher chance of defects based on complexity actually have appropriate unit test coverage (i.e. a metric away out of '100%' or '80%' coverage by changing the metric to '100% of Cyclomatic Complexity >= 10 for example). My usecase is currently Java/junit, and a

What versions of cobertura and surefire plugins work together under maven3?

。_饼干妹妹 提交于 2019-12-11 09:37:02
问题 What versions of cobertura and surefire plugins work together under maven3 ? After switching to maven3 I've found out, that mvn cobertura:cobertura is no longer generating report about test coverage (the coverage displayed is 0%). It was working under maven2... However, after finding, that in one of the other projects reports are still working, I've analysed the effective pom. After finding out I was using other versions of plugins, I've downgraded maven-surefire-plugin from version 2.8 to 2

maven-cobertura-plugion does not show the sources [closed]

纵然是瞬间 提交于 2019-12-10 23:39:11
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 8 years ago . When I generate a Cobertura report by running "mvn cobertura:cobertura" (or "mvn site") then a report is generated which shows the test coverage for my

Maven + Cobertura : Unable to locate [Your Class]. Have you specified the source directory?

末鹿安然 提交于 2019-12-10 22:08:32
问题 I have "MyMath" class with 2 simple methods: "multi" and "add". And test class which will only test multi method. public class MainTest { @Test public void testMultiply() { MyMath tester = new MyMath(); // check if multiply(10,5) returns 50 assertEquals("10 x 5 must be 50", 50, tester.multi(10, 5)); } } My project structure is: JenkinsTest/ src/ main/Main.java math/MyMath.java test/MathTest.java And pom.xml at root of project. I am trying to generate coverage report using cobertura-maven

Combine cobertura code coverage reports of three separate projects

邮差的信 提交于 2019-12-10 17:18:35
问题 I have three projects which are stored in three separate repositories. Each of them is a individual mvn project. I wonder is there a way to aggregate three reports in one? I took a look at the cobertura aggregate function. But seems like it can only handle sub-modules of a project. Anybody has any suggestion? 回答1: The Maven plugin goal cobertura:cobertura supports an aggregate parameter that would work for all the projects in the reactor I suppose. But you seem to suggest the projects might

SonarQube 4.4 not displaying cobertura unit tests or code coverage for grails 2.4.3 with spock tests

China☆狼群 提交于 2019-12-10 17:12:06
问题 I have SonarQube 4.4 installed on my machine. I am trying to generate metrics for a grails (2.4.3) project that has tests written in Spock framework. However, sonar does not show unit tests results or unit tests coverage. I verified that cobertura coverage.xml gets generated in the path provided below target/test-reports/cobertura/coverage.xml And I have sonar.groovy.cobertura.reportPath property in my pom.xml mapped to the above path. Running mvn sonar:sonar (maven version 3.2.3) on this

How to remove specific Cobertura warning?

China☆狼群 提交于 2019-12-10 10:46:09
问题 When i am running my ANT build script, Cobertura is complaining with the following warning. With that, i am wondering what it means really and how can i turn it off. [ cobertura-instrument] WARN visitEnd, No line number information found for class com.x.y.z.A. Perhaps you need to compile with debug=true? ANT sample below: <target name="instrument" depends="init,compile" > <delete file="cobertura.ser" /> <delete dir="${instrumented}" /> <cobertura-instrument todir="${instrumented}"> <ignore

Kill JVM not forcibly from command line in Windows 7

吃可爱长大的小学妹 提交于 2019-12-10 10:06:01
问题 I have Cobertura instrumented jar running in JVM. When I press Ctrl-C in Windows console, where application runs, JVM ends and Cobertura results are successfully flushed to cobertura.ser file . But I need stop this JVM with command/tool (not Ctrl-C), something like "soft kill" in Linux ("kill" command without "-9" parameter). When I use "taskkill /PID 1234", it writes: D:\>taskkill /PID 1234 ERROR: The process with PID 1234 could not be terminated. Reason: This process can only be terminated

Maven2 Multiproject Cobertura Reporting Problems During mvn site Build

橙三吉。 提交于 2019-12-10 09:42:07
问题 We've got a multiproject we're trying to run Cobertura test coverage reports on as part of our mvn site build. I can get Cobertura to run on the child projects, but it erroneously reports 0% coverage, even though the reports still highlight the lines of code that were hit by the unit tests. We are using mvn 2.0.8. I have tried running mvn clean site , mvn clean site:stage and mvn clean package site . I know the tests are running, they show up in the surefire reports (both the txt/xml and site

Cobertura : how to cover spring-data @Repository interfaces

半腔热情 提交于 2019-12-09 16:12:03
问题 Regarding following information : https://stackoverflow.com/a/14601831/704246 Cobertura does not instrument interfaces I'd like to know how to add spring-data interfaces to coverage results, since @Repository implementation classes are only declared and instantiated by Spring at runtime. Consider following interface : // src/main/java/my/package/MyObjectRepository.java @Repository public interface MyObjectRepository { MyObject findMyObjectByCodeAndName(String code, String name); } and