Package org.apache.ant.antunit.listener
Class LogForwarder
java.lang.Object
org.apache.ant.antunit.listener.LogForwarder
- All Implemented Interfaces:
AntUnitListener
A test listener for <antunit> who's whole purpose is to
forward log output from the project under test to the project
executing the <antunit> task.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Invoked if any error other than a failed assertion occured during execution.void
addFailure
(String target, AssertionFailedException ae) Invoked if an assert tasked caused an error during execution.void
Invoked after a test target has been executed.void
endTestSuite
(org.apache.tools.ant.Project testProject, String buildFile) Invoked once per build file, after all targets have been executed.void
setCurrentTestProject
(org.apache.tools.ant.Project p) Set a reference to the Project instance currently executing the test target.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.void
Invoked before a test target gets executed.void
startTestSuite
(org.apache.tools.ant.Project testProject, String buildFile) Invoked once per build file, before any targets get executed.
-
Field Details
-
parentTask
private org.apache.tools.ant.Task parentTask
-
-
Constructor Details
-
LogForwarder
public LogForwarder()
-
-
Method Details
-
setParentTask
public void setParentTask(org.apache.tools.ant.Task t) Description copied from interface:AntUnitListener
Set a reference to the AntUnit task executing the tests, this provides access to the containing project, target or Ant's logging system.- Specified by:
setParentTask
in interfaceAntUnitListener
- Parameters:
t
- the parent task
-
setCurrentTestProject
public void setCurrentTestProject(org.apache.tools.ant.Project p) Description copied from interface:AntUnitListener
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.
- Specified by:
setCurrentTestProject
in interfaceAntUnitListener
- Parameters:
p
- the test project
-
startTestSuite
Description copied from interface:AntUnitListener
Invoked once per build file, before any targets get executed.- Specified by:
startTestSuite
in interfaceAntUnitListener
- Parameters:
testProject
- the projectbuildFile
- the build file
-
endTestSuite
Description copied from interface:AntUnitListener
Invoked once per build file, after all targets have been executed.- Specified by:
endTestSuite
in interfaceAntUnitListener
- Parameters:
testProject
- the projectbuildFile
- the build file
-
startTest
Description copied from interface:AntUnitListener
Invoked before a test target gets executed.- Specified by:
startTest
in interfaceAntUnitListener
- Parameters:
target
- name of the target
-
endTest
Description copied from interface:AntUnitListener
Invoked after a test target has been executed.- Specified by:
endTest
in interfaceAntUnitListener
- Parameters:
target
- name of the target
-
addFailure
Description copied from interface:AntUnitListener
Invoked if an assert tasked caused an error during execution.- Specified by:
addFailure
in interfaceAntUnitListener
- Parameters:
target
- name of the targetae
- the failure
-
addError
Description copied from interface:AntUnitListener
Invoked if any error other than a failed assertion occured during execution.- Specified by:
addError
in interfaceAntUnitListener
- Parameters:
target
- name of the targetae
- the error
-