SeanGuo的开发日记 seanguo,JAVA,开发工具
未识别博客 · anndefans · 2004-02-10
SeanGuo的开发日记
seanguo,JAVA,开发工具,WEB SERIVICES,关系数据库,UML/MDA,扯淡
|
首页
|
心目中的编程高手>>>
ant于junit结合的简单例子
时间:2004-02-10
ant 提供了两个 target : junit 和 junitreport
运行所有 测试用例 ,并生成 html 格式的报表
具体操作如下:
1.将 junit.jar 放在 ANT_HOME\lib 目录下
2.修改 build.xml ,加入如下 内容:
<property name=
"report"
value=
"report"
/>
<target name=
"junitreport"
depends=
"clean, compile"
>
<junit printsummary=
"on"
fork=
"true"
haltonfailure=
"false"
failureproperty=
"tests.failed"
showoutput=
"true"
>
<classpath refid=
"myclasspath"
/>
<formatter type=
"xml"
/>
<batchtest todir=
"${report}"
>
<fileset dir=
"${build}"
>
<include name=
"**/*Test.*"
/>
</fileset>
</batchtest>
</junit>
<junitreport todir=
"${report}"
>
<fileset dir=
"${report}"
>
<include name=
"TEST-*.xml"
/>
</fileset>
<report format=
"frames"
todir=
"${report}"
/>
</junitreport>
<fail
if
=
"tests.failed"
>
---------------------------------------------------------
One or more tests failed, check the report
for
detail...
---------------------------------------------------------
</fail>
</target>
运行 这个 target ,ant 会运行每个 TestCase
在 report 目录下就有了 很多 TEST*.xml 和 一些网页
打开 report 目录下的 index.html 就可以看到很直观的测试运行报告,一目了然。
anndefans
引用Trackback(0)
|
编辑
评论
过来看看,发现我完全看不懂啊:)
这里有个人深受DELPHI之罪,你去帮帮他吧!http://www.blogcn.com/user2/cassie/main.asp
microspace
(
www.swordi.com
看到小容的留言,就过来这里看看了。
真没想到,在blog上碰见的素不相识的小容这么热心。
所以无论seanguo有没有时间(呵呵,有的问题只有操作才能解决的~~),我们都先交个朋友吧!^_^
cassie
(
www.blogcn.com/user2/cassie/main.asp
谢谢大家光临,我这就区看看,能帮得到得一定劲力
SeanGuo
(
hiyuwei.blogbus.com
Seanguo好,我的程序已经检查完了,报告也上交了,一切顺利。谢谢你哦:)
cassie
(
呵呵,不客气,我也没帮到什么,主要是你自己琢磨的。
SeanGiuo
(
hiyuwei.blogbus.com
发表评论
最后更新
文章发布预告
不知所云
连通.NET和Java
将现有的 Java 语言代码自动转换成 Visual C#
转载showModalDialog和showModelessDialog使用心得
Rational rose生成代码及其反向工程功能手册(简略翻译+个人补充)
up
hibernate,哀号遍野
动态加载子项的树型菜单
状态不好
原始快照:web.archive.org