ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ted_hankey <>
Subject Error when attempting to run TestNG tests in ANT
Date Tue, 02 Jun 2009 10:37:40 GMT


I cannot get TestNG tests to run in ANT. It complains of a "Cannot load
class from file: <test_file_name>" error.

This is the snippet from my ANT build file.

         <target name="tests" description="Task to execute TestNG Unit
		<echo>Start: TestNG Unit Testing</echo>
		<taskdef name="testng" classname="org.testng.TestNGAntTask"
			<testng outputDir="." haltonfailure="false" verbose="3">
					<fileset dir="${build.bin}" includes="**/*.class" />
					<fileset dir="${lib}" includes="*.jar" excludes="*.db"/>
				<classfileset dir="${build.bin}" includes="**/*Test.class"/>
		<echo>End: TestNG Testing</echo>

What confuses me here is that it finds the Test files as denoted by the
"**/*Test.class" expression but doesn't see to be able to find the
corresponding class files when attempting to run these.

Where am I going wrong here as I've tried all classpath variations at this

View this message in context:
Sent from the Ant - Users mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message