netbeans 测试报告生成

++++++++++++++++++ant 项目++++++++++++++++++

========================================================

拷贝 项目中的nbprojext 下的build-impl.xml 中的   -init-macrodef-junit 节点内容 到 buildimpl.xml中;

在 junit节点下添加

 

                <junitreport todir="${build.test.results.dir}">
                    <fileset dir="${build.test.results.dir}">
                        <include name="TEST-*.xml"/><!--生成的XML文件匹配模式-->
                    </fileset>

                    <!-- noframes 为无框架 网页  -->
                    <!--<report format="noframes" todir="${build.test.results.dir}/html"/>-->
                    <report todir="${build.test.results.dir}/html"/>
                </junitreport> 

========================================================

 

 

++++++++++++++++++maven 项目++++++++++++++++++

========================================================

在pom文件中添加 如下 配置

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <configuration>
                    <encoding>UTF-8</encoding>
                    <formats> 
                        <format>html</format> 
                        <format>xml</format> 
                    </formats>
                </configuration>
            </plugin>
        </plugins>
    </reporting>

在项目上 右键 属性 操作 添加定制

操作名:General TestDoc

执行目标:cobertura:cobertura

确定

在项目上 右键 定制 General TestDoc 即可生成 测试文档

目录为:

target

------------site

------------------------cobertura

------------------------------------css

------------------------------------images

------------------------------------js

------------------------------------index.html

------------surefire

------------surefire-reports

------------------------TEST-*.xml

 

打开index.html 即可看到测试文档

========================================================

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值