ResultAndLogForwarder

public class ResultAndLogForwarder
extends ResultForwarder implements ILogSaverListener

java.lang.Object
com.android.tradefed.result.ResultForwarder
  com.android.tradefed.result.ResultAndLogForwarder


Forwarder for results and logs events.

ملخّص

طُرق وضع التصميم العامة

ResultAndLogForwarder(ITestInvocationListener... listeners)
ResultAndLogForwarder(List<ITestInvocationListener> listeners)

Ctor

الإجراءات العامة

void invocationEnded(long elapsedTime)

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

void invocationStarted(IInvocationContext context)

Reports the start of the test invocation.

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,LogDataType,InputStreamSource,LogFile) callback is not possible.

void setLogSaver(ILogSaver logSaver)

Set the ILogSaver to allow the implementor to save files.

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

Called when the test log is saved.

طُرق وضع التصميم العامة

ResultAndLogForwarder

public ResultAndLogForwarder (ITestInvocationListener... listeners)

المعلَمات
listeners ITestInvocationListener

ResultAndLogForwarder

public ResultAndLogForwarder (List<ITestInvocationListener> listeners)

Ctor

المعلَمات
listeners List

الإجراءات العامة

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.

المعلَمات
elapsedTime long: the elapsed time of the invocation in ms

invocationStarted

public void invocationStarted (IInvocationContext context)

Reports the start of the test invocation.

Will be automatically called by the TradeFederation framework. Reporters need to override this method to support multiple devices reporting.

المعلَمات
context IInvocationContext: information about the invocation

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,LogDataType,InputStreamSource,LogFile) callback is not possible. Thus, this callback allows to provide a strong association explicitly.

المعلَمات
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)

Set the ILogSaver to allow the implementor to save files.

المعلَمات
logSaver ILogSaver: the ILogSaver

testLogSaved

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

Called when the test log is saved.

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

المعلَمات
dataName 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

dataType LogDataType: the LogDataType of the data

dataStream InputStreamSource: the InputStreamSource of the data. Implementers should call createInputStream to start reading the data, and ensure to close the resulting InputStream when complete.

logFile LogFile: the LogFile containing the meta data of the saved file.