public class

OrchestrationXmlTestRunListener

extends OrchestrationRunListener
java.lang.Object
   ↳ android.support.test.orchestrator.listeners.OrchestrationRunListener
     ↳ android.support.test.orchestrator.listeners.OrchestrationXmlTestRunListener

Class Overview

Writes JUnit results to an XML files in a format consistent with Ant's XMLJUnitResultFormatter.

Creates a separate XML file per test run.

This is a copy of com.android.ddmlib.testrunner.XmlTestRunListener made specificly for AndroidTestOrchestrator. Changes include:

  • makes code android-compatible.
  • extends ERROR(/OrchestrationRunListener) instead of implementing the similar com.android.ddmlib.testrunner.ITestRunListener interface to easily attach it to AndroidTestOrchestrator.
  • writes XML to /sdcard/odo/ by default.
  • prints start-time and end-time of each test in XML.
  • fixes a few java coding style problems.

See also:

Summary

Constants
String REPORT_DIRECTORY_NAME
Public Constructors
OrchestrationXmlTestRunListener()
Public Methods
TestRunResult getRunResult()
Returns the TestRunResult
void orchestrationRunFinished()
void orchestrationRunStarted(int testCount)
void setHostName(String hostName)
void setReportDir(File file)
Sets the report file to use.
void testAssumptionFailure(ParcelableFailure failure)
void testFailure(ParcelableFailure failure)
void testFinished(ParcelableDescription description)
void testIgnored(ParcelableDescription description)
void testProcessFinished(String message)
void testRunFinished(ParcelableResult result)
void testRunStarted(ParcelableDescription description)
void testStarted(ParcelableDescription description)
Protected Methods
File getResultFile(File reportDir)
Creates a File where the report will be created.
String getTestName(TestIdentifier testId)
String getTestSuiteName()
[Expand]
Inherited Methods
From class android.support.test.orchestrator.listeners.OrchestrationRunListener
From class java.lang.Object

Constants

public static final String REPORT_DIRECTORY_NAME

Constant Value: "odo"

Public Constructors

public OrchestrationXmlTestRunListener ()

Public Methods

public TestRunResult getRunResult ()

Returns the TestRunResult

Returns
TestRunResult the test run results.

public void orchestrationRunFinished ()

public void orchestrationRunStarted (int testCount)

Parameters
testCount int

public void setHostName (String hostName)

Parameters
hostName String

public void setReportDir (File file)

Sets the report file to use.

Parameters
file File

public void testAssumptionFailure (ParcelableFailure failure)

Parameters
failure ParcelableFailure

public void testFailure (ParcelableFailure failure)

Parameters
failure ParcelableFailure

public void testFinished (ParcelableDescription description)

Parameters
description ParcelableDescription

public void testIgnored (ParcelableDescription description)

Parameters
description ParcelableDescription

public void testProcessFinished (String message)

Parameters
message String

public void testRunFinished (ParcelableResult result)

Parameters
result ParcelableResult

public void testRunStarted (ParcelableDescription description)

Parameters
description ParcelableDescription

public void testStarted (ParcelableDescription description)

Parameters
description ParcelableDescription

Protected Methods

protected File getResultFile (File reportDir)

Creates a File where the report will be created.

Parameters
reportDir File: the root directory of the report.
Returns
File a file
Throws
IOException

protected String getTestName (TestIdentifier testId)

Parameters
testId TestIdentifier
Returns
String

protected String getTestSuiteName ()

Returns
String