SubprocessTfLauncher

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

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


Một IRemoteTest để chạy các kiểm thử trên một bản cài đặt TF riêng biệt.

Khởi chạy một quy trình java bên ngoài để chạy các bài kiểm thử. Được dùng để chạy liên tục các kiểm thử đơn vị hoặc kiểm thử chức năng TF.

Tóm tắt

Hằng số

String ANDROID_SERIAL_VAR

Env.

String PARENT_PROC_TAG_NAME

String SUBPROCESS_TAG_NAME

Thẻ sẽ được truyền đến quy trình con TF để phân biệt thẻ đó

Trường

protected IBuildInfo mBuildInfo

protected mCmdArgs

protected IConfiguration mConfig

protected String mRootDir

protected IRunUtil mRunUtil

protected File mTmpDir

Hàm khởi tạo công khai

SubprocessTfLauncher()

Phương thức công khai

void run(TestInformation testInfo, ITestInvocationListener listener)

Chạy các bài kiểm thử và báo cáo kết quả cho trình nghe.

void setBuild(IBuildInfo buildInfo)

void setConfiguration(IConfiguration configuration)

Chèn IConfiguration đang dùng.

void setInvocationContext(IInvocationContext invocationContext)

Phương thức được bảo vệ

void addJavaArguments( args)

Cho phép thêm các tham số java bổ sung vào lệnh gọi quy trình con.

String getJava()
IRunUtil getRunUtil()

Trả về IRunUtil sẽ được dùng cho lệnh quy trình con.

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

Những việc cần làm sau khi kiểm thử trên TF hoàn tất.

void preRun()

Thiết lập trước khi chạy kiểm thử.

void setEventStreaming(boolean eventStreaming)

Đặt use-event-streaming.

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

Đặt IRunUtil.

Hằng số

ANDROID_SERIAL_VAR

public static final String ANDROID_SERIAL_VAR

Biến môi trường ảnh hưởng đến lựa chọn adb.

Giá trị không đổi: "ANDROID_SERIAL"

PARENT_PROC_TAG_NAME

public static final String PARENT_PROC_TAG_NAME

Giá trị không đổi: "parentprocess"

SUBPROCESS_TAG_NAME

public static final String SUBPROCESS_TAG_NAME

Thẻ sẽ được truyền đến quy trình con TF để phân biệt quy trình con đó

Giá trị không đổi: "subprocess"

Trường

mBuildInfo

protected IBuildInfo mBuildInfo

mCmdArgs

protected  mCmdArgs

mConfig

protected IConfiguration mConfig

mRootDir

protected String mRootDir

mRunUtil

protected IRunUtil mRunUtil

mTmpDir

protected File mTmpDir

Hàm khởi tạo công khai

SubprocessTfLauncher

public SubprocessTfLauncher ()

Phương thức công khai

chạy

public void run (TestInformation testInfo, 
                ITestInvocationListener listener)

Chạy các bài kiểm thử và báo cáo kết quả cho trình nghe.

Tham số
testInfo TestInformation: Đối tượng TestInformation chứa thông tin hữu ích để chạy các bài kiểm thử.

listener ITestInvocationListener: ITestInvocationListener kết quả kiểm tra

Gửi
DeviceNotAvailableException

setBuild

public void setBuild (IBuildInfo buildInfo)

Tham số
buildInfo IBuildInfo

setConfiguration

public void setConfiguration (IConfiguration configuration)

Chèn IConfiguration đang dùng.

Tham số
configuration IConfiguration

setInvocationContext

public void setInvocationContext (IInvocationContext invocationContext)

Tham số
invocationContext IInvocationContext

Phương thức được bảo vệ

addJavaArguments

protected void addJavaArguments ( args)

Cho phép thêm các tham số java bổ sung vào lệnh gọi quy trình con.

Tham số
args : danh sách đối số hiện tại mà chúng ta cần thêm các đối số bổ sung.

getJava

protected String getJava ()

Giá trị trả về
String

getRunUtil

protected IRunUtil getRunUtil ()

Trả về IRunUtil sẽ được dùng cho lệnh quy trình con.

Giá trị trả về
IRunUtil

postRun

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

Những việc cần làm sau khi kiểm thử trên TF hoàn tất.

Tham số
listener ITestInvocationListener: ITestInvocationListener ban đầu nơi báo cáo kết quả.

exception boolean: True nếu ngoại lệ được đưa ra trong quá trình kiểm thử.

elapsedTime long: thời gian chạy các kiểm thử.

preRun

protected void preRun ()

Thiết lập trước khi chạy kiểm thử.

setEventStreaming

protected void setEventStreaming (boolean eventStreaming)

Đặt use-event-streaming. Được hiển thị để kiểm thử đơn vị.

Tham số
eventStreaming boolean

setProtoReporting

protected void setProtoReporting (boolean protoReporting)

Tham số
protoReporting boolean

setRunUtil

protected void setRunUtil (IRunUtil runUtil)

Đặt IRunUtil. Được hiển thị để kiểm thử đơn vị.

Tham số
runUtil IRunUtil