Help require for ANT

1 view
Skip to first unread message

gaurang033

unread,
Jun 3, 2009, 6:29:53 AM6/3/09
to testng-users
Hi guys.

I just started working with the ant. I require to use the ANT to run
my TestNG testcases.
I went throght the following site. But they haven't given any good
example and so now I am pretty much confuse how to use this...

http://ant.apache.org/manual/index.html
http://testng.org/doc/ant.html

I have write down my build.xml as follows.
<project name="Google_Test" default="run" basedir=".">

<target name="run" description="Running test" >
<echo> Ruuning Testcases </echo>
<echo>$ws.home</echo>

</target>
<taskdef resource="testngtasks"
classpath="testng.jar"/>
<testng classpathref="test-path"
outputdir="${test-results.dir}"
haltonfailure="true"
useDefaultListeners="false"
listeners="org.uncommons.reportng.HTMLReporter">
<xmlfileset dir="." includes="testng.xml"/>
<sysproperty key="org.uncommons.reportng.title" value="My Test
Report"/>
</testng>

</project>

But i am not sure what to write down in the classpath and
classpathref ???

Can any one help.. or is there any site/blog where they explain what
to write down in all this. ??

Quintanilla

unread,
Jun 3, 2009, 11:43:54 AM6/3/09
to testng-users
This worked for me:

<taskdef resource="testngtasks" classpathref="tng.task.classpath"/>

<target name="run-tests" depends="dist">
<testng classpathref="tng.test.classpath">
<xmlfileset dir="${config}" includes="testng.xml" />
</testng>
</target>

tng.task.classpaht is a path reference to the testng library

tng.test.classpath is a path reference to test classes, test libraries
(including testng)

And yes, maybe a better example in the documentation would be great in
http://testng.org/doc/ant.html

Good Luck!

-----------
Quintanilla



On Jun 3, 5:29 am, gaurang033 <gaurangns...@gmail.com> wrote:
> Hi guys.
>
> I just started working with the ant. I require to use the ANT to run
> my TestNG testcases.
> I went throght the following site. But they haven't given any good
> example and so now I am pretty much confuse how to use this...
>
> http://ant.apache.org/manual/index.htmlhttp://testng.org/doc/ant.html
Reply all
Reply to author
Forward
0 new messages