SubprocessTfLauncher

public abstract class SubprocessTfLauncher
extends Object implements IBuildReceiver, IConfigurationReceiver, IInvocationContextReceiver, IRemoteTest

java.lang.Object
   ↳ com.android.tradefed.testtype.SubprocessTfLauncher


用于针对单独的 TF 安装运行测试的 IRemoteTest

启动外部 Java 进程以运行测试。用于持续运行 TF 单元测试或功能测试。

摘要

字段

public static final String ANDROID_SERIAL_VAR

环境。

public static final String PARENT_PROC_TAG_NAME

public static final String SUBPROCESS_TAG_NAME

将传递给 TF 子进程以对其进行区分的标记

protected IBuildInfo mBuildInfo

protected mCmdArgs

protected IConfiguration mConfig

protected String mRootDir

protected IRunUtil mRunUtil

protected File mTmpDir

公共构造函数

SubprocessTfLauncher()

公共方法

void run(TestInformation testInfo, ITestInvocationListener listener)

运行测试并向监听器报告结果。

void setBuild(IBuildInfo buildInfo)

void setConfiguration(IConfiguration configuration)

注入正在使用的 IConfiguration

void setInvocationContext(IInvocationContext invocationContext)

受保护的方法

void addJavaArguments( args)

允许向子进程调用添加额外的 Java 参数。

String getJava()
IRunUtil getRunUtil()

返回将用于子进程命令的 IRunUtil

void postRun(ITestInvocationListener listener, boolean exception, long elapsedTime)

TF 测试完成后要执行的操作。

void preRun()

运行测试前的设置。

void setEventStreaming(boolean eventStreaming)

设置 use-event-streaming。

void setProtoReporting(boolean protoReporting)
void setRunUtil(IRunUtil runUtil)

设置 IRunUtil。

字段

ANDROID_SERIAL_VAR

public static final String ANDROID_SERIAL_VAR

影响 adb 选择的环境变量。

PARENT_PROC_TAG_NAME

public static final String PARENT_PROC_TAG_NAME

SUBPROCESS_TAG_NAME

public static final String SUBPROCESS_TAG_NAME

将传递给 TF 子进程以进行区分的标记

mBuildInfo

protected IBuildInfo mBuildInfo

mCmdArgs

protected  mCmdArgs

mConfig

protected IConfiguration mConfig

mRootDir

protected String mRootDir

mRunUtil

protected IRunUtil mRunUtil

mTmpDir

protected File mTmpDir

公共构造函数

SubprocessTfLauncher

public SubprocessTfLauncher ()

公共方法

得分

public void run (TestInformation testInfo, 
                ITestInvocationListener listener)

运行测试并向监听器报告结果。

参数
testInfo TestInformation:包含运行测试的实用信息的 TestInformation 对象。

listener ITestInvocationListener:测试结果的 ITestInvocationListener

抛出
DeviceNotAvailableException

setBuild

public void setBuild (IBuildInfo buildInfo)

参数
buildInfo IBuildInfo

setConfiguration

public void setConfiguration (IConfiguration configuration)

注入正在使用的 IConfiguration

参数
configuration IConfiguration

setInvocationContext

public void setInvocationContext (IInvocationContext invocationContext)

参数
invocationContext IInvocationContext

受保护的方法

addJavaArguments

protected void addJavaArguments ( args)

允许向子进程调用添加额外的 Java 参数。

参数
args :我们需要向其添加额外参数的当前参数列表。

getJava

protected String getJava ()

返回
String

getRunUtil

protected IRunUtil getRunUtil ()

返回将用于子进程命令的 IRunUtil

返回
IRunUtil

postRun

protected void postRun (ITestInvocationListener listener, 
                boolean exception, 
                long elapsedTime)

TF 测试完成后要执行的操作。

参数
listener ITestInvocationListener:用于报告结果的原始 ITestInvocationListener

exception boolean:如果测试中引发了异常,则为 True。

elapsedTime long:运行测试所用的时间。

preRun

protected void preRun ()

运行测试前的设置。

setEventStreaming

protected void setEventStreaming (boolean eventStreaming)

设置 use-event-streaming。 公开以进行单元测试。

参数
eventStreaming boolean

setProtoReporting

protected void setProtoReporting (boolean protoReporting)

参数
protoReporting boolean

setRunUtil

protected void setRunUtil (IRunUtil runUtil)

设置 IRunUtil。 公开以进行单元测试。

参数
runUtil IRunUtil