to top
public class

TextResultReporter

extends InvocationToJUnitResultForwarder
implements ILogSaverListener ITestInvocationListener
java.lang.Object
   ↳ com.android.tradefed.result.InvocationToJUnitResultForwarder
     ↳ com.android.tradefed.result.TextResultReporter

Class Overview

A test result reporter that forwards results to the JUnit text result printer.

Summary

Public Constructors
TextResultReporter()
Public Methods
void setLogSaver(ILogSaver logSaver)
Set the ILogSaver to allow the implementor to save files.
void testAssumptionFailure(TestIdentifier testId, String trace)
void testEnded(TestIdentifier testId, Map<String, String> metrics)
Overrides parent to explicitly print out test metrics.
void testFailed(TestIdentifier testId, String trace)
Overrides parent to explicitly print out failures.
void testLog(String dataName, LogDataType dataType, InputStreamSource dataStream)
Provides the associated log or debug data from the test invocation.
void testLogSaved(String dataName, LogDataType dataType, InputStreamSource dataStream, LogFile logFile)
Called when the test log is saved.
void testRunEnded(long elapsedTime, Map<String, String> metrics)
Overrides parent to explicitly print out metrics.
[Expand]
Inherited Methods
From class com.android.tradefed.result.InvocationToJUnitResultForwarder
From class java.lang.Object
From interface com.android.ddmlib.testrunner.ITestRunListener
From interface com.android.tradefed.result.ILogSaverListener
From interface com.android.tradefed.result.ITestInvocationListener

Public Constructors

public TextResultReporter ()

Creates a TextResultReporter.

Public Methods

public void setLogSaver (ILogSaver logSaver)

Set the ILogSaver to allow the implementor to save files.

Parameters
logSaver the ILogSaver

public void testAssumptionFailure (TestIdentifier testId, String trace)

public void testEnded (TestIdentifier testId, Map<String, String> metrics)

Overrides parent to explicitly print out test metrics.

public void testFailed (TestIdentifier testId, String trace)

Overrides parent to explicitly print out failures. The ResultPrinter relies on the runner calling "print" at end of test run to do this.

public void testLog (String dataName, LogDataType dataType, InputStreamSource dataStream)

Provides the associated log or debug data from the test invocation.

Must be called before invocationFailed(Throwable) or invocationEnded(long)

The TradeFederation framework will automatically call this method, providing the host log and if applicable, the device logcat.

Parameters
dataName a String descriptive name of the data. e.g. "device_logcat". Note dataName may not be unique per invocation. ie implementers must be able to handle multiple calls with same dataName
dataType the LogDataType of the data
dataStream the InputStreamSource of the data. Implementers should call createInputStream to start reading the data, and ensure to close the resulting InputStream when complete. Callers should ensure the source of the data remains present and accessible until the testLog method completes.

public void testLogSaved (String dataName, LogDataType dataType, InputStreamSource dataStream, LogFile logFile)

Called when the test log is saved.

Should be used in place of testLog(String, LogDataType, InputStreamSource).

Parameters
dataName a String descriptive name of the data. e.g. "device_logcat". Note dataName may not be unique per invocation. ie implementers must be able to handle multiple calls with same dataName
dataType the LogDataType of the data
dataStream the InputStreamSource of the data. Implementers should call createInputStream to start reading the data, and ensure to close the resulting InputStream when complete.
logFile the LogFile containing the meta data of the saved file.

public void testRunEnded (long elapsedTime, Map<String, String> metrics)

Overrides parent to explicitly print out metrics.