FileMetadataCollector

public class FileMetadataCollector
extends Object implements ILogSaverListener, ITestInvocationListener

java.lang.Object
   ↳ com.android.tradefed.result.FileMetadataCollector


A listener that collects and uploads metadata about saved log files.

Summary

Fields

protected boolean mDisable

Public constructors

FileMetadataCollector()

Create a FileMetadataCollector.

Public methods

void invocationEnded(long elapsedTime)

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

void setLogSaver(ILogSaver logSaver)

Set the ILogSaver to allow the implementor to save files.

void testLogSaved(String dataName, LogDataType dataType, InputStreamSource source, LogFile file)

Called when the test log is saved.

Fields

mDisable

boolean mDisable

Public constructors

FileMetadataCollector

FileMetadataCollector ()

Create a FileMetadataCollector.

Public methods

invocationEnded

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

setLogSaver

void setLogSaver (ILogSaver logSaver)

Set the ILogSaver to allow the implementor to save files.

Parameters
logSaver ILogSaver: the ILogSaver

testLogSaved

void testLogSaved (String dataName, 
                LogDataType dataType, 
                InputStreamSource source, 
                LogFile file)

Called when the test log is saved.

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

Parameters
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

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

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