Interface Test (java+testng+ant+jenkins) third Ant

Source: Internet
Author: User
Tags testng

1. What is Ant?

is a tool that links software compilation, testing, deployment, and other steps together to automate

2. Download and install

Http://www.cnblogs.com/yuzhongwusan/archive/2013/03/26/2982411.html

3, the use in the ECLIPCE

Preparatory work:

Project Right-click--new--folder--folder name:lib

Put Testng-6.8.5.jar, Jcommander.jar into Lib

Project Right--new--file--build.xml (file name cannot be written incorrectly)

Put code

<?XML version= "1.0" encoding= "UTF-8"?><Projectname= "HelloWorld"default= "Regression"Basedir=".">< Propertyname= "src"value= "src"/>< Propertyname= "Dest"value= "Classes"/>< Propertyname= "Testng.dir"value= "${basedir}\lib"/>< Propertyname= "Testng.output.dir"value= "${basedir}\test-output"/> <PathID= "Class1">        <Filesetdir= "${basedir}\lib"includes= "*jar"/>        <pathelement Location= "${dest}"/>        <pathelement Location= "${src}"/> </Path><TaskdefResource= "Testngtasks"Classpath= "${testng.dir}/testng-6.8.5.jar"/><Targetname= "Init">    <Deletedir= "${dest}"/>    <mkdirdir= "${dest}"/></Target><Targetname= "Compile"depends= "Init">   <JavacSrcdir= "${src}"Destdir= "${dest}"Classpathref= "Class1"encoding= "UTF8"Includeantruntime= "Off"Debug= "On"DebugLevel= "Lines,vars,source"/></Target><Targetname= "Regression"depends= "Compile">        <Echo>Running testng</Echo>        <testngOutputDir= "${testng.output.dir}"Classpathref= "Class1"delegatecommandsystemproperties= "true">            <Xmlfilesetdir= "${basedir}"includes= "Testng.xml"/>        </testng></Target></Project>

4. Running Build.xml

You can right-click Run As--ant Build

You can also use CMD to enter the directory where the Build.xml is located, using the Ant command

Interface Test (java+testng+ant+jenkins) third article ant

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.