測試調用
public class TestInvocation
extends Object
implements ITestInvocation
對象 | |
↳ | com.android.tradefed.invoker.TestInvocation |
默認實現ITestInvocation
。
IConfiguration
-檢索構建-準備目標-運行測試-結果報告概括
嵌套類 | |
---|---|
enum | TestInvocation.RunMode 調用可以遇到的不同模式。 |
enum | TestInvocation.Stage
|
字段 | |
---|---|
public static final String | COMMAND_ARGS_KEY 命令行 args 屬性的鍵 |
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) 助手使用命令行來回填一個 |
static FailureDescription | createFailureFromException (Throwable exception, TestRecordProto.FailureStatus defaultStatus) 創建 |
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 | notifyInvocationStopped (String message, ErrorIdentifier errorId) 通知 |
static void | printStageDelimiter ( TestInvocation.Stage phase, boolean end) 為調用的給定階段打印分隔符。 |
void | registerExecutionFiles (ExecutionFiles executionFiles) |
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) 設置退出代碼的助手。 |
字段
COMMAND_ARGS_KEY
public static final String COMMAND_ARGS_KEY
命令行 args 屬性的鍵
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 ()
公共方法
backFillBuildInfoForReporting
public static IBuildInfo backFillBuildInfoForReporting (String commandLine)
助手使用命令行來回填一個IBuildInfo
在下載失敗的情況匯報。
參數 | |
---|---|
commandLine | String |
退貨 | |
---|---|
IBuildInfo |
createFailureFromException
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 | IRescheduler :所述IRescheduler ,用於在另一資源上重新調度的調用來執行的部分(S) |
extraListeners | ITestInvocationListener : ITestInvocationListener s到通知,除了那些config |
投擲 | |
---|---|
DeviceNotAvailableException |
是子進程
public static boolean isSubprocess (IConfiguration config)
如果調用當前在子流程範圍內,則返回 true。
參數 | |
---|---|
config | IConfiguration |
退貨 | |
---|---|
boolean |
通知調用已停止
public void notifyInvocationStopped (String message, ErrorIdentifier errorId)
通知TestInvocation
是TradeFed被要求停止。
參數 | |
---|---|
message | String :與停止調用相關的消息 |
errorId | ErrorIdentifier |
打印階段分隔符
public static void printStageDelimiter (TestInvocation.Stage phase, boolean end)
為調用的給定階段打印分隔符。
參數 | |
---|---|
phase | TestInvocation.Stage |
end | boolean |
註冊執行文件
public void registerExecutionFiles (ExecutionFiles executionFiles)
參數 | |
---|---|
executionFiles | ExecutionFiles |
字符串
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 |
applyAutomatedReporters
protected void applyAutomatedReporters (IConfiguration config)
參數 | |
---|---|
config | IConfiguration |
設置退出代碼
protected void setExitCode (CommandRunner.ExitCode code, Throwable stack)
設置退出代碼的助手。暴露用於測試。
參數 | |
---|---|
code | CommandRunner.ExitCode |
stack | Throwable |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2021-10-04 UTC.
[]
[]