ant junit send mail

 

当 测试 有error ,失败后做就send mail

  1.     <property name="report" value="report" /> 
  2.     <target name="junitreport" depends="clean, compile"
  3.         <junit printsummary="on" 
  4.                 fork="true" 
  5.                 haltonfailure="false" 
  6.                 failureproperty="tests.failed" 
  7.                 showoutput="true"
  8.             <classpath refid="myclasspath"/> 
  9.             <formatter type="xml"/> 
  10.             <batchtest todir="${report}"
  11.                 <fileset dir="${build}"
  12.                     <include name="**/*Test.*"/> 
  13.                 </fileset> 
  14.             </batchtest> 
  15.         </junit> 
  16.         <junitreport todir="${report}"
  17.             <fileset dir="${report}"
  18.                 <include name="TEST-*.xml"/> 
  19.             </fileset> 
  20.             <report format="frames" todir="${report}"/> 
  21.         </junitreport> 
  22.         <fail if="tests.failed"
  23.             --------------------------------------------------------- 
  24.             One or more tests failed, check the report for detail... 
  25.             ------------------

           <mail mailhost="localhost" mailport="25" subject="Web Test Result">
                  <from address="webadm@gpe-hkg.com"/>
                  <to address="l.zhang@gpe-hkg.com"/>
          <message>Dear All,

            The test result link "http://192.6.4.102/flex/webtest/test".

     

    Best Regards,
    Web Team.</message>
            </mail>

    --------------------------------------- 
  26.         
  27.         </fail> 
  28.     </target> 

posted on 2007-10-09 17:27 leoli 阅读(531) 评论(0)  编辑  收藏 所属分类: java


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


网站导航:
 

导航

<2024年5月>
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

统计

常用链接

留言簿(6)

随笔分类

随笔档案(17)

文章分类(86)

收藏夹(3)

flex blog

good site

java blog

my friend

tools

抓虾

搜索

最新评论

阅读排行榜

评论排行榜