Thực thi hộp cát mẹ

public class ParentSandboxInvocationExecution
extends InvocationExecution

java.lang.Object
   ↳ com.android.tradefed.Callbackr.InvocationExecution
     ↳ com.android.tradefed.Callbackr.sandbox.ParentSandboxInvocationExecution


Phiên bản của InvocationExecution cho các thao tác đặc biệt của lệnh gọi mẹ khi chạy một hộp cát.

Tóm tắt

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

ParentSandboxInvocationExecution()

Phương thức công khai

void doCleanUp(IInvocationContext context, IConfiguration config, Throwable exception)

Thực thi bước target_preparer và multi_target_preparer làm sạch.

void doSetup(TestInformation testInfo, IConfiguration config, ITestLogger listener)

Thực thi bước target_preparer và multi_target_preparer setUp.

void doTeardown(TestInformation testInfo, IConfiguration config, ITestLogger logger, Throwable exception)

Thực thi bước phân tách target_preparer và multi_target_preparer.

boolean fetchBuild(TestInformation testInfo, IConfiguration config, IRescheduler rescheduler, ITestInvocationListener listener)

Thực thi bước build_provider của lệnh gọi.

void reportLogs(ITestDevice device, ITestLogger logger, TestInvocation.Stage stage)

Báo cáo một số nhật ký thiết bị ở giai đoạn khác của lệnh gọi.

void runDevicePostInvocationTearDown(IInvocationContext context, IConfiguration config, Throwable exception)

Gọi ITestDevice#postInvocationTearDown(Throwable) cho từng phần của thiết bị lời gọi.

void runDevicePreInvocationSetup(IInvocationContext context, IConfiguration config, ITestLogger logger)

Gọi ERROR(ITestDevice#preInvocationSetup(IBuildInfo)/com.android.tradefed.device.ITestDevice#preInvocationSetup(com.android.tradefed.build.IBuildInfo) ITestDevice#preInvocationSetup(IBuildInfo)) cho từng phần của thiết bị lời gọi.

void runTests(TestInformation info, IConfiguration config, ITestInvocationListener listener)

Chạy kiểm thử.

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

IConfigurationFactory getFactory()

Trả về IConfigurationFactory dùng cho các cấu hình đã tạo.

getPreparersToRun(IConfiguration config, String deviceName)

Truy xuất danh sách trình chuẩn bị để chạy trên thiết bị này.

IRunUtil getRunUtil()
boolean prepareAndRunSandbox(TestInformation info, IConfiguration config, ITestInvocationListener listener)

Trả về trạng thái kết quả khi chạy hộp cát.

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

Thực thi hộp cát mẹ

public ParentSandboxInvocationExecution ()

Phương thức công khai

làm sạch

public void doCleanUp (IInvocationContext context, 
                IConfiguration config, 
                Throwable exception)

Thực thi bước target_preparer và multi_target_preparer làm sạch. Thiết bị có sạch không lên.

Tham số
context IInvocationContext: IInvocationContext của lệnh gọi.

config IConfiguration: IConfiguration của lần chạy kiểm thử này.

exception Throwable: ngoại lệ ban đầu được gửi bởi hoạt động kiểm thử đang chạy.

doSetup

public void doSetup (TestInformation testInfo, 
                IConfiguration config, 
                ITestLogger listener)

Thực thi bước target_preparer và multi_target_preparer setUp. Đã thiết lập xong tất cả các thiết bị cần thiết để chạy kiểm thử.

Tham số
testInfo TestInformation: TestInformation của lệnh gọi.

config IConfiguration: IConfiguration của lần chạy kiểm thử này.

listener ITestLogger: ITestLogger để báo cáo nhật ký lỗi thiết lập.

Gửi
BuildError
DeviceNotAvailableException
TargetSetupError

xé hình

public void doTeardown (TestInformation testInfo, 
                IConfiguration config, 
                ITestLogger logger, 
                Throwable exception)

Thực thi bước phân tách target_preparer và multi_target_preparer. Thiết bị có bị rách không liên quan đến quá trình thiết lập.

Tham số
testInfo TestInformation: TestInformation của lệnh gọi.

config IConfiguration: IConfiguration của lần chạy kiểm thử này.

logger ITestLogger: ITestLogger để báo cáo nhật ký.

exception Throwable: ngoại lệ ban đầu được gửi bởi hoạt động kiểm thử đang chạy.

tìm nạp bản dựng

public boolean fetchBuild (TestInformation testInfo, 
                IConfiguration config, 
                IRescheduler rescheduler, 
                ITestInvocationListener listener)

Thực thi bước build_provider của lệnh gọi.

Tham số
testInfo TestInformation: TestInformation của lệnh gọi.

config IConfiguration: IConfiguration của lần chạy kiểm thử này.

rescheduler IRescheduler: IRescheduler để lên lịch lại các phần của lệnh gọi cho thực thi trên(các) tài nguyên khác

listener ITestInvocationListener: ITestInvocation để báo cáo lỗi tải bản dựng xuống.

Giá trị trả về
boolean "True" nếu chúng ta tải bản dựng xuống thành công, nếu không thì sẽ trả về false.

Gửi
BuildRetrievalError
DeviceNotAvailableException

nhật ký báo cáo

public void reportLogs (ITestDevice device, 
                ITestLogger logger, 
                TestInvocation.Stage stage)

Báo cáo một số nhật ký thiết bị ở giai đoạn khác của lệnh gọi. Ví dụ: logcat.

Tham số
device ITestDevice: Thiết bị dùng để báo cáo nhật ký.

logger ITestLogger: Trình ghi nhật ký cho nhật ký.

stage TestInvocation.Stage: Giai đoạn của lệnh gọi mà chúng ta đang ở.

runDevicePostInvocationTearDown

public void runDevicePostInvocationTearDown (IInvocationContext context, 
                IConfiguration config, 
                Throwable exception)

Gọi ITestDevice#postInvocationTearDown(Throwable) cho từng phần của thiết bị lời gọi.

Tham số
context IInvocationContext: IInvocationContext của lệnh gọi.

config IConfiguration: IConfiguration của lần chạy kiểm thử này.

exception Throwable: ngoại lệ ban đầu do chương trình kiểm thử chạy (nếu có) gửi.

runDevicePreInvocationSetup

public void runDevicePreInvocationSetup (IInvocationContext context, 
                IConfiguration config, 
                ITestLogger logger)

Gọi ERROR(ITestDevice#preInvocationSetup(IBuildInfo)/com.android.tradefed.device.ITestDevice#preInvocationSetup(com.android.tradefed.build.IBuildInfo) ITestDevice#preInvocationSetup(IBuildInfo)) cho từng phần của thiết bị lời gọi.

Tham số
context IInvocationContext: IInvocationContext của lệnh gọi.

config IConfiguration: IConfiguration của lần chạy kiểm thử này.

logger ITestLogger: ITestLogger để báo cáo nhật ký.

Gửi
DeviceNotAvailableException
TargetSetupError

runTest

public void runTests (TestInformation info, 
                IConfiguration config, 
                ITestInvocationListener listener)

Chạy kiểm thử.

Tham số
info TestInformation: TestInformation để chạy kiểm thử.

config IConfiguration: IConfiguration để chạy

listener ITestInvocationListener: ITestInvocationListener của kết quả thử nghiệm

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

getFactory

protected IConfigurationFactory getFactory ()

Trả về IConfigurationFactory dùng cho các cấu hình đã tạo.

Giá trị trả về
IConfigurationFactory

chuẩn bị để chạy

protected  getPreparersToRun (IConfiguration config, 
                String deviceName)

Truy xuất danh sách trình chuẩn bị để chạy trên thiết bị này.

Bị ghi đè trong các lớp hộp cát để hạn chế các trình chuẩn bị của phòng thí nghiệm chạy bên trong hộp cát trẻ

Tham số
config IConfiguration

deviceName String

Giá trị trả về

getRunUtil

protected IRunUtil getRunUtil ()

Giá trị trả về
IRunUtil

chuẩn bị và chạy Hộp cát

protected boolean prepareAndRunSandbox (TestInformation info, 
                IConfiguration config, 
                ITestInvocationListener listener)

Trả về trạng thái kết quả khi chạy hộp cát.

Tham số
info TestInformation

config IConfiguration

listener ITestInvocationListener

Trả về
boolean