You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Tom Ball <To...@Sun.COM> on 2004/10/07 22:04:17 UTC

TestListener for JUnit task

The NetBeans IDE now uses ant exclusively for its build engine,
including running a project's JUnit tests.  I want to add a test
execution progress monitor like the JUnit's GUI TestRunner has, which
needs two events:  the count of tests to be run, and an event indicating
that a test has ended.  The current JUnit task batches test results, and
so cannot be used for monitoring (as far as we can tell).

We have two ideas on how this might be accomplished that wouldn't
disturb existing use, and would appreciate any feedback on which one (or
something else) is best:

1.  (Preferred) Log sub-informational messages for these events, which a
BuildListener could filter.  The problem is that while the JUnitTask
logs events, its JUnitTestRunner does not (everything goes to stdout and
stderr).  JUnitTestRunner is completely decoupled from Ant, except for
using a few static and utility methods.

2.  Add a "JUnitTestListener" property to JUnitTask, modeled after its
JUnitResultFormatter property.  The JUnitTestListener would extend
JUnit's TestListener interface to add a testCount method.  The optional
JUnitTestListener would be passed to JUnitTestRunner, which already
implements TestListener.

Any suggestions?  We would of course forward any of these changes for
review and incorporation, as we don't want to ever run a non-standard
version of Ant.

Thanks,
Tom


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