java—我的NetBeansIDE8.2上没有测试覆盖选项

sigwle7e  于 2021-07-09  发布在  Java
关注(0)|答案(0)|浏览(134)

我安装了“jacoco”,我可以使用它,但它在整个项目文件和自动工作。我还向pom.xml添加了插件代码,但没有工作。

<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.7.201606060606</version>
<executions>
    <execution>
        <id>default-prepare-agent</id>
        <goals>
            <goal>prepare-agent</goal>
        </goals>
    </execution>
    <execution>
        <id>default-report</id>
        <phase>prepare-package</phase>
        <goals>
            <goal>report</goal>
        </goals>
    </execution>
    <execution>
        <id>default-check</id>
        <goals>
            <goal>check</goal>
        </goals>
        <configuration>
            <rules><!-- implementation is needed only for Maven 2 -->
                <rule implementation="org.jacoco.maven.RuleConfiguration">
                    <element>BUNDLE</element>
                    <limits><!-- implementation is needed only for Maven 2 -->
                        <limit implementation="org.jacoco.report.check.Limit">
                            <counter>COMPLEXITY</counter>
                            <value>COVEREDRATIO</value>
                            <minimum>0.01</minimum>
                        </limit>
                    </limits>
                </rule>
            </rules>
        </configuration>
    </execution>
</executions>

如何查看每个测试类的测试覆盖率?我想为我的测试文件提供覆盖选项。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题