子進程TfLauncher

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

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) addJavaArguments ( args)

允許向子進程調用添加額外的 java 參數。

IRunUtil getRunUtil ()

返回將用於子進程命令的IRunUtil

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

TF 測試完成後要執行的操作。

void preRun ()

運行測試前的設置。

void setEventStreaming (boolean eventStreaming)

設置使用事件流。

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

配置文件

protected IConfiguration mConfig

根目錄

protected String mRootDir

運行工具

protected IRunUtil mRunUtil

mTmp目錄

protected File mTmpDir

公共構造函數

子進程TfLauncher

public SubprocessTfLauncher ()

公共方法

跑步

public void run (TestInformation testInfo, 
                ITestInvocationListener listener)

運行測試,並將結果報告給偵聽器。

參數
testInfo TestInformation :包含運行測試的有用信息的TestInformation對象。

listener ITestInvocationListener : 測試結果的ITestInvocationListener

投擲
DeviceNotAvailableException

設置構建

public void setBuild (IBuildInfo buildInfo)

參數
buildInfo IBuildInfo

設置配置

public void setConfiguration (IConfiguration configuration)

注入正在使用的IConfiguration

參數
configuration IConfiguration

設置調用上下文

public void setInvocationContext (IInvocationContext invocationContext)

參數
invocationContext IInvocationContext

受保護的方法

添加Java參數

protected void addJavaArguments ( args)

允許向子進程調用添加額外的 java 參數。

參數
args :我們需要添加額外參數的當前參數列表。

getRunUtil

protected IRunUtil getRunUtil ()

返回將用於子進程命令的IRunUtil

退貨
IRunUtil

運行後

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

TF 測試完成後要執行的操作。

參數
listener ITestInvocationListener :報告結果的原始ITestInvocationListener

exception boolean :如果在測試中引發異常則為真。

elapsedTime long :運行測試所花費的時間。

預運行

protected void preRun ()

運行測試前的設置。

設置事件流

protected void setEventStreaming (boolean eventStreaming)

設置使用事件流。公開進行單元測試。

參數
eventStreaming boolean

設置運行工具

protected void setRunUtil (IRunUtil runUtil)

設置 IRunUtil。公開進行單元測試。

參數
runUtil IRunUtil