ModuleListener

public class ModuleListener
extends CollectingTestListener

java.lang.Object
   ↳ com.android.tradefed.result.CollectingTestListener
     ↳ com.android.tradefed.testtype.suite.ModuleListener


Listener attached to each IRemoteTest of each module in order to collect the list of results.

Summary

Public constructors

ModuleListener(ITestInvocationListener listener)

Constructor.

Public methods

int getNumTotalTests()

Gets the total number of complete tests for all runs.

void testFailed(TestIdentifier test, String trace)

void testLog(String name, LogDataType type, InputStreamSource stream)

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

void testRunStarted(String name, int numTests)

void testStarted(TestIdentifier test, long startTime)

Public constructors

ModuleListener

ModuleListener (ITestInvocationListener listener)

Constructor. Accept the original listener to forward testLog callback.

Parameters
listener ITestInvocationListener

Public methods

getNumTotalTests

int getNumTotalTests ()

Gets the total number of complete tests for all runs.

Returns
int

testFailed

void testFailed (TestIdentifier test, 
                String trace)

Parameters
test TestIdentifier

trace String

testLog

void testLog (String name, 
                LogDataType type, 
                InputStreamSource stream)

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
name String: 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

type LogDataType: the LogDataType of the data

stream InputStreamSource: 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.

testRunStarted

void testRunStarted (String name, 
                int numTests)

Parameters
name String

numTests int

testStarted

void testStarted (TestIdentifier test, 
                long startTime)

Parameters
test TestIdentifier

startTime long