ClusterLogSaver
public
class
ClusterLogSaver
extends Object
implements
ILogSaver
java.lang.Object | |
↳ | com.android.tradefed.cluster.ClusterLogSaver |
ILogSaver
類別,用於將測試輸出內容上傳至 TFC。
摘要
欄位 | |
---|---|
public
static
final
String |
FILE_NAMES_FILE_NAME
包含所有測試輸出檔案名稱的文字檔名稱。 |
public
static
final
String |
TOOL_LOG_PATH
包含主機程序產生的所有檔案的子目錄名稱。 |
公用建構函式 | |
---|---|
ClusterLogSaver()
|
公用方法 | |
---|---|
LogFile
|
getLogReportDir()
取得包含記錄儲存目錄路徑和/或網址的 |
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
包含所有測試輸出檔案名稱的文字檔名稱。
TOOL_LOG_PATH
public static final String TOOL_LOG_PATH
包含主機程序產生的所有檔案的子目錄名稱。
公用建構函式
ClusterLogSaver
public ClusterLogSaver ()
公用方法
invocationEnded
public void invocationEnded (long elapsedTime)
回報叫用已終止,無論是成功或因某些錯誤條件而終止。
系統會在呼叫 ITestInvocationListener.invocationEnded(long)
後,自動呼叫 TradeFederation 架構。
參數 | |
---|---|
elapsedTime |
long :叫用作業的經過時間 (以毫秒為單位) |
invocationStarted
public void invocationStarted (IInvocationContext context)
回報測試叫用作業的開始時間。
會在 ITestInvocationListener.invocationStarted(IInvocationContext)
呼叫前,由 TradeFederation 架構自動呼叫。
參數 | |
---|---|
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 包含儲存檔案的路徑和網址。 |