public class

TextResultReporter

extends InvocationToJUnitResultForwarder
implements 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 invocationStarted(IBuildInfo buildInfo)
Reports the start of the test invocation.
void testEnded(TestIdentifier testId, Map<String, String> metrics)
Overrides parent to explicitly print out test metrics.
void testFailed(ITestRunListener.TestFailure status, 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 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.ITestInvocationListener

Public Constructors

public TextResultReporter ()

Creates a TextResultReporter.

Public Methods

public void invocationStarted (IBuildInfo buildInfo)

Reports the start of the test invocation.

Will be automatically called by the TradeFederation framework.

Parameters
buildInfo information about the build being tested

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

Overrides parent to explicitly print out test metrics.

public void testFailed (ITestRunListener.TestFailure status, 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 testRunEnded (long elapsedTime, Map<String, String> metrics)

Overrides parent to explicitly print out metrics.