LegacySubprocessResultsReporter

public final class LegacySubprocessResultsReporter
extends SubprocessResultsReporter

java.lang.Object
   ↳ com.android.tradefed.result.SubprocessResultsReporter
     ↳ com.android.tradefed.result.LegacySubprocessResultsReporter


A frozen implementation of the subprocess results reporter which should remain compatible with earlier versions of TF/CTS (e.g. 8+), despite changes in its superclass.

This reporter can be dynamically injected to enable subprocess reporting capability in old TF-based test suites.

Summary

Public constructors

LegacySubprocessResultsReporter()

Protected constructors

LegacySubprocessResultsReporter(boolean installHandler)

Public methods

void invocationEnded(long elapsedTime)

Reports that the invocation has terminated, whether successfully or due to some error condition.

void invocationFailed(Throwable cause)

Reports an incomplete invocation due to some error condition.

void invocationStarted(IBuildInfo buildInfo)
void logAssociation(String dataName, LogFile logFile)

In some cases, log must be strongly associated with a test cases, but the opportunity to do so on the direct testLogSaved(String, com.android.tradefed.result.LogDataType, com.android.tradefed.result.InputStreamSource, com.android.tradefed.result.LogFile) callback is not possible.

void setLogSaver(ILogSaver logSaver)
void testAssumptionFailure(TestIdentifier testId, String trace)
void testEnded(TestIdentifier testId, metrics)
void testEnded(TestIdentifier testId, long endTime, metrics)
void testFailed(TestIdentifier testId, String reason)
void testIgnored(TestIdentifier testId)
void testLogSaved(String dataName, LogDataType dataType, InputStreamSource dataStream, LogFile logFile)
void testModuleEnded()

Reports the end of a module run.

void testModuleStarted(IInvocationContext moduleContext)

Reports the beginning of a module running.

void testRunEnded(long time, runMetrics)

Reports end of test run.

void testRunFailed(String reason)

Reports test run failed to complete due to a fatal error.

void testRunStarted(String runName, int testCount)

Reports the start of a test run.

void testStarted(TestIdentifier testId)
void testStarted(TestIdentifier testId, long startTime)

Public constructors

LegacySubprocessResultsReporter

public LegacySubprocessResultsReporter ()

Protected constructors

LegacySubprocessResultsReporter

protected LegacySubprocessResultsReporter (boolean installHandler)

Parameters
installHandler boolean

Public methods

invocationEnded

public void invocationEnded (long elapsedTime)

Reports that the invocation has terminated, whether successfully or due to some error condition.

Will be automatically called by the TradeFederation framework.

Parameters
elapsedTime long: the elapsed time of the invocation in ms

invocationFailed

public void invocationFailed (Throwable cause)

Reports an incomplete invocation due to some error condition.

Will be automatically called by the TradeFederation framework.

Parameters
cause Throwable: the Throwable cause of the failure

invocationStarted

public void invocationStarted (IBuildInfo buildInfo)

Parameters
buildInfo IBuildInfo

logAssociation

public void logAssociation (String dataName, 
                LogFile logFile)

In some cases, log must be strongly associated with a test cases, but the opportunity to do so on the direct testLogSaved(String, com.android.tradefed.result.LogDataType, com.android.tradefed.result.InputStreamSource, com.android.tradefed.result.LogFile) callback is not possible. Thus, this callback allows to provide a strong association explicitly.

Parameters
dataName String: The name of the data

logFile LogFile: the LogFile that was logged before and should be associated with the test case.

setLogSaver

public void setLogSaver (ILogSaver logSaver)

Parameters
logSaver ILogSaver

testAssumptionFailure

public void testAssumptionFailure (TestIdentifier testId, 
                String trace)

Parameters
testId TestIdentifier

trace String

testEnded

public void testEnded (TestIdentifier testId, 
                 metrics)

Parameters
testId TestIdentifier

metrics

testEnded

public void testEnded (TestIdentifier testId, 
                long endTime, 
                 metrics)

Parameters
testId TestIdentifier

endTime long

metrics

testFailed

public void testFailed (TestIdentifier testId, 
                String reason)

Parameters
testId TestIdentifier

reason String

testIgnored

public void testIgnored (TestIdentifier testId)

Parameters
testId TestIdentifier

testLogSaved

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

Parameters
dataName String

dataType LogDataType

dataStream InputStreamSource

logFile LogFile

testModuleEnded

public void testModuleEnded ()

Reports the end of a module run.

testModuleStarted

public void testModuleStarted (IInvocationContext moduleContext)

Reports the beginning of a module running. This callback is associated with testModuleEnded() and is optional in the sequence. It is only used during a run that uses modules: suite based runners.

Parameters
moduleContext IInvocationContext: the IInvocationContext of the module.

testRunEnded

public void testRunEnded (long time, 
                 runMetrics)

Reports end of test run.

Parameters
time long: device reported elapsed time, in milliseconds

runMetrics : key-value pairs reported at the end of a test run

testRunFailed

public void testRunFailed (String reason)

Reports test run failed to complete due to a fatal error.

Parameters
reason String: String describing reason for run failure.

testRunStarted

public void testRunStarted (String runName, 
                int testCount)

Reports the start of a test run.

Parameters
runName String: the test run name

testCount int: total number of tests in test run

testStarted

public void testStarted (TestIdentifier testId)

Parameters
testId TestIdentifier

testStarted

public void testStarted (TestIdentifier testId, 
                long startTime)

Parameters
testId TestIdentifier

startTime long