ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: [junit] testing ant failure
Date Sat, 12 Nov 2005 17:38:43 GMT
On Fri, 11 Nov 2005, Thomas L. Roche <> wrote:

> What's the "best way" to test for appropriate failure? The only
> thing that comes to my mind is to parse the logfile, e.g.
> * check for a "BUILD FAILED" line
> * check that a line after the "BUILD FAILED" line contains the
>   appropriate failure message.
> Is there an easier/better way?

Take a look at Ant's own unit tests.  There is a BuildFileTest base
class that many tests extend with helper methods like
expectSpecificBuildException() which assert an Ant build fails.

Another alternative, and Ant itself is probably heading to this, is
the newer AntUnit test framework/antlib, that can be found in Ant's
svn repository in the sandbox (which it probably is going to leave in
order to become a real Ant subproject rather soon).


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message