ant junit task

S

stixwix

Hi,
I cannot get batchtest to work.

If i have a simple task that runs one test, it's ok:
<project name="MyProject" default="test" basedir=".">
<target name="test" >
<junit fork="yes" printsummary="withOutAndErr">
<formatter usefile="false" type="brief"/>
<test name="testing.MyTest"/>
</junit>
</target>
</project>

However, the following can't find the classes in the testing
directory...

<project name="MyProject" default="test" basedir=".">
<property name="src" location="testing"/>
<target name="test" >
<junit printsummary="withOutAndErr" showoutput="yes">
<formatter type="brief" usefile="false"/>
<batchtest fork="yes">
<fileset dir="${src}">
<include name="**/*Test.class"/>
</fileset>
</batchtest>
</junit>
</target>
</project>

For each test class in the testing directory, I get:
[junit] Null Test: Caused an ERROR
[junit] MyTest
[junit] java.lang.ClassNotFoundException: MyTest
[junit] at java.lang.Class.forName(Class.java:131)

I have tried including the classpath to no avail:
<classpath>
<pathelement location="${src}"/>
</classpath>

Any ideas?
Thanks,
Andy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,705
Latest member
Stefkari24

Latest Threads

Top