【问题标题】:jacoco code coverage of integration tests in a separate module in NetbeansNetbeans 中单独模块中集成测试的 jacoco 代码覆盖率
【发布时间】:2013-08-20 14:42:30
【问题描述】:

我有一个 Maven 项目,其集成测试存储在一个名为 my-project-tests 的模块中,生产代码分布在其他几个模块中。我可以通过在 pom.xml 中添加以下插件指令来获得单个模块的单元测试的代码覆盖率:

<plugin>
    <groupId>org.jacoco</groupId>
    <artifactId>jacoco-maven-plugin</artifactId>
    <version>0.5.7.201204190339</version>
    <executions>
        <execution>
            <goals>
                <goal>prepare-agent</goal>
            </goals>
        </execution>
        <execution>
            <id>report</id>
            <phase>prepare-package</phase>
            <goals>
                <goal>report</goal>
            </goals>
        </execution>
    </executions>
</plugin>

然后我可以按照the Netbeans wiki 中的说明查看测试报告。

但是,当我将它添加到我的集成测试模块时,报告显示“没有数据 - 你运行你的代码了吗?” (我有)。

生成了一个 jacoco.exec 文件,里面有很多数据,我无法确认数据是否正确。但是 Netbeans 依赖的一个单独的 jacoco.xml 文件大部分是空的。

有没有办法在 Netbeans 中正确生成和查看多模块项目的代码覆盖率?

【问题讨论】:

    标签: java maven netbeans code-coverage jacoco


    【解决方案1】:

    根据此错误,Netbeans 不支持此功能:https://netbeans.org/bugzilla/show_bug.cgi?id=223319

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-10-13
      • 2017-10-10
      • 1970-01-01
      • 2017-06-19
      • 2014-09-26
      • 2020-01-08
      • 2017-10-01
      相关资源
      最近更新 更多