Package org.apache.ant.antunit.listener
Class PlainAntUnitListener
java.lang.Object
org.apache.ant.antunit.listener.BaseAntUnitListener
org.apache.ant.antunit.listener.PlainAntUnitListener
- All Implemented Interfaces:
AntUnitListener
A test listener for <antunit> modelled after the Plain JUnit
test listener that is part of Ant.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.ant.antunit.listener.BaseAntUnitListener
BaseAntUnitListener.AntUnitLogLevel, BaseAntUnitListener.LogGrabber, BaseAntUnitListener.SendLogTo -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StringWriterHelper to store intermediate output.private StringBufferCollects log messages.private static final Stringprivate OutputStreamprivate PrintWriterConvenience layer on top ofinner.Fields inherited from class org.apache.ant.antunit.listener.BaseAntUnitListener
errorCount, failureCount, nf, runCount, start, testStart -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidInvoked if any error other than a failed assertion occured during execution.voidaddFailure(String target, AssertionFailedException ae) Invoked if an assert tasked caused an error during execution.voidInvoked after a test target has been executed.voidendTestSuite(org.apache.tools.ant.Project testProject, String buildFile) Invoked once per build file, after all targets have been executed.private voidformatError(String type, Throwable t) protected voidmessageLogged(org.apache.tools.ant.BuildEvent event) Gets messages from the project running the test target if their level is at least of the level specified withsetLogLevel.voidWhere to send the test report.voidInvoked before a test target gets executed.voidstartTestSuite(org.apache.tools.ant.Project testProject, String buildFile) Invoked once per build file, before any targets get executed.Methods inherited from class org.apache.ant.antunit.listener.BaseAntUnitListener
close, getCurrentTestProject, getLocation, getOut, getToDir, normalize, setCurrentTestProject, setLogLevel, setParentTask, setToDir
-
Field Details
-
out
-
inner
Helper to store intermediate output. -
wri
Convenience layer on top ofinner. -
log
Collects log messages. -
NEW_LINE
-
-
Constructor Details
-
PlainAntUnitListener
public PlainAntUnitListener()
-
-
Method Details
-
setSendLogTo
Where to send the test report.- Overrides:
setSendLogToin classBaseAntUnitListener- Parameters:
logTo- where to send the test report
-
startTestSuite
Description copied from interface:AntUnitListenerInvoked once per build file, before any targets get executed.- Specified by:
startTestSuitein interfaceAntUnitListener- Overrides:
startTestSuitein classBaseAntUnitListener- Parameters:
testProject- the projectbuildFile- the build file
-
endTestSuite
Description copied from interface:AntUnitListenerInvoked once per build file, after all targets have been executed.- Parameters:
testProject- the projectbuildFile- the build file
-
startTest
Description copied from interface:AntUnitListenerInvoked before a test target gets executed.- Specified by:
startTestin interfaceAntUnitListener- Overrides:
startTestin classBaseAntUnitListener- Parameters:
target- name of the target
-
endTest
Description copied from interface:AntUnitListenerInvoked after a test target has been executed.- Parameters:
target- name of the target
-
addFailure
Description copied from interface:AntUnitListenerInvoked if an assert tasked caused an error during execution.- Specified by:
addFailurein interfaceAntUnitListener- Overrides:
addFailurein classBaseAntUnitListener- Parameters:
target- name of the targetae- the failure
-
addError
Description copied from interface:AntUnitListenerInvoked if any error other than a failed assertion occured during execution.- Specified by:
addErrorin interfaceAntUnitListener- Overrides:
addErrorin classBaseAntUnitListener- Parameters:
target- name of the targetae- the error
-
formatError
-
messageLogged
protected void messageLogged(org.apache.tools.ant.BuildEvent event) Description copied from class:BaseAntUnitListenerGets messages from the project running the test target if their level is at least of the level specified withsetLogLevel.This implementation is empty.
- Overrides:
messageLoggedin classBaseAntUnitListener- Parameters:
event- the logged message
-