Klasse BaseAntUnitListener
java.lang.Object
org.apache.ant.antunit.listener.BaseAntUnitListener
- Alle implementierten Schnittstellen:
AntUnitListener
- Bekannte direkte Unterklassen:
FailureAntUnitListener, PlainAntUnitListener, XMLAntUnitListener
A test listener for <antunit> modeled aftern the Plain JUnit
test listener that is part of Ant.
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifikator und TypKlasseBeschreibungstatic classclassstatic class -
Feldübersicht
FelderModifikator und TypFeldBeschreibungprotected intkeeps track of the numer of executed targets, the failures an errors.protected intkeeps track of the numer of executed targets, the failures an errors.protected static final NumberFormatFormatter for timings.protected intkeeps track of the numer of executed targets, the failures an errors.protected longtime for the starts of the current test-suite and test-target.protected longtime for the starts of the current test-suite and test-target. -
Konstruktorübersicht
KonstruktorenModifikatorKonstruktorBeschreibungprotectedBaseAntUnitListener(BaseAntUnitListener.SendLogTo defaultReportTarget, String extension) Create a newBaseAntUnitListenerinstance. -
Methodenübersicht
Modifikator und TypMethodeBeschreibungvoidInvoked 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.protected final voidclose(OutputStream out) protected org.apache.tools.ant.Projectprotected final org.apache.tools.ant.Locationprotected final OutputStreamprotected final FilegetToDir()Directory to write reports to.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.protected final StringTurns the build file name into something that vaguely looks like a Java classname.voidsetCurrentTestProject(org.apache.tools.ant.Project p) Set a reference to the Project instance currently executing the test target.voidSets the minimum level a log message must be logged at to be included in the output.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.protected voidWhere to send the test report.voidSets the directory to write test reports to.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.Von Klasse geerbte Methoden Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitVon Schnittstelle geerbte Methoden AntUnitListener
endTest, endTestSuite
-
Felddetails
-
nf
Formatter for timings. -
runCount
protected int runCountkeeps track of the numer of executed targets, the failures an errors. -
failureCount
protected int failureCountkeeps track of the numer of executed targets, the failures an errors. -
errorCount
protected int errorCountkeeps track of the numer of executed targets, the failures an errors. -
start
protected long starttime for the starts of the current test-suite and test-target. -
testStart
protected long testStarttime for the starts of the current test-suite and test-target.
-
-
Konstruktordetails
-
BaseAntUnitListener
Create a newBaseAntUnitListenerinstance.- Parameter:
defaultReportTarget-extension-
-
-
Methodendetails
-
getToDir
Directory to write reports to.- Gibt zurück:
- directory to write reports to
-
setToDir
Sets the directory to write test reports to.- Parameter:
f- directory to write reports to
-
setSendLogTo
Where to send the test report.- Parameter:
logTo- where to send the test report
-
setParentTask
public void setParentTask(org.apache.tools.ant.Task t) Beschreibung aus Schnittstelle kopiert:AntUnitListenerSet a reference to the AntUnit task executing the tests, this provides access to the containing project, target or Ant's logging system.- Angegeben von:
setParentTaskin SchnittstelleAntUnitListener- Parameter:
t- the parent task
-
startTestSuite
Beschreibung aus Schnittstelle kopiert:AntUnitListenerInvoked once per build file, before any targets get executed.- Angegeben von:
startTestSuitein SchnittstelleAntUnitListener- Parameter:
testProject- the projectbuildFile- the build file
-
close
-
startTest
Beschreibung aus Schnittstelle kopiert:AntUnitListenerInvoked before a test target gets executed.- Angegeben von:
startTestin SchnittstelleAntUnitListener- Parameter:
target- name of the target
-
addFailure
Beschreibung aus Schnittstelle kopiert:AntUnitListenerInvoked if an assert tasked caused an error during execution.- Angegeben von:
addFailurein SchnittstelleAntUnitListener- Parameter:
target- name of the targetae- the failure
-
addError
Beschreibung aus Schnittstelle kopiert:AntUnitListenerInvoked if any error other than a failed assertion occured during execution.- Angegeben von:
addErrorin SchnittstelleAntUnitListener- Parameter:
target- name of the targetae- the error
-
getOut
-
normalize
-
getLocation
-
setCurrentTestProject
public void setCurrentTestProject(org.apache.tools.ant.Project p) Beschreibung aus Schnittstelle kopiert: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.
- Angegeben von:
setCurrentTestProjectin SchnittstelleAntUnitListener- Parameter:
p- the test project
-
getCurrentTestProject
protected org.apache.tools.ant.Project getCurrentTestProject() -
setLogLevel
Sets the minimum level a log message must be logged at to be included in the output.- Parameter:
l- minimum level
-
messageLogged
protected void messageLogged(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.This implementation is empty.
- Parameter:
event- the logged message
-