測試調用

public class TestInvocation
extends Object implements ITestInvocation

java.lang.Object
com.android.tradefed.invoker.TestInitation


ITestInvocation的預設實作。

根據IConfiguration載入主要物件 - 檢索建置 - 準備目標 - 執行測試 - 報表結果

概括

常數

long AVAILABILITY_CHECK_TIMEOUT

領域

public static final String COMMAND_ARGS_KEY

命令列 args 屬性的鍵

public static final String INVOCATION_EXTERNAL_DEPENDENCIES

public static final String TRADEFED_CONFIG_NAME

public static final String TRADEFED_END_HOST_LOG

public static final String TRADEFED_INVOC_COMPLETE_HOST_LOG

public static final String TRADEFED_LOG_NAME

公共構造函數

TestInvocation ()

公共方法

static IBuildInfo backFillBuildInfoForReporting (String commandLine)

使用命令列回填IBuildInfo幫助程序,以便在下載失敗時進行報告。

static FailureDescription createFailureFromException (Throwable exception, TestRecordProto.FailureStatus defaultStatus)

從呼叫異常建立FailureDescription

IInvocationExecution createInvocationExec ( TestInvocation.RunMode mode)

建立應遵循的呼叫路徑。

static String getDeviceLogName ( TestInvocation.Stage stage)
static String getEmulatorLogName ( TestInvocation.Stage stage)
ITestInvocation.ExitInformation getExitInfo ()

給定調用的退出訊息。

void invoke ( IInvocationContext context, IConfiguration config, IRescheduler rescheduler, ITestInvocationListener... extraListeners)

執行測試調用。

static boolean isSubprocess ( IConfiguration config)

如果呼叫目前位於子流程範圍內,則傳回 true。

void notifyInvocationForceStopped (String message, ErrorIdentifier errorId)

通知TestInvocation TradeFed 已被要求停止。

void notifyInvocationStopped (String message)

通知TestInvocation TradeFed 最終將關閉。

static void printStageDelimiter ( TestInvocation.Stage phase, boolean end)

列印調用的給定階段的分隔符號。

void registerExecutionFiles ( ExecutionFiles executionFiles)
void setClearcutClient (ClearcutClient client)

轉送clearcut客戶端以報告指標。

static boolean shouldSkipBugreportError (Throwable t)

當應該跳過錯誤報告時識別錯誤的幫助方法

String toString ()

受保護的方法

void addInvocationMetric ( InvocationMetricLogger.InvocationMetricKey key, String value)
void addInvocationMetric ( InvocationMetricLogger.InvocationMetricKey key, long value)
void applyAutomatedReporters ( IConfiguration config)
void setExitCode ( CommandRunner.ExitCode code, Throwable stack)

設定退出代碼的幫助程序。

常數

AVAILABILITY_CHECK_TIMEOUT

public static final long AVAILABILITY_CHECK_TIMEOUT

常數值:180000 (0x000000000002bf20)

領域

指令_ARGS_KEY

public static final String COMMAND_ARGS_KEY

命令列 args 屬性的鍵

INVOCATION_EXTERNAL_DEPENDENCIES

public static final String INVOCATION_EXTERNAL_DEPENDENCIES

TRADEFED_CONFIG_NAME

public static final String TRADEFED_CONFIG_NAME

TRADEFED_END_HOST_LOG

public static final String TRADEFED_END_HOST_LOG

TRADEFED_INVOC_COMPLETE_HOST_LOG

public static final String TRADEFED_INVOC_COMPLETE_HOST_LOG

TRADEFED_LOG_NAME

public static final String TRADEFED_LOG_NAME

公共構造函數

測試調用

public TestInvocation ()

公共方法

返回FillBuildInfoForReporting

public static IBuildInfo backFillBuildInfoForReporting (String commandLine)

使用命令列回填IBuildInfo幫助程序,以便在下載失敗時進行報告。

參數
commandLine String

退貨
IBuildInfo

從異常建立失敗

public static FailureDescription createFailureFromException (Throwable exception, 
                TestRecordProto.FailureStatus defaultStatus)

從呼叫異常建立FailureDescription

參數
exception Throwable :要轉換的異常

defaultStatus TestRecordProto.FailureStatus :如果異常不是IHarnessException ,則預設使用的狀態。

退貨
FailureDescription

建立呼叫執行

public IInvocationExecution createInvocationExec (TestInvocation.RunMode mode)

建立應遵循的呼叫路徑。

參數
mode TestInvocation.RunMode :我們目前運行的模式。

退貨
IInvocationExecution描述調用的IInvocationExecution

取得設備日誌名稱

public static String getDeviceLogName (TestInvocation.Stage stage)

參數
stage TestInvocation.Stage

退貨
String

取得模擬器日誌名稱

public static String getEmulatorLogName (TestInvocation.Stage stage)

參數
stage TestInvocation.Stage

退貨
String

獲取退出信息

public ITestInvocation.ExitInformation getExitInfo ()

給定調用的退出訊息。

退貨
ITestInvocation.ExitInformation

呼叫

public void invoke (IInvocationContext context, 
                IConfiguration config, 
                IRescheduler rescheduler, 
                ITestInvocationListener... extraListeners)

執行測試調用。

參數
context IInvocationContext :用於執行測試的IInvocationContext

config IConfiguration :本次測試運行的IConfiguration

rescheduler IReschedulerIRescheduler ,用於重新安排呼叫的部分以便在另一個資源上執行

extraListeners ITestInvocationListener :除了config中的那些之外,要通知的ITestInvocationListener

投擲
DeviceNotAvailableException

是子行程

public static boolean isSubprocess (IConfiguration config)

如果呼叫目前位於子流程範圍內,則傳回 true。

參數
config IConfiguration

退貨
boolean

通知呼叫強制停止

public void notifyInvocationForceStopped (String message, 
                ErrorIdentifier errorId)

通知TestInvocation TradeFed 已被要求停止。

參數
message String : 與停止呼叫相關的訊息

errorId ErrorIdentifier :與強制停止相關的標識符

通知呼叫停止

public void notifyInvocationStopped (String message)

通知TestInvocation TradeFed 最終將關閉。

參數
message String : 與停止呼叫相關的訊息

列印階段分隔符

public static void printStageDelimiter (TestInvocation.Stage phase, 
                boolean end)

列印調用的給定階段的分隔符號。

參數
phase TestInvocation.Stage

end boolean

註冊執行文件

public void registerExecutionFiles (ExecutionFiles executionFiles)

參數
executionFiles ExecutionFiles

設定ClearcutClient

public void setClearcutClient (ClearcutClient client)

轉送clearcut客戶端以報告指標。

參數
client ClearcutClient

應該跳過錯誤報告錯誤

public static boolean shouldSkipBugreportError (Throwable t)

當應該跳過錯誤報告時識別錯誤的幫助方法

參數
t Throwable

退貨
boolean

到字串

public String toString ()

退貨
String

受保護的方法

新增呼叫指標

protected void addInvocationMetric (InvocationMetricLogger.InvocationMetricKey key, 
                String value)

參數
key InvocationMetricLogger.InvocationMetricKey

value String

新增呼叫指標

protected void addInvocationMetric (InvocationMetricLogger.InvocationMetricKey key, 
                long value)

參數
key InvocationMetricLogger.InvocationMetricKey

value long

應用自動化記者

protected void applyAutomatedReporters (IConfiguration config)

參數
config IConfiguration

設定退出代碼

protected void setExitCode (CommandRunner.ExitCode code, 
                Throwable stack)

設定退出代碼的幫助程序。暴露進行測試。

參數
code CommandRunner.ExitCode

stack Throwable