ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject RE: Testing buildfile from inside TestCase?
Date Fri, 11 Jul 2003 12:38:44 GMT
Extend org.apache.tools.ant.BuildFileTest and see how to work with that on
org.apache.tools.ant.taskdefs.*Test.

Tests are in the source distribution /src/testcases


Jan


> -----Original Message-----
> From: Laird NELSON [mailto:lairdnelson@comcast.net]
> Sent: Friday, July 11, 2003 2:30 PM
> To: user@ant.apache.org
> Subject: Testing buildfile from inside TestCase?
> 
> 
> I'm writing an ant taskdef.  I'd like to unit test it in JUnit by 
> generating a simple buildfile with a <taskdef> element in it 
> referring 
> to my taskdef and executing Ant to make sure the buildfile (a) loads, 
> (b) finds my taskdef and (c) executes it properly.
> 
> If I launch org.apache.tools.ant.Main.start() from inside my 
> TestCase, 
> my buildfile loads (i.e. ant starts up fine), but when the project 
> parser hits the <taskdef> element, it cannot find my taskdef 
> classes.  
> Now, what's odd is that the test case from which I'm running 
> ant is in 
> the same package as the taskdef itself.  Both are therefore in the 
> classpath, or I couldn't have run JUnit in the first place.
> 
> What's the proper way to unit test a taskdef?
> 
> Thanks,
> Laird
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message