ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <ste...@apache.org>
Subject Re: Integration of antunit in junit
Date Thu, 15 Jan 2009 10:33:37 GMT
Gilles Scokart wrote:
> While testing ant tasks in my toy project (deco), I have used antunit.
> 
> It is very useful, but I found one limitation: I couldn't not run the
> ant-unit tests in the junit runner of my ide.
> 
> ant-testutils.jar provides some support for that, but requires to
> duplicate all antunit test target into java TestCase method.  This is
> a useless overhead now that we have most checks that can be done in
> antunit.
> 
> An adaptation layer allow to see antunit test results directly with
> the classical green/red bar of you junit runner.  It also allow to
> very easily plug a java debugger.
> 
> 
> I already some code prepared to support this.  The adaptation layer :
> 
> public class CompilePath extends TestCase {
> 	
> 	public static TestSuite suite() {
> 		File script = new
> File("src/test/java/net/sourceforge/deco/ant/test-compilepath.xml");
> 		return new AntUnitSuite(script);		
> 	}
> 	
> }
> 
> 
> When executed into a Junit Runner (for example in eclipse), we will
> see a suite name "test-compilepath" that will have one test for each
> testXXX target into my ant unit script.

+1.

I've done this before with other test systems, where you get the entire 
list of tests from an XML file. Though some tools (like IDEs) get really 
surprised when tests have spaces in their name

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


Mime
View raw message