You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Sebastien Chassande-Barrioz <se...@inrialpes.fr> on 2001/10/11 16:51:52 UTC

Junit task

Hi,

I have the following error when I use the optional junit task:

Could not create task of type: junit due to 
java.lang.NoClassDefFoundError: junit/framework/TestListener

In my build.xml I define the task as this:

<taskdef name="junit" 
classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"/>

I tried to specify a classpath with the junit jar as this:

<taskdef name="junit"
   classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask">
   <classpath>
      <pathelement path="${externals.dir}/junit3_5.jar"/>
   </classpath>
</taskdef>

but I have already the same problem.
Do you have an idea of my problem ?

Thanks
Seb
-- 
Chassande-Barrioz Sebastien
INRIALPES - SIRAC/SARDES Team - ObjectWeb initiative
Mail job : sebastien.chassande@inrialpes.fr
Phone : 04.76.61.55.16


Re: Junit task

Posted by Peter Donald <do...@apache.org>.
On Fri, 12 Oct 2001 00:51, Sebastien Chassande-Barrioz wrote:
> Hi,
>
> I have the following error when I use the optional junit task:
>
> Could not create task of type: junit due to
> java.lang.NoClassDefFoundError: junit/framework/TestListener
...
> but I have already the same problem.
> Do you have an idea of my problem ?

Put the jubnit.jar in same place as optional.jar (ie $ANT_HOME/lib) and it 
should work fine.

-- 
Cheers,

Pete

----------------------------------------------
Money is how people with no talent keep score.
----------------------------------------------

Re: Junit task

Posted by Diane Holt <ho...@yahoo.com>.
--- Sebastien Chassande-Barrioz <se...@inrialpes.fr> wrote:
> I have the following error when I use the optional junit task:
> 
> Could not create task of type: junit due to 
> java.lang.NoClassDefFoundError: junit/framework/TestListener
> 
> In my build.xml I define the task as this:
> 
> <taskdef name="junit" 
> classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"/>
> 
> I tried to specify a classpath with the junit jar as this:
> 
> <taskdef name="junit"
>    classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask">
>    <classpath>
>       <pathelement path="${externals.dir}/junit3_5.jar"/>
>    </classpath>
> </taskdef>
> 
> but I have already the same problem. Do you have an idea of my problem?

You don't want to include the Junit jar-file in a <classpath> for your
<taskdef> -- that's used for finding the classname you're pointing to for
the task you're defining. Since you don't have the Junit jar-file in
$ANT_HOME/lib, you'll need to include it in your CLASSPATH.

Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com