jacoco

Display Sonar Code Coverage with jacoco.exec file in Sonar LTS 7.9.2

感情迁移 提交于 2020-05-15 19:11:48
问题 Recently I have updated SonarQube 7.9.2 in which sonar.jacoco.reportPaths property has been deprecated and need to use sonar.coverage.jacoco.xmlReportPaths . I don't have JaCoCo xml report generated and I am using ant for build and JUnit. Please help me to view the coverage on SonarQube with exec file. 来源: https://stackoverflow.com/questions/59527088/display-sonar-code-coverage-with-jacoco-exec-file-in-sonar-lts-7-9-2

Property 'sonar.jacoco.reportPath' is deprecated. Please use 'sonar.jacoco.reportPaths' instead

主宰稳场 提交于 2020-05-12 11:36:25
问题 Property 'sonar.jacoco.reportPath' is deprecated. Please use 'sonar.jacoco.reportPaths' instead. I keep getting this message when running SonarQube through Gradle and the phrase "reportPath" does not even appear even once in the entire multi-module project. I even put the sonarqube property under allprojects to override any defaults that may be there. Any tips on how I can get rid of this error? I am using: allprojects { sonarqube { properties { property "sonar.jacoco.reportPaths", "${project

Property 'sonar.jacoco.reportPath' is deprecated. Please use 'sonar.jacoco.reportPaths' instead

萝らか妹 提交于 2020-05-12 11:36:13
问题 Property 'sonar.jacoco.reportPath' is deprecated. Please use 'sonar.jacoco.reportPaths' instead. I keep getting this message when running SonarQube through Gradle and the phrase "reportPath" does not even appear even once in the entire multi-module project. I even put the sonarqube property under allprojects to override any defaults that may be there. Any tips on how I can get rid of this error? I am using: allprojects { sonarqube { properties { property "sonar.jacoco.reportPaths", "${project

Configure Jacoco with gradle and kotlin DSL

江枫思渺然 提交于 2020-05-11 19:02:02
问题 I'm trying to configure Jacoco to exclude some classes from analysis but can't find any working example :( I found some samples with afterEvaluate but no success 回答1: src/main/java/org/example/A.java : package org.example; class A { } src/main/java/org/example/B.java : package org.example; class B { } src/test/java/org/example/ExampleTest.java : package org.example; public class ExampleTest { @org.junit.Test public void test() { new A(); new B(); } } build.gradle.kts : plugins { java jacoco }

Configure Jacoco with gradle and kotlin DSL

拟墨画扇 提交于 2020-05-11 18:56:13
问题 I'm trying to configure Jacoco to exclude some classes from analysis but can't find any working example :( I found some samples with afterEvaluate but no success 回答1: src/main/java/org/example/A.java : package org.example; class A { } src/main/java/org/example/B.java : package org.example; class B { } src/test/java/org/example/ExampleTest.java : package org.example; public class ExampleTest { @org.junit.Test public void test() { new A(); new B(); } } build.gradle.kts : plugins { java jacoco }

increasing code coverage for JdbcTemplate mocking

冷暖自知 提交于 2020-05-11 11:01:54
问题 I am mocking JdbcTemplate for unit test cases, as don't want to hit actual database integration. But it is decreasing my code coverage (Red indicates missing coverage). Below is the snippet used. Same case happens by using user defined mappers. final List<String> resultList = new ArrayList<String>(); resultList.add("test1"); resultList.add("test2"); final JdbcTemplate template = Mockito.mock(JdbcTemplate.class); Mockito.when( template.query(Mockito.anyString(), Mockito.any(Object[].class),

increasing code coverage for JdbcTemplate mocking

六眼飞鱼酱① 提交于 2020-05-11 10:59:01
问题 I am mocking JdbcTemplate for unit test cases, as don't want to hit actual database integration. But it is decreasing my code coverage (Red indicates missing coverage). Below is the snippet used. Same case happens by using user defined mappers. final List<String> resultList = new ArrayList<String>(); resultList.add("test1"); resultList.add("test2"); final JdbcTemplate template = Mockito.mock(JdbcTemplate.class); Mockito.when( template.query(Mockito.anyString(), Mockito.any(Object[].class),

Getting jacoco report from cucumber tests with gradle

天涯浪子 提交于 2020-04-30 07:47:48
问题 I am working with gradle in a java project, I run my cucumber tests with a gradle task, something like this: task cucumber (){ //task that starts the app dependsOn 'jettyRunDaemon' jvmArgs '-javaagent:E:/MyProject/build/jacoco/jacocoagent.jar=destfile=build/jacoco/jacoco.cucumber.exec' doLast { javaexec { main = 'cucumber.api.cli.Main' classpath = sourceSets.main.output + sourceSets.test.output + configurations.testRuntime args = cucumberArgs() } } } List<String> cucumberArgs() { def args = [

Getting jacoco report from cucumber tests with gradle

无人久伴 提交于 2020-04-30 07:46:50
问题 I am working with gradle in a java project, I run my cucumber tests with a gradle task, something like this: task cucumber (){ //task that starts the app dependsOn 'jettyRunDaemon' jvmArgs '-javaagent:E:/MyProject/build/jacoco/jacocoagent.jar=destfile=build/jacoco/jacoco.cucumber.exec' doLast { javaexec { main = 'cucumber.api.cli.Main' classpath = sourceSets.main.output + sourceSets.test.output + configurations.testRuntime args = cucumberArgs() } } } List<String> cucumberArgs() { def args = [

Getting jacoco report from cucumber tests with gradle

╄→尐↘猪︶ㄣ 提交于 2020-04-30 07:45:07
问题 I am working with gradle in a java project, I run my cucumber tests with a gradle task, something like this: task cucumber (){ //task that starts the app dependsOn 'jettyRunDaemon' jvmArgs '-javaagent:E:/MyProject/build/jacoco/jacocoagent.jar=destfile=build/jacoco/jacoco.cucumber.exec' doLast { javaexec { main = 'cucumber.api.cli.Main' classpath = sourceSets.main.output + sourceSets.test.output + configurations.testRuntime args = cucumberArgs() } } } List<String> cucumberArgs() { def args = [