jacoco

jacoco simple integration test solution

浪尽此生 提交于 2019-12-17 10:03:23
问题 I am following the standard Maven pattern where I use a separate module for integration tests. This module has a wrapper class that executes the major dependent jar project. While the jar project has its own test cases, I am not interested in executing these. I want to see code coverage in the jar project when executed by the integration tests. Simple, no report aggregation. 回答1: Let me quote http://www.jacoco.org/jacoco/trunk/doc/report-aggregate-mojo.html even if its name contains a kind of

Android test code coverage with JaCoCo Gradle plugin

拈花ヽ惹草 提交于 2019-12-17 07:17:44
问题 I'm new to Gradle and Android testing but I've already converted my Android project to build with Gradle. Now I'm trying to perform test coverage of an Android project with Gradle's JaCoCo plugin. I've added the following to my build.gradle file: apply plugin: 'jacoco' And when I run "gradle jacocoTestReport" the following error: Task 'jacocoTestReport' not found in root project '<project name>'. From the documentation I'm supposed to also apply plugin 'java' but it conflicts with plugin

Coverage per test - jacoco, tomcat and sonar

隐身守侯 提交于 2019-12-14 03:54:23
问题 I have looked around the net with lot of information regarding the topic scattered but not one that fits my need. I plan to measure the coverage of system test cases. Our system test cases run in a clustered environment supported by Tomcat server. So in different JVM. There are multiple instance of Tomcat running where system test cases run, hence I get multiple jacoco bump files at each Tomcat. I am attaching jacoco agent jar to tomcat startup as VM argument: -javaagent:org.jacoco.agent

Sonar maven jacoco code coverage for Multimodule project

徘徊边缘 提交于 2019-12-14 02:18:12
问题 I have a multimodule project with a parent pom.xml and two modules in it. Project.jar and Project.war. All the test cases are under Project.jar. When I run mvn sonar.sonar goal on the Parent pom, jacoco.exec is not getting generated and code coverage is blank. I have the following properties in the parent pom. <properties> <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin> <sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis> <sonar.jacoco.reportPath>${project.basedir}/target

JaCoCo and MR Jars

雨燕双飞 提交于 2019-12-14 00:24:05
问题 There is an issue with JaCoCo and the MultiRelease JAR files. Since the same class name exist on two places, JaCoCo complains: Caused by: java.lang.IllegalStateException: Can't add different class with same name: jodd/core/JavaBridge at org.jacoco.core.analysis.CoverageBuilder.visitCoverage(CoverageBuilder.java:107) at org.jacoco.core.analysis.Analyzer$1.visitEnd(Analyzer.java:96) How we can tell JaCoCo (in Gradle) to skip the classes from META-INF path? OR to behave like it should (use

用jacoco统计代码覆盖率:不依赖ant的解决方案

断了今生、忘了曾经 提交于 2019-12-13 21:09:32
参考网上的教程,用jacoco统计代码覆盖率,需要用到jacoco和ant,我原来的计划也是jacoco和ant的方案,后来研究发现其实不用ant也可以实现,省去了ant的安装和配置,更加灵活方便。 相关软件下载: Sudo Wget http://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz sudo wget http://search.maven.org/remotecontent?filepath=org/jacoco/jacoco/0.8.5/jacoco-0.8.5.zip -O jacoco-0.8.5.zip Sudo wget https://mirrors.tuna.tsinghua.edu.cn/apache//ant/binaries/apache-ant-1.9.14-bin.tar.gz 关于jacoco和ant的具体安装和环境变量配置过程这里就不多说了,自行百度 jacoco统计代码覆盖率过程: 以springboot工程为例主要步骤为: 启动jar包时,指定jacocoagent.jar做为javaagent(output模式有 file/tcpserver/tcpclient ) dump出统计数据

Android JAVA Byte Code missing after update Gradle and Build Tools

最后都变了- 提交于 2019-12-13 16:08:16
问题 I'm using Jacoco to create a coverage report and that was working fine until update Gradle and BuildTools version. Then I revert those changes and work again. Jacoco looks for .class files in here: ${buildDir}/intermediates/classes/debug This is app/build/intermediates/classes/debug . But I've notice that after the upgrade that path is missing, there's no classes dir inside intermediates My configuration which is working: Project Level Module classpath 'com.android.tools.build:gradle:3.1.4'

Test coverage for if statement with logical or (||) - with Java's short circuiting, what's the forth condition JaCoCo wants me to cover?

坚强是说给别人听的谎言 提交于 2019-12-13 13:12:41
问题 This is probably a rather simple question, but I'm at a loss... I have an if statement like the following: if(TheEnum.A.equals(myEnum) || TheEnum.B.equals(myEnum)) TheEnum can be A , B , C , ... G (more than just 4 options). JaCoCo (SONAR) tells me that there are four conditions I can cover here. Which ones are those? Isn't the entire set I can test for in this instance essentially if(true || not_evaluated) => true if(false || true) => true if(false || false) => false I'm pretty sure I can't

IT code coverage with sonar

不羁的心 提交于 2019-12-13 08:05:51
问题 I have the following task at hand: -- find IT code coverage for a project Given situation: -- IT code resides in a repository separate to the actual production code -- Production code that the tests were created for reside in more than one git repository. -- all of the above uses maven and are written in Java. I have tried following different tutorial and blogs but couldnt find a simpler answer. Can anyone either point me towards the right resource or give me hints for a kick start? 回答1: I

How do I setup coverage with GWT, maven, jacoco?

亡梦爱人 提交于 2019-12-13 07:24:55
问题 I am trying to generate code coverage for my GWT maven project. It works with my jUnit test mvn test jacoco:report But when I run mvn gwt:test jacoco:report an empty report is generated. How does I get code coverage when I'm running the gwt:tests? Pom.xml GWT: <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>gwt-maven-plugin</artifactId> <version>2.5.1</version> <configuration> <module>${gwtModule}</module> <gwtVersion>2.5.1</gwtVersion> <runTarget>https://localhost:8443/dashboard