spring

java花园

  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  4 随笔 :: 0 文章 :: 1 评论 :: 0 Trackbacks
 
    
    
<target name="junit" depends = "build" description="Execute Unit Tests">
        
<tstamp/>
        
<echo>${build.dir}echo>            
        
<junit printsummary ="yes">
            
<formatter type ="plain"/>        
            
<formatter type ="xml"/>        
             
<batchtest todir="${report.dir}">
               
<fileset dir="../${build.dir}" includes="**/WebControllerTest.class" />
           
batchtest>
        
junit>        
        
<mkdir dir="${report.dir}/html"/>        
        
<junitreport todir="${report.dir}">            
           
<fileset dir="${report.dir}">
               
<include name="TEST*-*.xml"/>
           
fileset>
            
<report format="noframes" todir ="${report.dir}/html"/>
        
junitreport>
    
target>

关键是   才能输出html报表,noframes是单页报表
posted on 2005-09-06 12:04 java花园 阅读(631) 评论(1)  编辑  收藏 所属分类: java

评论

# re: [写作中] ant自动运行junit测试 2008-09-08 13:40
你好,请教一下,junit输出的xml文件的名称是什么,是Test-?xml吗
只测试单个用例,用<test 怎么做啊?  回复  更多评论
  


只有注册用户登录后才能发表评论。


网站导航: