ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Danilo Bürger <danilo.fabian.buer...@student.uni-augsburg.de>
Subject Re: AW: Junit Integration Problem
Date Mon, 14 Mar 2005 19:22:26 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The third Solution as mentioned way down, is what i actually wanted. I 
noticed though, that this is not possible to do without removing a file 
first. So i will have to stick with the solution of moving the 
junit.jar to the ANT_HOME/lib, which could probably be automated by an 
ant task.

Thanks for your help!


Am 14.03.2005 um 18:56 schrieb Peter Reilly:

> Jan.Materne@rzf.fin-nrw.de wrote:
>
>> The problem is (not tested :) that the "junit" task is defined during
>> parsing
>> stage of the ant.jar!/.../taskdefs/default.properties. The class 
>> should be
>> loaded
>> then by first use of <junit>.
>> The <taskdef> between wouldnt work ... IMO.
>>
>> For test: give it another taskname
>>  <taskdef name="my.junit" .../>
>>
>>
> No this is not the case.
> the junit task needs to moved out of $ANT_HOME/lib, otherwise
> it gets loaded by ant's project classloader which does not
> see junit.jar.
>
> The easiest solution is to place junit.jar in $ANT_HOME/lib,
> the second easiest is to use ant -lib $JUNIT_HOME/lib/junit.jar (or
> whereever junit.jar is)
> the third solution is to read:
> http://ant.apache.org/faq.html#delegating-classloader
> very carefully.
>
> Peter
>
>> Jan
>>
>>
>>> -----Ursprüngliche Nachricht-----
>>> Von: Danilo Bürger
>>> [mailto:danilo.fabian.buerger@student.uni-augsburg.de]
>>> Gesendet am: Montag, 14. März 2005 15:26
>>> An: Ant Users List
>>> Betreff: Re: Junit Integration Problem
>>>
>>> -----BEGIN PGP SIGNED MESSAGE-----
>>> Hash: SHA1
>>>
>>> Hey,
>>>
>>> i think you meant 
>>> classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"?
>>> i tried with that and it actually finds the task, but cant satisfy 
>>> the dependency with junit.jar:
>>>
>>> BUILD FAILED: build.xml:83: taskdef A class needed by class 
>>> org.apache.tools.ant.taskdefs.optional.junit.JUnitTask cannot be 
>>> found: junit/framework/Test
>>>
>>> I heard that you shouldnt use ant-junit.jar with the taskdef at all, 
>>> but instead use the junit.jar classloader, but what classname should 
>>> i specify for that?
>>>
>>> Thanks in advance
>>>
>>> Am 14.03.2005 um 07:26 schrieb Antoine Levy-Lambert:
>>>
>>>
>>>> Hello Danilo,
>>>> you need to taskdef junit in your build file, specifying  a
>>> classpath
>>>> which includes ant-junit.jar and junit.jar.
>>>> <taskdef name="junit" 
>>>> classname="org.apache.tools.ant.taskdefs.optional.JunitTask">
>>>>    <classpath>
>>>>        <pathelement location="path of junit.jar"/>
>>>>        <pathelement location="path of ant-junit.jar"/>
>>>>   </classpath>
>>>> </taskdef>
>>>>
>>>> Cheers,
>>>> Antoine
>>>>
>>>> Danilo Bürger wrote:
>>>>
>>>>
>>>>> I would like to integrate Junit into Ant as specified by 3. in
>>>>> http://ant.apache.org/manual/OptionalTasks/junit.html ("3.
>>> Do neither
>>>
>>>>> of the above, and instead, specify their locations using a
>>> <classpath>
>>>
>>>>> element in the build file.  See the FAQ for details.")
>>>>>
>>>>> Now i have the junit.jar (3.8.1) and also the xalan.jar in
>>> my projects
>>>
>>>>> lib/ directory. I have the following target:
>>>>>
>>>>>     <path id="class.path" description="The main build classpath">
>>>>>         <pathelement location="${build.dir}/classes"/>
>>>>>         <fileset dir="${lib.dir}" includes="**/*.jar"/>
>>>>>     </path>
>>>>>
>>>>>     <target name="junit" depends="..." description="...">
>>>>>         <junit printsummary="yes">
>>>>>             <classpath refid="class.path"/>
>>>>>         </junit>
>>>>>     </target>
>>>>>
>>>>> I am still getting the famous "Ant could not find the task
>>> or a class
>>>
>>>>> this task relies upon." error.
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>>
>>>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>>>> For additional commands, e-mail: user-help@ant.apache.org
>>>>
>>>>
>>> -----BEGIN PGP SIGNATURE-----
>>> Version: GnuPG v1.4.0 (Darwin)
>>>
>>> iD8DBQFCNZ8rFG7pbP1EbVMRAmuJAJ0WJ77GKPbXXdTFQdB/UD6VnJI/UQCgjpP1
>>> mTEtfYoBbzBie3Oya8gtA7w=
>>> =d7+r
>>> -----END PGP SIGNATURE-----
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>>> For additional commands, e-mail: user-help@ant.apache.org
>>>
>>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (Darwin)

iD8DBQFCNeR0FG7pbP1EbVMRAjk8AKCUmQjCq5PE566iPkyUwxV6rQxxbACgu5T+
pbspW1ObL2GVmMSgGMNAKIM=
=c/x5
-----END PGP SIGNATURE-----


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


Mime
View raw message