jboss-arquillian - Thorntail arquillian jacoco 测试用例覆盖率显示 0%
问题描述
我正在使用 thorntail 框架并使用 Arquillian 开发集成测试用例。当我尝试生成测试用例覆盖率报告时,它显示 0% 的覆盖率。我已经尝试了许多解决方案,包括 thorntail-example、arquillian jacoco 扩展,但无法解决这个问题。下面是我的 pom.xml
<profile>
<id>jacoco</id>
<dependencies>
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>org.jacoco.core</artifactId>
<version>${version.jacoco}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.extension</groupId>
<artifactId>arquillian-jacoco</artifactId>
<version>${version.arquillian_jacoco}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.15</version>
<executions>
<!-- Ensures that both integration-test and verify goals of the Failsafe
Maven plugin are executed. -->
<execution>
<id>integration-tests</id>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<!-- Sets the VM argument line used when integration tests are run. -->
<argLine>${failsafeArgLine}</argLine>
<!-- Skips integration tests if the value of skip.integration.tests
property is true -->
<skipTests>false</skipTests>
<systemPropertyVariables>
<thorntail.arquillian.jvm.args>${failsafeArgLine}</thorntail.arquillian.jvm.args>
</systemPropertyVariables>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${version.jacoco}</version>
<executions>
<execution>
<id>pre-integration-test</id>
<phase>pre-integration-test</phase>
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
<!-- Sets the path to the file which contains the execution data. -->
<destFile>${jacoco.it.execution.data.file}</destFile>
<!-- Sets the name of the property containing the settings for JaCoCo
runtime agent. -->
<propertyName>failsafeArgLine</propertyName>
</configuration>
</execution>
<execution>
<id>post-integration-test</id>
<phase>post-integration-test</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<!-- Sets the path to the file which contains the execution data. -->
<dataFile>${jacoco.it.execution.data.file}</dataFile>
<!-- Sets the output directory for the code coverage report. -->
<outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
这是我的 arquillian.xml
<container default="true" qualifier="daemon">
<configuration>
<property name="host">localhost</property>
<property name="port">${thorntail.arquillian.daemon.port:8085}</property>
<property name="javaVmArguments">${thorntail.arquillian.jvm.args:}</property>
</configuration>
</container>
<extension qualifier="jacoco">
<property name="includes">com.*</property>
</extension>
解决方案
推荐阅读
- webots - 有没有办法保存模拟的所有状态,然后在我们重新启动 Webots 时从那里恢复?
- linux - 用于 arm-linux 的交叉编译器 libntoh
- vue.js - Vue.component 和新 Vue 的区别?
- r - 在 r 中固定 x 轴和绘图的网格线
- delphi - DELPHI INDY - 找不到激活 UTF8 编码/解码的参数
- c# - Unity RPG,正确施法不使用法力,但仍在承受伤害
- python - 如何在自己的视图中使用 LoginView 并在 HTML 模板中显示?
- ios - 有没有办法在通知中心修复本地通知,所以它不能在 swift 中清除
- ios - 动画没有从预期的位置中心开始,而不是从顶部开始
- php - 在 WooCommerce 单个产品页面上获取“added_to_cart”JS 事件的产品属性