org.apache.ant.antunit
Interface AntUnitListener

All Known Implementing Classes:
BaseAntUnitListener, FailureAntUnitListener, PlainAntUnitListener, XMLAntUnitListener

public interface AntUnitListener

A test listener for <antunit>.


Method Summary
 void addError(java.lang.String target, java.lang.Throwable ae)
          Invoked if any error other than a failed assertion occured during execution.
 void addFailure(java.lang.String target, AssertionFailedException ae)
          Invoked if an assert tasked caused an error during execution.
 void endTest(java.lang.String target)
          Invoked after a test target has been executed.
 void endTestSuite(Project testProject, java.lang.String buildFile)
          Invoked once per build file, after all targets have been executed.
 void setCurrentTestProject(Project p)
          Set a reference to the Project instance currently executing the test target.
 void setParentTask(Task t)
          Set a reference to the AntUnit task executing the tests, this provides access to the containing project, target or Ant's logging system.
 void startTest(java.lang.String target)
          Invoked before a test target gets executed.
 void startTestSuite(Project testProject, java.lang.String buildFile)
          Invoked once per build file, before any targets get executed.
 

Method Detail

setParentTask

void setParentTask(Task t)
Set a reference to the AntUnit task executing the tests, this provides access to the containing project, target or Ant's logging system.


setCurrentTestProject

void setCurrentTestProject(Project p)
Set a reference to the Project instance currently executing the test target.

This provides access to the logging system or the properties of the project under test. Note that different test targets will be executed in different Ant Project instances.


startTestSuite

void startTestSuite(Project testProject,
                    java.lang.String buildFile)
Invoked once per build file, before any targets get executed.


endTestSuite

void endTestSuite(Project testProject,
                  java.lang.String buildFile)
Invoked once per build file, after all targets have been executed.


startTest

void startTest(java.lang.String target)
Invoked before a test target gets executed.


endTest

void endTest(java.lang.String target)
Invoked after a test target has been executed.


addFailure

void addFailure(java.lang.String target,
                AssertionFailedException ae)
Invoked if an assert tasked caused an error during execution.


addError

void addError(java.lang.String target,
              java.lang.Throwable ae)
Invoked if any error other than a failed assertion occured during execution.