Questions tagged [jacoco]

JaCoCo a coverage analysis tool. It runs as a JVM Agent and therefore does not require offline instrumentation.

JaCoCo is an EPL-licensed, open-source code coverage analysis tool. It runs as a JVM Agent and therefore does not require offline instrumentation.

Compared to Cobertura, it has lower runtime overhead but less precision. It is unable to record hit counts, it only records red/green, however it can show coverage on class, method, line, complexity, branch and instruction level. It also has the ability to merge the results of multiple analyses when generating a report.

QuickLinks:

Related Tags:

JaCoCo is the successor of the EclEmma Eclipse plugin for the Emma coverage tool. If a search through -tagged questions doesn't help, try searching for the tag.

The tag is used for general topics related to code coverage measurement.

1891 questions
0
votes
0 answers

jacoco prepare-agent not generating jacoco.exec files

Exes files are not generated. My profile for mvn sonar:sonar -Psonar-coverage I also read this thread. didn't help me jacoco's prepare-agent not generating jacoco.exec file sonar-coverage
dobre
  • 15
  • 5
0
votes
0 answers

Java code coverage tool on github without running on the local machine

Could SonarQube, Jacoco, or any other tool automatically run tests whenever I push to my repository, providing me with information if tests passed and code coverage information without running it on the local machine?
0
votes
1 answer

Jacoco instrumentation using tcp server method

I am trying to run integration tests on my java code from remote server, so whenever my tests hit my code server, jacoco records it. I am new to jacoco, till now i have gather that there is tcp server method which doesnot require any restart. I…
vansh madan
  • 128
  • 1
  • 1
  • 10
0
votes
1 answer

jacocoTest exclusion has no effect

I have a gradle project and I want to exclude some directories from TC coverage. This is what I am giving in the task jacocoTestReport { reports { xml.enabled true csv.enabled false html.enabled true } afterEvaluate { …
Yogi
  • 1,035
  • 2
  • 13
  • 39
0
votes
1 answer

ANT Task: SonarQube Scanner Code Coverage report using JaCoCo

I'm using the below property to generate JaCoCo XML report When I invoke this ANT Task from Jenkins, I'm seeing the below exception in Jenkins…
Krishna
  • 1,089
  • 5
  • 24
  • 38
0
votes
1 answer

Jacoco report 0% coverage on apache project run on intellij

I have written some unit tests for this project and got jacoco to work producing the reports but the coverage is 0% on every module.I'm working on intellij on Windows but i didn't read that the apache project OpenJpa is system dependant , so it…
0
votes
1 answer

Problems with Jacoco

I'm making an application for division, and it has a validator class. When I wrote some tests, Jacoco showed a line saying that it's not covered by tests, but it is. Code of Validator: public class ValidatorImpl implements Validator { …
0
votes
2 answers

Having difficulty to test an object created in a constructor

public counterPublisher() { try { ObjectPublisher objPub = new ObjectPublisher.build().port(55).build(); } catch(SocketException || UnknownHostException) { Logger.record(“...”); } @Test(expected = SocketExcetion) public void testConst() Throws…
Gunther
  • 13
  • 5
0
votes
1 answer

Jacoco exclude class coverage report zero for only branch

I am trying to exclude a class from our jacoco report. I did the following in build.graddle file: jacocoTestReport { dependsOn { test } reports { xml.enabled true } afterEvaluate { …
user13848425
0
votes
1 answer

Junit tests for Object Creation with final attributes (AssertJ)

I have a class with final attributes to report on error information. The constructor call is as shown in the snippet. @Test public void test_With_Message() throws ParseException { final Exception e = new…
Amogha Varsha
  • 89
  • 1
  • 1
  • 8
0
votes
0 answers

Jenkins Jacoco Report - unable to exclude packages from the report

I am using Jacoco for coverage report generation in Jenkins Pipeline. Note: This is not a maven based project While generating the report I want to exclude some of the packages. For example: paclage1 is to be excluded here Directory Structure: +…
0
votes
1 answer

Jacoco coverage giving ERROR for org/apache/log4j/Category in java class

I am trying to do the code coverage using Jacoco. I have written the Jacoco configuration in ANT script.Jacoco working fine without logs in code. But it is error out for loggers (apache log4j) added in my code. I tried to exclude the logs by adding…
0
votes
1 answer

Offline instrumentation with JaCoCo and Gradle

I have into the same problem quite a lot of people have here, which is getting proper code coverage information when using Jacoco/Gradle and Powermock. I have read all the various threads here and in other places and I have successfully managed to…
akortex
  • 5,067
  • 2
  • 25
  • 57
0
votes
1 answer

Need to exclude folders, or POM relative path from Jacoco code coverage in azure devops

Hi tried to exclude folders from Jacoco code coverage in Azure Devops i wanna exclude below paths src/main/java/com/ing/investment/remoteadvice/*/model/** src/main/java/com/ing/investment/remoteadvice/*/enums/** also tried adding -:…
ramesh reddy
  • 429
  • 2
  • 5
  • 12
0
votes
0 answers

Jacoco + Surefire Maven plugins always show 0% coverage

I got a multi-module maven project on which i want to generate a jacoco report with the unit coverage. Currently i am using arqullian surefire and jacoco maven plugins, which both are defined in only one module. The tests run on a JBoss EAP…
1 2 3
99
100