ant junit send mail

           

          當(dāng) 測(cè)試 有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 閱讀(545) 評(píng)論(0)  編輯  收藏 所屬分類(lèi): java

          導(dǎo)航

          <2025年5月>
          27282930123
          45678910
          11121314151617
          18192021222324
          25262728293031
          1234567

          統(tǒng)計(jì)

          常用鏈接

          留言簿(6)

          隨筆分類(lèi)

          隨筆檔案(17)

          文章分類(lèi)(86)

          收藏夾(3)

          flex blog

          good site

          java blog

          my friend

          tools

          抓蝦

          搜索

          最新評(píng)論

          閱讀排行榜

          評(píng)論排行榜

          主站蜘蛛池模板: 鹤壁市| 道真| 平泉县| 永吉县| 名山县| 富阳市| 大邑县| 道孚县| 府谷县| 靖西县| 三门峡市| 九江县| 敦化市| 秦皇岛市| 宜兰县| 绥江县| 米易县| 蓬莱市| 札达县| 上饶县| 栾城县| 沅江市| 恭城| 桐乡市| 惠来县| 台东市| 迁安市| 长岛县| 寿宁县| 治县。| 汝城县| 灌阳县| 海南省| 米泉市| 富宁县| 梧州市| 普陀区| 灵璧县| 方山县| 长治县| 安顺市|