ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From news...@hotu.com
Subject Re: write junit taskdef
Date Tue, 17 Jun 2003 21:24:58 GMT
newsham@hotu.com wrote:

> newsham@hotu.com wrote:
>
>> This has got to be trivial, but I haven't been able to figure it out, 
>> so I'd appreciate any help.  I want to write a <taskdef> which 
>> defines the junit task so that I can use it in my project.  I don't 
>> want to put junit.jar in the classpath or in junit's lib directory.
>>
>> Taskdef requires a classpath and class name.  I grepped ant.jar and 
>> optional.jar for junit, but can't find any junit-related classes.  
>> Digging around, I found 
>> /org/apache/tools/ant/taskdefs/defaults.properties which contains the 
>> following lines:
>>
>> junit=org.apache.tools.ant.taskdefs.optional.junit.JUnitTask
>> junitreport=org.apache.tools.ant.taskdefs.optional.junit.XMLResultAggregator
>>
>> Which seems to hint at the appropriate class name, but I still can't 
>> find the class in the jars.  I checked in the junit jar as well.  
>> Please tell me what I'm missing.
>>
>> <taskdef name="junit" classpath="/home/bozo/junit.jar"
>> classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"/>
>>
>> Thanks in advance,
>> Jim
>>
>>
> Well for kicks, I put the junit jar into the lib directory, and 
> removed the taskdef from my build file.  My junit task is not being 
> resolved ("Ant cold not find the task...").  I'm using Ant 1.5 and 
> Junit 3.7.  Ideas?

I guess that was the hint I needed.  I discovered I had an older 
optional.jar in ant/lib.  Now it works with junit in ant/lib.  My 
taskdef still doesn't work, but I found the reason why in the FAQ 
(http://ant.apache.org/faq.html#delegating-classloader).  Sorry for the 
noise. :)

Jim



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


Mime
View raw message