<target name="uploadbuild" description="Upload build to an FTP server"> <!-- Upload everything under the destination.dir to the FTP server. --> <ftp server="${ftp.hostname}" remotedir="/" userid="${ftp.username}" password="${ftp.userpassword}" separator="\" verbose="yes" binary="yes"> <fileset dir="${destination.dir}"> <include name="**/*.*" /> </fileset> </ftp> </target> |
最后,該過程將向測試人員發送電子郵件(如清單 13中所示),告知其開始測試。以下示例假定不會在 SMTP 服務器上進行身份驗證。
清單 13. 向測試團隊發送電子郵件
<target name="notifyteam" description="Notify testing team of the new build"> <!-- Read build information from the build.info file. --> <property file="${destination.dir}/build.info" /> <!-- Send a mail to the testing team. --> <mail mailhost="${smtp.hostname}" mailport="${smtp.hostport}" |
如果您的 SMTP 服務器要求進行身份驗證,將需要下載 JavaMail .jar 文件。
本部分將簡單描述運行構建過程時一些可用的選項。
上面所述的自動化過程并不施加任何控制任務流的條件。如果需要此類控制,可以使用允許某些任務中在出現錯誤時失敗的屬性。例如,wsInstallApp
任務具有用于此目的的 failonerror
屬性。
使用條件是控制流的另一種方式。有關 Ant 中的條件的更多信息,請參見 Conditions task。Ant 還提供了依賴關系來在目標之間建立聯系,以確保執行目標序列得以執行。
文章來源于領測軟件測試網 http://www.kjueaiud.com/