测试调用
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.
[]
[]