IInvocationThực thi
public interface IInvocationExecution
com.android.tradefed.invoker.IInvocationExecution |
Giao diện mô tả các hành động sẽ được thực hiện như một phần của lệnh gọi. Bản thân lệnh gọi TestInvocation
đảm bảo thứ tự của các cuộc gọi.
Bản tóm tắt
Phương pháp công cộng | |
---|---|
default void | cleanUpBuilds ( IInvocationContext context, IConfiguration config) Thực hiện bước dọn dẹp build_provider. |
default void | doCleanUp ( IInvocationContext context, IConfiguration config, Throwable exception) Thực hiện bước dọn dẹp target_preparer và multi_target_preparer. |
default void | doSetup ( TestInformation testInfo, IConfiguration config, ITestLogger logger) Thực hiện bước thiết lập target_preparer và multi_target_preparer. |
default void | doTeardown ( TestInformation testInfo, IConfiguration config, ITestLogger logger, Throwable exception) Thực hiện bước phân tích target_preparer và multi_target_preparer. |
default boolean | fetchBuild ( TestInformation testInfo, IConfiguration config, IRescheduler rescheduler, ITestInvocationListener listener) Thực hiện bước build_provider của lệnh gọi. |
abstract 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 nhau của lệnh gọi. |
default void | runDevicePostInvocationTearDown ( IInvocationContext context, IConfiguration config, Throwable exception) Gọi |
default void | runDevicePreInvocationSetup ( IInvocationContext context, IConfiguration config, ITestLogger logger) Gọi |
default void | runTests ( TestInformation info, IConfiguration config, ITestInvocationListener listener) Chạy thử nghiệm. |
default boolean | shardConfig ( IConfiguration config, TestInformation testInfo, IRescheduler rescheduler, ITestLogger logger) Cố gắng phân chia cấu hình thành các cấu hình phụ để lên lịch lại để chạy song song trên nhiều tài nguyên. |
Phương pháp công cộng
dọn dẹpBuilds
public void cleanUpBuilds (IInvocationContext context, IConfiguration config)
Thực hiện bước dọn dẹp build_provider. Được liên kết với quá trình tìm nạp bản dựng.
Thông số | |
---|---|
context | IInvocationContext : IInvocationContext của lệnh gọi. |
config | IConfiguration : IConfiguration của lần chạy thử nghiệm này. |
doCleanUp
public void doCleanUp (IInvocationContext context, IConfiguration config, Throwable exception)
Thực hiện bước dọn dẹp target_preparer và multi_target_preparer. Các thiết bị có dọn dẹp không.
Thông số | |
---|---|
context | IInvocationContext : IInvocationContext của lệnh gọi. |
config | IConfiguration : IConfiguration của lần chạy thử nghiệm này. |
exception | Throwable : ngoại lệ ban đầu do quá trình chạy thử đưa ra. |
doSetup
public void doSetup (TestInformation testInfo, IConfiguration config, ITestLogger logger)
Thực hiện bước thiết lập target_preparer và multi_target_preparer. Có tất cả các thiết lập thiết bị cần thiết để chạy thử nghiệm hay không.
Thông số | |
---|---|
testInfo | TestInformation : TestInformation của lệnh gọi. |
config | IConfiguration : IConfiguration của lần chạy thử nghiệm này. |
logger | ITestLogger : ITestLogger để báo cáo nhật ký lỗi thiết lập. |
Ném | |
---|---|
| com.android.tradefed.targetprep.TargetSetupError |
| com.android.tradefed.targetprep.BuildError |
| com.android.tradefed.device.DeviceNotAvailableException |
BuildError | |
DeviceNotAvailableException | |
TargetSetupError |
doTeardown
public void doTeardown (TestInformation testInfo, IConfiguration config, ITestLogger logger, Throwable exception)
Thực hiện bước phân tích target_preparer và multi_target_preparer. Các thiết bị có bị hỏng liên quan đến quá trình thiết lập hay không.
Thông số | |
---|---|
testInfo | TestInformation : TestInformation của lệnh gọi. |
config | IConfiguration : IConfiguration của lần chạy thử nghiệm này. |
logger | ITestLogger : ITestLogger để báo cáo nhật ký. |
exception | Throwable : ngoại lệ ban đầu do quá trình chạy thử đưa ra. |
Ném | |
---|---|
| Có thể ném được |
tìm nạpBuild
public boolean fetchBuild (TestInformation testInfo, IConfiguration config, IRescheduler rescheduler, ITestInvocationListener listener)
Thực hiện bước build_provider của lệnh gọi.
Thông số | |
---|---|
testInfo | TestInformation : TestInformation của lệnh gọi. |
config | IConfiguration : IConfiguration của lần chạy thử nghiệm này. |
rescheduler | IRescheduler : IRescheduler , để sắp xếp 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. |
Trả lại | |
---|---|
boolean | Đúng nếu chúng tôi đã tải xuống bản dựng thành công, nếu không thì sai. |
Ném | |
---|---|
| com.android.tradefed.build.BuildRetrievalError |
| com.android.tradefed.device.DeviceNotAvailableException |
BuildRetrievalError | |
DeviceNotAvailableException |
báo cáoNhật ký
public abstract 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 nhau của lệnh gọi. Ví dụ: logcat.
Thông số | |
---|---|
device | ITestDevice : Thiết bị báo cáo nhật ký. |
logger | ITestLogger : Trình ghi 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ị của lệnh gọi.
Thông số | |
---|---|
context | IInvocationContext : IInvocationContext của lệnh gọi. |
config | IConfiguration : IConfiguration của lần chạy thử nghiệm này. |
exception | Throwable : ngoại lệ ban đầu do quá trình chạy thử nghiệm đưa 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ị của lệnh gọi.
Thông số | |
---|---|
context | IInvocationContext : IInvocationContext của lệnh gọi. |
config | IConfiguration : IConfiguration của lần chạy thử nghiệm này. |
logger | ITestLogger : ITestLogger để báo cáo nhật ký. |
Ném | |
---|---|
| com.android.tradefed.device.DeviceNotAvailableException |
| com.android.tradefed.targetprep.TargetSetupError |
DeviceNotAvailableException | |
TargetSetupError |
chạy thử nghiệm
public void runTests (TestInformation info, IConfiguration config, ITestInvocationListener listener)
Chạy thử nghiệm.
Thông số | |
---|---|
info | TestInformation : TestInformation để chạy thử nghiệm. |
config | IConfiguration : IConfiguration để chạy |
listener | ITestInvocationListener : ITestInvocationListener của kết quả kiểm tra |
Ném | |
---|---|
| Có thể ném được |
phân đoạnConfig
public boolean shardConfig (IConfiguration config, TestInformation testInfo, IRescheduler rescheduler, ITestLogger logger)
Cố gắng phân chia cấu hình thành các cấu hình phụ để lên lịch lại để chạy song song trên nhiều tài nguyên.
Nếu số lượng phân đoạn lớn hơn 1, nó sẽ chỉ tạo cấu hình cho từng phân đoạn bằng cách đặt chỉ mục phân đoạn và lên lịch lại cho chúng. Nếu số lượng phân đoạn không được đặt, nó sẽ chuyển sang IShardHelper#shardConfig
.
Thông số | |
---|---|
config | IConfiguration : IConfiguration hiện tại. |
testInfo | TestInformation : TestInformation chứa thông tin của các bài kiểm tra. |
rescheduler | IRescheduler : IRescheduler . |
logger | ITestLogger : ITestLogger được sử dụng để ghi nhật ký tệp trong quá trình phân chia. |
Trả lại | |
---|---|
boolean | đúng nếu bài kiểm tra bị phân chia. Ngược lại trả về false |