ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Conor MacNeill <co...@cortexebusiness.com.au>
Subject Re: Using classloader for Junit
Date Thu, 19 Jun 2003 15:07:59 GMT
On Fri, 20 Jun 2003 12:17 am, Nick Chalko wrote:
> After I slept on it,  I thought of how I could extend the antclassloader
> to handle the situations I need.
> I am considering a <antlibclassloader />
> That will explicitly allow the optional ant task to be loaded in the
> child classloader.
> I may even go so far as  automatically adding this fileset
> ${ant.home}/lib/ant-*.jar   to the classloader.
>
> That should handle the usecase I have in mind.
>

I'll be interested to see if this works :-) I have my doubts. As soon as you 
go into the main loader to find the task classes 
(org.apache.tools.ant.taskdefs.optional.junit.JUnitTask), you won't be able 
to see the Junit classes from the child loader. If you play class loader 
games to avoid this then you are headed for LinkageErrors. Forking is almost 
always more preferable.

BTW, I don;t really agree with the <classloader> task being used to modify the 
effective classpath of running ClassLoaders. I'm sure this will cause trouble 
too.

Conor


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


Mime
View raw message