接口测试(java+testng+ant+jenkins)第三篇ant
生活随笔
收集整理的這篇文章主要介紹了
接口测试(java+testng+ant+jenkins)第三篇ant
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
1、ant是什么?
是一個(gè)將軟件編譯、測(cè)試、部署等步驟聯(lián)系在一起加以自動(dòng)化的一個(gè)工具
2、下載安裝
http://www.cnblogs.com/yuzhongwusan/archive/2013/03/26/2982411.html
3、在eclipce中的使用
準(zhǔn)備工作:
項(xiàng)目右鍵——new——folder——folder name: lib
將testng-6.8.5.jar 、jcommander.jar 放入lib
項(xiàng)目右鍵——new——file——build.xml ?(文件名不能寫錯(cuò))
放入代碼
<?xml version="1.0" encoding="UTF-8" ?> <project name="HelloWorld" default="regression" basedir="."> <property name="src" value="src"/> <property name="dest" value="classes"/> <property name="testng.dir" value="${basedir}\lib"/> <property name="testng.output.dir" value="${basedir}\test-output"/><path id="class1"><fileset dir="${basedir}\lib" includes="*jar"/><pathelement location="${dest}"/><pathelement location="${src}"/></path><taskdef resource="testngtasks" classpath="${testng.dir}/testng-6.8.5.jar"/><target name="init"><delete dir="${dest}"/><mkdir dir="${dest}"/> </target> <target name="compile" depends="init"><javac srcdir="${src}" destdir="${dest}" classpathref="class1" encoding="UTF8" includeantruntime="off" debug="on" debuglevel="lines,vars,source"/> </target><target name="regression" depends="compile"><echo>running testng</echo><testng outputdir="${testng.output.dir}" classpathref="class1" delegateCommandSystemProperties="true"><xmlfileset dir="${basedir}" includes="testng.xml"/></testng> </target> </project>4、運(yùn)行build.xml
可以右鍵Run As——Ant build
也可以用cmd進(jìn)入build.xml所在目錄,使用ant命令
?
轉(zhuǎn)載于:https://www.cnblogs.com/smlxs/p/7501065.html
創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎(jiǎng)勵(lì)來咯,堅(jiān)持創(chuàng)作打卡瓜分現(xiàn)金大獎(jiǎng)總結(jié)
以上是生活随笔為你收集整理的接口测试(java+testng+ant+jenkins)第三篇ant的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 梦到打枪战是什么意思
- 下一篇: JMS 消息处理