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 閱讀(549) 評論(0)  編輯  收藏 所屬分類: java

          導航

          <2025年7月>
          293012345
          6789101112
          13141516171819
          20212223242526
          272829303112
          3456789

          統計

          常用鏈接

          留言簿(6)

          隨筆分類

          隨筆檔案(17)

          文章分類(86)

          收藏夾(3)

          flex blog

          good site

          java blog

          my friend

          tools

          抓蝦

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 报价| 黎川县| 黄冈市| 廉江市| 巴南区| 新龙县| 永修县| 武强县| 海林市| 凭祥市| 宜春市| 河南省| 沙洋县| 益阳市| 桂平市| 茶陵县| 龙海市| 信宜市| 陆川县| 盱眙县| 仲巴县| 安仁县| 忻州市| 开远市| 金寨县| 盐城市| 华池县| 福州市| 微山县| 西宁市| 田东县| 麻阳| 星子县| 壶关县| 无棣县| 喀喇沁旗| 株洲市| 独山县| 紫阳县| 嵩明县| 股票|