ClusterLogSaver

public class ClusterLogSaver
extends Object implements ILogSaver

java.lang.Object
   ↳ com.android.tradefed.cluster.ClusterLogSaver


將測試輸出內容上傳至 TFC 的 ILogSaver 類別。

摘要

常數

String FILE_NAMES_FILE_NAME

包含所有測試輸出檔案名稱的文字檔名稱。

String TOOL_LOG_PATH

包含主機程序所產生所有檔案的子目錄名稱。

公用建構函式

ClusterLogSaver()

公用方法

LogFile getLogReportDir()

取得 LogFile,其中包含儲存記錄的目錄路徑和/或網址。

void invocationEnded(long elapsedTime)

回報是否因成功或發生錯誤而終止呼叫。

void invocationStarted(IInvocationContext context)

回報測試呼叫的開始時間。

LogFile saveLogData(String dataName, LogDataType dataType, InputStream dataStream)

儲存記錄資料。

常數

FILE_NAMES_FILE_NAME

public static final String FILE_NAMES_FILE_NAME

包含所有測試輸出檔案名稱的文字檔名稱。

常數值: "FILES"

TOOL_LOG_PATH

public static final String TOOL_LOG_PATH

子目錄的名稱,內含主機程序產生的所有檔案。

常數值: "tool-logs"

公用建構函式

ClusterLogSaver

public ClusterLogSaver ()

公用方法

getLogReportDir

public LogFile getLogReportDir ()

取得 LogFile,其中包含記錄儲存目錄的路徑和/或網址。

傳回
LogFile LogFile

invocationEnded

public void invocationEnded (long elapsedTime)

回報是否因某些錯誤狀況而終止呼叫 (無論是否成功)。

在呼叫 ITestInvocationListener.invocationEnded(long) 後,TradeFederation 架構會自動呼叫這個方法。

參數
elapsedTime long:以毫秒為單位的呼叫經過時間

invocationStarted

public void invocationStarted (IInvocationContext context)

回報測試呼叫的開始時間。

TradeFederation 架構會在呼叫 ITestInvocationListener.invocationStarted(IInvocationContext) 之前,自動呼叫這個方法。

參數
context IInvocationContext:有關呼叫的資訊。

saveLogData

public LogFile saveLogData (String dataName, 
                LogDataType dataType, 
                InputStream dataStream)

儲存記錄資料。

每當呼叫 ITestLogger.testLog(String, com.android.tradefed.result.LogDataType, com.android.tradefed.result.InputStreamSource) 時,TradeFederation 架構就會自動呼叫這個方法。這個方法也可用於儲存額外的記錄資料。

視實作方式和政策而定,記錄可能會以壓縮形式儲存。 記錄檔也可能儲存在 Tradefed 無法存取的位置。

參數
dataName String:資料的String說明名稱,例如「device_logcat」。

dataType LogDataType:檔案的 LogDataType

dataStream InputStream:資料的 ERROR(/InputStream)

傳回
LogFile 包含已儲存檔案路徑和網址的 LogFile