You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Hiller, Dean D (Dean)" <dh...@avaya.com> on 2004/09/11 21:54:48 UTC

junit taskdef not working? is this working for others...

First the simple question, then the one that possibly should be asked on
the developer list

 

Why would this not be working and still complaining it can't find a
class in the junit jar

            <path id="junit.lib">

                        <pathelement
path="${junit.location}/ant-junit.jar"/>

                        <pathelement path="${lib}/tools/junit.jar"/>

            </path>

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

               classpathref="junit.lib"/>

 

 

especially since I comment out the taskdef and do the following....

---------------------------------------------------------

        <!--generate string on what jars got included for debugging-->

        <pathconvert dirsep="/" pathsep=" " property="temp.string"
refid="junit.lib" setonempty="true"/>

      <echo message="junit=${temp.string}"/>

 

which tells me the exact location, so I go verify the locations and they
are there.  What is more interesting is I have not ANT_HOME set.  And I
don't have optional.jar not ant-junit.jar in ant/lib.  Ps. Why is there
an optional.jar there in ant1.6.2??  I thought optional was supposed to
be gone.  Optional.jar contained some of the same classes that
ant-junit.jar did.

Thanks for any suggestions here including pointing a stupid typo or
something.  I keep staring at this.  Just want to make sure it is
working for other people.

Thanks,

dean


Re: junit taskdef not working? is this working for others...

Posted by Peter Reilly <pe...@apache.org>.
Hiller, Dean D (Dean) wrote:

>which tells me the exact location, so I go verify the locations and they
>are there.  What is more interesting is I have not ANT_HOME set.  And I
>don't have optional.jar not ant-junit.jar in ant/lib.  Ps. Why is there
>an optional.jar there in ant1.6.2?? 
>  
>

optional.jar is not in ant1.6.2.

Peter


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: junit taskdef not working? is this working for others...

Posted by Stefan Bodewig <bo...@apache.org>.
On Sat, 11 Sep 2004, Dean D. Hiller <dh...@avaya.com> wrote:

> Why would this not be working and still complaining it can't find a
> class in the junit jar
> 
>             <path id="junit.lib">
> 
>                         <pathelement
> path="${junit.location}/ant-junit.jar"/>
> 
>                         <pathelement path="${lib}/tools/junit.jar"/>
> 
>             </path>
> 
>       <taskdef name="junit"
> classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"
> 
>                classpathref="junit.lib"/>

>From the rest of your post you seem to have read
<http://ant.apache.org/faq.html#delegating-classloader>

Run Ant with -debug and look at the "loading class foo from the X
classloader" messages, maybe it will give you a hint.

I think you still have an instance of the JUnit task class on your
system class loader somewhere.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org