ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "T Master" <>
Subject Re: [antlist] How to install/configure JUnit task
Date Tue, 17 Jul 2001 18:22:35 GMT
Yup, I know how to use Ant's <java> task to run JUnit.

However I'm having huge problems defining my own task to use junit.

This is my code (junit.classpath is defined correctly):
    <taskdef name="junit" classname="junit.framework.TestCase">
            <pathelement location="${junit.classpath}"/>

This is the error:
     unittests/example/build.xml [36] taskdef class junit.framework.TestCase
cannot be found

Has anyone out there defined their own task using <taskdef> ??

T Master

----- Original Message -----
> Anyway, to use JUnit, I think you need to have
> Junit.jar and the optional.jar in you classpath.  You
> should not need to define a task for Junit.
> I have also gotten JUnit tests to work by putting a
> main(String args[]) method in the JUnit class (the
> JUnit docs describe what to do), then running that
> class with the Ant <java> task.  This works fine.
> Mr Lauren Commons

View raw message