AndroidBuildApiLogSaver

public class AndroidBuildApiLogSaver
extends Object implements ILogSaver

java.lang.Object
   ↳ com.google.android.tradefed.result.AndroidBuildApiLogSaver


這個類別會將記錄檔儲存至 Android Build API。

摘要

公用建構函式

AndroidBuildApiLogSaver()

公用方法

LogFile getLogReportDir()

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

void init(IInvocationContext context)

在提供任何建構資訊之前,先通知初始化。

void invocationEnded(long elapsedTime)

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

void invocationStarted(IInvocationContext context)

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

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

儲存記錄資料。

LogFile saveLogFile(String dataName, LogDataType dataType, File fileToLog)

儲存記錄檔。

受保護的方法

IInvocationContext getInvocationContext()
void runUpdate(Androidbuildinternal client, String filePath, String resourceId, String md5, FileContent fileContent, LogDataType type, String contentType)

公用建構函式

AndroidBuildApiLogSaver

public AndroidBuildApiLogSaver ()

公用方法

getLogReportDir

public LogFile getLogReportDir ()

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

傳回
LogFile LogFile

init

public void init (IInvocationContext context)

在提供任何建構資訊之前,先發送初始化通知。這樣一來,您就能設定接收記錄的任何需求。

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

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

saveLogFile

public LogFile saveLogFile (String dataName, 
                LogDataType dataType, 
                File fileToLog)

儲存記錄檔。

每當呼叫 ITestLogger.testLog(String, com.android.tradefed.result.LogDataType, com.android.tradefed.result.InputStreamSource) 且串流參照檔案時,TradeFederation 架構就會自動呼叫這個方法。

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

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

dataType LogDataType:檔案的 LogDataType

fileToLog File:要儲存的 ERROR(/File)

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

受保護的方法

getInvocationContext

protected IInvocationContext getInvocationContext ()

傳回
IInvocationContext

runUpdate

protected void runUpdate (Androidbuildinternal client, 
                String filePath, 
                String resourceId, 
                String md5, 
                FileContent fileContent, 
                LogDataType type, 
                String contentType)

參數
client Androidbuildinternal

filePath String

resourceId String

md5 String

fileContent FileContent

type LogDataType

contentType String