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

          導(dǎo)航

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

          統(tǒng)計(jì)

          常用鏈接

          留言簿(6)

          隨筆分類

          隨筆檔案(17)

          文章分類(86)

          收藏夾(3)

          flex blog

          good site

          java blog

          my friend

          tools

          抓蝦

          搜索

          最新評(píng)論

          閱讀排行榜

          評(píng)論排行榜

          主站蜘蛛池模板: 金沙县| 榆树市| 措勤县| 林甸县| 榆林市| 满城县| 崇文区| 南溪县| 太谷县| 许昌县| 孝义市| 清新县| 尚志市| 老河口市| 曲靖市| 观塘区| 探索| 阳泉市| 东辽县| 诸暨市| 全南县| 丹东市| 杨浦区| 新昌县| 石柱| 静海县| 合山市| 大安市| 安顺市| 蓬莱市| 密云县| 隆昌县| 绍兴市| 延安市| 南陵县| 广安市| 汽车| 库伦旗| 太仓市| 全南县| 沅江市|