ParentSandboxInvocationExecution

public class ParentSandboxInvocationExecution
extends InvocationExecution

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


Phiên bản InvocationExecution cho các thao tác đặc biệt của lệnh gọi gốc khi chạy 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 cleanUp của target_preparer và multi_target_preparer.

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

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

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

Thực thi bước tháo dỡ 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ị ở các giai đoạn khác nhau của lệnh gọi.

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

Gọi ITestDevice.postInvocationTearDown(Throwable) cho từng phần thiết bị trong lệnh 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 thiết bị trong lệnh 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 để tạo cấu hình.

getLabPreparersToRun(IConfiguration config, String deviceName)

Truy xuất danh sách trình chuẩn bị phòng thí nghiệm để chạy trên thiết bị này.

IRunUtil getRunUtil()
getTargetPreparersToRun(IConfiguration config, String deviceName)

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

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

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

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

ParentSandboxInvocationExecution

public ParentSandboxInvocationExecution ()

Phương thức công khai

doCleanUp

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

Thực thi bước cleanUp của target_preparer và multi_target_preparer. Thiết bị có dọn dẹp không.

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 quá trình kiểm thử đang chạy gửi.

doSetup

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

Thực thi bước setUp target_preparer và multi_target_preparer. Tất cả các thiết bị có được thiết lập theo yêu cầu để chạy kiểm thử không.

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

doTeardown

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

Thực thi bước tháo dỡ target_preparer và multi_target_preparer. Các thiết bị có bị huỷ liên kết với chế độ thiết lập không.

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 do quá trình kiểm thử đang chạy gửi.

fetchBuild

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 để thực thi trên(các) tài nguyên khác

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

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

Gửi
BuildRetrievalError
DeviceNotAvailableException

reportLogs

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

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

Tham số
device ITestDevice: Thiết bị 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 thiết bị trong lệnh 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 quá trình kiểm thử đang chạy gửi ra (nếu có).

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 thiết bị trong lệnh 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

runTests

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 cần chạy

listener ITestInvocationListener: ITestInvocationListener của kết quả kiểm thử

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

getFactory

protected IConfigurationFactory getFactory ()

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

Giá trị trả về
IConfigurationFactory

getLabPreparersToRun

protected  getLabPreparersToRun (IConfiguration config, 
                String deviceName)

Truy xuất danh sách trình chuẩn bị phòng thí nghiệm để chạy trên thiết bị này.

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

Tham số
config IConfiguration

deviceName String

Giá trị trả về

getRunUtil

protected IRunUtil getRunUtil ()

Giá trị trả về
IRunUtil

getTargetPreparersToRun

protected  getTargetPreparersToRun (IConfiguration config, 
                String deviceName)

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

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

Tham số
config IConfiguration

deviceName String

Giá trị trả về

prepareAndRunSandbox

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

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

Tham số
info TestInformation

config IConfiguration

listener ITestInvocationListener

Trả về
boolean