Package org.apache.ant.antunit.listener
Class LogForwarder
- java.lang.Object
-
- org.apache.ant.antunit.listener.LogForwarder
-
- All Implemented Interfaces:
AntUnitListener
public class LogForwarder extends java.lang.Object implements 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.
-
-
Constructor Summary
Constructors Constructor Description LogForwarder()
-
Method Summary
All Methods Instance Methods Concrete 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
public void setParentTask(org.apache.tools.ant.Task t)
Description copied from interface:AntUnitListenerSet a reference to the AntUnit task executing the tests, this provides access to the containing project, target or Ant's logging system.- Specified by:
setParentTaskin interfaceAntUnitListener- Parameters:
t- the parent task
-
setCurrentTestProject
public void setCurrentTestProject(org.apache.tools.ant.Project p)
Description copied from interface:AntUnitListenerSet 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:
setCurrentTestProjectin interfaceAntUnitListener- Parameters:
p- the test project
-
startTestSuite
public void startTestSuite(org.apache.tools.ant.Project testProject, java.lang.String buildFile)Description copied from interface:AntUnitListenerInvoked once per build file, before any targets get executed.- Specified by:
startTestSuitein interfaceAntUnitListener- Parameters:
testProject- the projectbuildFile- the build file
-
endTestSuite
public void endTestSuite(org.apache.tools.ant.Project testProject, java.lang.String buildFile)Description copied from interface:AntUnitListenerInvoked once per build file, after all targets have been executed.- Specified by:
endTestSuitein interfaceAntUnitListener- Parameters:
testProject- the projectbuildFile- the build file
-
startTest
public void startTest(java.lang.String target)
Description copied from interface:AntUnitListenerInvoked before a test target gets executed.- Specified by:
startTestin interfaceAntUnitListener- Parameters:
target- name of the target
-
endTest
public void endTest(java.lang.String target)
Description copied from interface:AntUnitListenerInvoked after a test target has been executed.- Specified by:
endTestin interfaceAntUnitListener- Parameters:
target- name of the target
-
addFailure
public void addFailure(java.lang.String target, AssertionFailedException ae)Description copied from interface:AntUnitListenerInvoked if an assert tasked caused an error during execution.- Specified by:
addFailurein interfaceAntUnitListener- Parameters:
target- name of the targetae- the failure
-
addError
public void addError(java.lang.String target, java.lang.Throwable ae)Description copied from interface:AntUnitListenerInvoked if any error other than a failed assertion occured during execution.- Specified by:
addErrorin interfaceAntUnitListener- Parameters:
target- name of the targetae- the error
-
-