Task to provide functional testing under Ant, with a fairly complex workflow of:

Conditional execution

Application to start

A probe to "waitfor" before running tests

A tests sequence

A reporting sequence that runs after the tests have finished

A "teardown" clause that runs after the rest.

Automated termination of the program it executes, if a timeout is not met

Checking of a failure property and automatic raising of a fault
(with the text in failureText)
if test shutdown and reporting succeeded

The task is designed to be framework neutral; it will work with JUnit,
TestNG and other test frameworks That can be
executed from Ant. It bears a resemblance to the FunctionalTest task from
SmartFrog, as the attribute names were
chosen to make migration easier. However, this task benefits from the
ability to tweak Ant's internals, and so
simplify the workflow, and from the experience of using the SmartFrog task.
No code has been shared.

getTaskException

execute

This is a fairly complex workflow -what is going on is that we try to clean up
no matter how the run ended, and to retain the innermost exception that got thrown
during cleanup. That is, if teardown fails after the tests themselves failed, it is the
test failing that is more important.

processExceptions

protected void processExceptions()

Now faults are analysed.

The priority is

testexceptions, except those indicating a build timeout when the application itself
failed. (Because often it is the application fault that is more interesting than the probe
failure, which is usually triggered by the application not starting.)