简体   繁体   中英

Sonar integration tests againts java classpath jars

I´m having a module C which contains a jar files from modudle A and BI´m running a java process with CP java -cp A.jar B.jar Main.class and I´m running some integration tests. Then a jacoco-it.exec file it´s created in C module, but I´´m afraid that when Sonar Queue scan the module in C tell me

10:55:50.562 INFO  - Analysing D:\Users\nb38tv\workspace\WS_F2ECORE_LTD\DG2\core\f2e-mock\..\target\jacoco-it.exec
10:55:50.578 INFO  - Analysing D:\Users\nb38tv\workspace\WS_F2ECORE_LTD\DG2\core\f2e-mock\target\sonar\jacoco-overall.exec
10:55:50.593 INFO  - No information about coverage per test.

Why Sonar cannot find the coberture of classes of A.jar and B.jar??

Regards.

This sentence does not refer to display of coverage in general, but to the ability of SonarQube to show which test contributes which coverage. This requires some additional configuration - quoting https://docs.sonarqube.org/display/PLUG/Usage+of+JaCoCo+with+Java+Plugin

Using some unit test listeners you can collect the information on which lines where covered by which tests

and this page also refers to an example at https://github.com/SonarSource/sonar-examples/tree/master/projects/languages/java/code-coverage/ut/ut-maven-jacoco

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM