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

          導航

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

          統計

          常用鏈接

          留言簿(6)

          隨筆分類

          隨筆檔案(17)

          文章分類(86)

          收藏夾(3)

          flex blog

          good site

          java blog

          my friend

          tools

          抓蝦

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 施甸县| 山丹县| 武宁县| 嘉善县| 阳山县| 景谷| 会宁县| 遂川县| 临西县| 龙井市| 鄂托克前旗| 平潭县| 浮山县| 乐至县| 龙泉市| 甘泉县| 辽源市| 醴陵市| 张北县| 祁门县| 宝鸡市| 泊头市| 建阳市| 贺州市| 三台县| 富川| 根河市| 丽水市| 湛江市| 绥阳县| 景东| 麻阳| 兰坪| 藁城市| 喀什市| 陵水| 都匀市| 大安市| 岐山县| 渑池县| 临沭县|