Created
February 5, 2014 16:40
-
-
Save MadmanMonty/8827796 to your computer and use it in GitHub Desktop.
Ant TestNg for jenkins
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
<project basedir="." default="build" name="Ant Play"> | |
<property name="classes.dir" value="bin" /> | |
<property name="report.dir" value="test-output" /> | |
<path id="classpath"> | |
<fileset dir="lib"> | |
<include name="**/*.jar"/> | |
</fileset> | |
<pathelement path="${basedir}\${classes.dir}"/> | |
</path> | |
<target name="init"> | |
<mkdir dir="${classes.dir}"/> | |
<copy includeemptydirs="false" todir="${classes.dir}"> | |
<fileset dir="src"> | |
<exclude name="**/*.java"/> | |
</fileset> | |
</copy> | |
</target> | |
<target name="clean"> | |
<delete dir="${classes.dir}"/> | |
</target> | |
<target depends="clean" name="cleanall"/> | |
<target depends="build-project" name="build"/> | |
<target depends="init" name="build-project"> | |
<echo message="${ant.project.name}: ${ant.file}"/> | |
<javac debug="true" includeantruntime="false" destdir="${classes.dir}"> | |
<src path="src"/> | |
<classpath refid="classpath"/> | |
</javac> | |
</target> | |
<target depends="build" name="runTests" description="Running tests" > | |
<echo>Running Tests...</echo> | |
<taskdef resource="testngtasks" classpathref="classpath"/> | |
<testng outputDir="${report.dir}" | |
haltonfailure="true" | |
useDefaultListeners="false" | |
listeners="org.uncommons.reportng.HTMLReporter" | |
classpathref="classpath"> | |
<xmlfileset dir="${basedir}" includes="testng.xml"/> | |
<!--<classfileset dir="${classes.dir}" includes="**/*.class" />--> | |
</testng> | |
</target> | |
</project> |
Can you please let me know stepwise Approach.
Thanks,
Ajit Jadhav.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://stackoverflow.com/questions/16782414/how-to-run-testng-tests-on-jenkins