`

Ant -- junit and junitreport task

 
阅读更多
junit task
用于跑junit框架下的测试,使用它需要将junit jar 添加到构建路径。

属性:
haltonerror: 默认off, 当test error时 是否停止构建
haltonfailure: 默认off, 当test failure 时 是否停止构建
printsummary: 默认off,打印testcase的相关统计信息(on,off,
                  withOutAndErr)
errorProperty: test error的时候设置property
failureProperty: test failure的时候设置property
fork:在一个新的单独的JVM中运行测试,设置此属性为真, 可以进行如下设置----jvm,timeout,maxmemory等)
forkmode:包括三种模式----perTest(为每一个test class创建一个新的JVM进程,此项为默认的),perBatch(为每一个<batchtest>创建新jvm进程),once(仅仅只创建一个jvm进程)

内嵌元素:
<formatter>:type输出格式, 有xml, plain, brief or failure
              usefile 是否输出到文件,默认true
<batchtest>:todir 存在报告的地方, 默认是当前目录




junitreport task
通过junit task 生成的xml文件和stylesheet来生成可视的测试报告。 needs Apache Xalan 2.4.1+ or Xalan XSLTC

属性:
todir:报告文件的存放位置

内嵌元素:
<fileset>
<report>: format 生成的报告格式,有frame和noframe
          styledir 样式文件的位置, 名字为junit-frames.xsl or  junit-
                                 noframes.xsl
          todir 转化的报告文件存储位置
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics