public class XMLFormatter extends java.lang.Object implements XMLConstants, junit.framework.TestListener
ATTR_ERRORS, ATTR_FAILURES, ATTR_MESSAGE, ATTR_NAME, ATTR_TESTS, ATTR_TIME, ATTR_TYPE, ERROR, FAILURE, TESTCASE, TESTSUITE, TESTSUITES
Constructor and Description |
---|
XMLFormatter() |
Modifier and Type | Method and Description |
---|---|
void |
addError(junit.framework.Test theTest,
java.lang.Throwable theThrowable)
Event called by the base test runner when the test fails with an error.
|
void |
addFailure(junit.framework.Test theTest,
junit.framework.AssertionFailedError theError)
Event called by the base test runner when the test fails with a failure.
|
void |
endTest(junit.framework.Test theTest)
Event called by the base test runner when the test ends.
|
java.lang.String |
getEncoding() |
java.lang.String |
getSuiteClassName() |
java.lang.String |
getTotalDurationAsString() |
void |
setEncoding(java.lang.String theEncoding) |
void |
setSuiteClassName(java.lang.String theSuiteClassName)
Sets the suite class name that was executed.
|
void |
setTotalDuration(long theDuration)
Sets the duration it took to execute all the tests.
|
void |
setXslFileName(java.lang.String theXslFileName)
Sets the XSL stylesheet file name to put in the returned XML string
so that the browser will try to apply it (IE at least, I don't know
about the others).
|
void |
startTest(junit.framework.Test theTest)
Event called by the base test runner when the test starts.
|
java.lang.String |
toXML(junit.framework.TestResult theResult)
Formats the test result as an XML string.
|
public void setXslFileName(java.lang.String theXslFileName)
theXslFileName
- the file name (relative to the webapp root)public void setEncoding(java.lang.String theEncoding)
theEncoding
- the encoding to use for the returned XML.public java.lang.String getEncoding()
public java.lang.String getSuiteClassName()
public void setSuiteClassName(java.lang.String theSuiteClassName)
theSuiteClassName
- the suite class namepublic java.lang.String getTotalDurationAsString()
public void setTotalDuration(long theDuration)
theDuration
- the time it tookpublic java.lang.String toXML(junit.framework.TestResult theResult)
theResult
- the test result objectpublic void startTest(junit.framework.Test theTest)
startTest
in interface junit.framework.TestListener
theTest
- the test object being executedpublic void addError(junit.framework.Test theTest, java.lang.Throwable theThrowable)
addError
in interface junit.framework.TestListener
theTest
- the test object that failedtheThrowable
- the exception that was thrownpublic void addFailure(junit.framework.Test theTest, junit.framework.AssertionFailedError theError)
addFailure
in interface junit.framework.TestListener
theTest
- the test object that failedtheError
- the exception that was thrownpublic void endTest(junit.framework.Test theTest)
endTest
in interface junit.framework.TestListener
theTest
- the test object being executedCopyright © 2000-2004 Apache Software Foundation. All Rights Reserved.