测试调用
public class TestInvocation
extends Object
implements ITestInvocation
java.lang.Object | |
↳ | 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_END_HOST_LOG |
public static final String | TRADEFED_LOG_NAME
|
公共建设者 | |
---|---|
TestInvocation () |
公开方法 | |
---|---|
IInvocationExecution | createInvocationExec ( TestInvocation.RunMode mode) 创建应遵循的调用路径。 |
static String | getDeviceLogName ( TestInvocation.Stage stage) |
static String | getEmulatorLogName ( TestInvocation.Stage stage) |
void | invoke (IInvocationContext context, IConfiguration config, IRescheduler rescheduler, ITestInvocationListener... extraListeners) 执行测试调用。 |
void | notifyInvocationStopped (String message) 通知 |
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_END_HOST_LOG
public static final String TRADEFED_END_HOST_LOG
TRADEFED_LOG_NAME
public static final String TRADEFED_LOG_NAME
公共建设者
测试调用
public TestInvocation ()
公开方法
createInvocationExec
public IInvocationExecution createInvocationExec (TestInvocation.RunMode mode)
创建应遵循的调用路径。
参量 | |
---|---|
mode | TestInvocation.RunMode :我们当前运行的模式。 |
退货 | |
---|---|
IInvocationExecution | 描述调用的IInvocationExecution 。 |
getDeviceLogName
public static String getDeviceLogName (TestInvocation.Stage stage)
参量 | |
---|---|
stage | TestInvocation.Stage |
退货 | |
---|---|
String |
getEmulatorLogName
public static String getEmulatorLogName (TestInvocation.Stage stage)
参量 | |
---|---|
stage | TestInvocation.Stage |
退货 | |
---|---|
String |
调用
public void invoke (IInvocationContext context, IConfiguration config, IRescheduler rescheduler, ITestInvocationListener... extraListeners)
执行测试调用。
参量 | |
---|---|
context | IInvocationContext :执行测试的IInvocationContext 。 |
config | IConfiguration :此测试运行的IConfiguration 。 |
rescheduler | IRescheduler : IRescheduler ,用于重新安排部分调用以在另一个资源上执行 |
extraListeners | ITestInvocationListener : ITestInvocationListener ,除了config那些通知 |
投掷 | |
---|---|
DeviceNotAvailableException |
notifyInvocationStopped
public void notifyInvocationStopped (String message)
通知TestInvocation
,TradeFed已被要求停止。
参量 | |
---|---|
message | String :与停止调用相关的消息 |
printStageDelimiter
public static void printStageDelimiter (TestInvocation.Stage phase, boolean end)
打印给定调用阶段的定界符。
参量 | |
---|---|
phase | TestInvocation.Stage |
end | boolean |
registerExecutionFiles
public void registerExecutionFiles (ExecutionFiles executionFiles)
参量 | |
---|---|
executionFiles | ExecutionFiles |
toString
public String toString ()
退货 | |
---|---|
String |
受保护的方法
addInvocationMetric
protected void addInvocationMetric (InvocationMetricLogger.InvocationMetricKey key, String value)
参量 | |
---|---|
key | InvocationMetricLogger.InvocationMetricKey |
value | String |
addInvocationMetric
protected void addInvocationMetric (InvocationMetricLogger.InvocationMetricKey key, long value)
参量 | |
---|---|
key | InvocationMetricLogger.InvocationMetricKey |
value | long |
applyAutomatedReporters
protected void applyAutomatedReporters (IConfiguration config)
参量 | |
---|---|
config | IConfiguration |
setExitCode
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 is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-09-08 UTC.