|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.android.ddmlib.testrunner.XmlTestRunListener
public class XmlTestRunListener
Writes JUnit results to an XML files in a format consistent with Ant's XMLJUnitResultFormatter.
Creates a separate XML file per test run.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.android.ddmlib.testrunner.ITestRunListener |
---|
ITestRunListener.TestFailure |
Constructor Summary | |
---|---|
XmlTestRunListener()
|
Method Summary | |
---|---|
protected java.io.File |
getResultFile(java.io.File reportDir)
Creates a File where the report will be created. |
TestRunResult |
getRunResult()
Returns the TestRunResult |
protected java.lang.String |
getTestName(TestIdentifier testId)
|
protected java.lang.String |
getTestSuiteName()
|
void |
setHostName(java.lang.String hostName)
|
protected void |
setPropertiesAttributes(org.kxml2.io.KXmlSerializer serializer,
java.lang.String namespace)
Sets the attributes on properties. |
void |
setReportDir(java.io.File file)
Sets the report file to use. |
void |
testEnded(TestIdentifier test,
java.util.Map<java.lang.String,java.lang.String> testMetrics)
Reports the execution end of an individual test case. |
void |
testFailed(ITestRunListener.TestFailure status,
TestIdentifier test,
java.lang.String trace)
Reports the failure of a individual test case. |
void |
testRunEnded(long elapsedTime,
java.util.Map<java.lang.String,java.lang.String> runMetrics)
Reports end of test run. |
void |
testRunFailed(java.lang.String errorMessage)
Reports test run failed to complete due to a fatal error. |
void |
testRunStarted(java.lang.String runName,
int numTests)
Reports the start of a test run. |
void |
testRunStopped(long arg0)
Reports test run stopped before completion due to a user request. |
void |
testStarted(TestIdentifier test)
Reports the start of an individual test case. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XmlTestRunListener()
Method Detail |
---|
public void setReportDir(java.io.File file)
public void setHostName(java.lang.String hostName)
public TestRunResult getRunResult()
TestRunResult
public void testRunStarted(java.lang.String runName, int numTests)
ITestRunListener
testRunStarted
in interface ITestRunListener
runName
- the test run namenumTests
- total number of tests in test runpublic void testStarted(TestIdentifier test)
ITestRunListener
testStarted
in interface ITestRunListener
test
- identifies the testpublic void testFailed(ITestRunListener.TestFailure status, TestIdentifier test, java.lang.String trace)
ITestRunListener
testFailed
in interface ITestRunListener
status
- failure typetest
- identifies the testtrace
- stack trace of failurepublic void testEnded(TestIdentifier test, java.util.Map<java.lang.String,java.lang.String> testMetrics)
ITestRunListener
ITestRunListener.testFailed(com.android.ddmlib.testrunner.ITestRunListener.TestFailure, com.android.ddmlib.testrunner.TestIdentifier, java.lang.String)
was not invoked, this test passed. Also returns any key/value
metrics which may have been emitted during the test case's execution.
testEnded
in interface ITestRunListener
test
- identifies the testtestMetrics
- a Map
of the metrics emittedpublic void testRunFailed(java.lang.String errorMessage)
ITestRunListener
testRunFailed
in interface ITestRunListener
errorMessage
- String
describing reason for run failure.public void testRunStopped(long arg0)
ITestRunListener
testRunStopped
in interface ITestRunListener
arg0
- device reported elapsed time, in millisecondspublic void testRunEnded(long elapsedTime, java.util.Map<java.lang.String,java.lang.String> runMetrics)
ITestRunListener
testRunEnded
in interface ITestRunListener
elapsedTime
- device reported elapsed time, in millisecondsrunMetrics
- key-value pairs reported at the end of a test runprotected java.io.File getResultFile(java.io.File reportDir) throws java.io.IOException
File
where the report will be created.
reportDir
- the root directory of the report.
java.io.IOException
protected java.lang.String getTestSuiteName()
protected void setPropertiesAttributes(org.kxml2.io.KXmlSerializer serializer, java.lang.String namespace) throws java.io.IOException
serializer
- the serializernamespace
- the namespace
java.io.IOException
protected java.lang.String getTestName(TestIdentifier testId)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |