IIncallThực hiện

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ời gọi. Bản thân lệnh gọi TestInvocation đảm bảo thứ tự của các lệnh gọi.

Bản tóm tắt

Phương thức công khai

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 chia nhỏ 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ời 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ị ở các giai đoạn khác nhau của lệnh gọi.

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

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

default 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.

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ụ, được lên lịch lại để chạy song song trên nhiều tài nguyên.

Phương thức công khai

cleanUpBuilds

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ời gọi.

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

làmCleanUp

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ời gọi.

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

exception Throwable : ngoại lệ ban đầu được ném ra bởi quá trình chạy thử nghiệm.

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. Tất cả thiết lập thiết bị cần thiết để chạy thử nghiệm.

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 chia nhỏ target_preparer và multi_target_preparer. Các thiết bị có bị hỏng liên quan đến thiết lập 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 được ném ra bởi quá trình chạy thử nghiệm.

ném
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ời 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 , để 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.

trả lại
boolean Đúng nếu chúng tôi đã tải xuống bản dựng thành công, sai nếu không.

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ị ở các 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 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ời gọi.

Thông số
context IInvocationContext : IInvocationContext của lời gọi.

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

exception Throwable : ngoại lệ ban đầu được đưa ra bởi thử nghiệm đang chạy 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ời 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
Ném được

shardConfig

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ụ, được 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, thì nó sẽ chỉ tạo cấu hình cho từng phân đoạn bằng cách đặt các chỉ số 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ẽ dự phòng thành 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 bảo vệ.

trả lại
boolean đúng nếu thử nghiệm đã được phân đoạn. Nếu không thì trả về false