Package org.apache.ant.antunit
Interface AntUnitListener
-
- All Known Implementing Classes:
BaseAntUnitListener,FailureAntUnitListener,LogForwarder,PlainAntUnitListener,XMLAntUnitListener
public interface AntUnitListenerA test listener for <antunit>.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddError(java.lang.String target, java.lang.Throwable ae)Invoked if any error other than a failed assertion occured during execution.voidaddFailure(java.lang.String target, AssertionFailedException ae)Invoked if an assert tasked caused an error during execution.voidendTest(java.lang.String target)Invoked after a test target has been executed.voidendTestSuite(org.apache.tools.ant.Project testProject, java.lang.String buildFile)Invoked once per build file, after all targets have been executed.voidsetCurrentTestProject(org.apache.tools.ant.Project p)Set a reference to the Project instance currently executing the test target.voidsetParentTask(org.apache.tools.ant.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.voidstartTest(java.lang.String target)Invoked before a test target gets executed.voidstartTestSuite(org.apache.tools.ant.Project testProject, java.lang.String buildFile)Invoked once per build file, before any targets get executed.
-
-
-
Method Detail
-
setParentTask
void setParentTask(org.apache.tools.ant.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.- Parameters:
t- the parent task
-
setCurrentTestProject
void setCurrentTestProject(org.apache.tools.ant.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.
- Parameters:
p- the test project
-
startTestSuite
void startTestSuite(org.apache.tools.ant.Project testProject, java.lang.String buildFile)Invoked once per build file, before any targets get executed.- Parameters:
testProject- the projectbuildFile- the build file
-
endTestSuite
void endTestSuite(org.apache.tools.ant.Project testProject, java.lang.String buildFile)Invoked once per build file, after all targets have been executed.- Parameters:
testProject- the projectbuildFile- the build file
-
startTest
void startTest(java.lang.String target)
Invoked before a test target gets executed.- Parameters:
target- name of the target
-
endTest
void endTest(java.lang.String target)
Invoked after a test target has been executed.- Parameters:
target- name of the target
-
addFailure
void addFailure(java.lang.String target, AssertionFailedException ae)Invoked if an assert tasked caused an error during execution.- Parameters:
target- name of the targetae- the failure
-
addError
void addError(java.lang.String target, java.lang.Throwable ae)Invoked if any error other than a failed assertion occured during execution.- Parameters:
target- name of the targetae- the error
-
-