mô-đunĐịnh nghĩa
public class ModuleDefinition
extends Object
implements ITestCollector
java.lang.Object | |
↳ | com.android.tradefed.testtype.suite.ModuleDefinition |
Vùng chứa cấu hình chạy thử nghiệm. Lớp này là một người trợ giúp để chuẩn bị và chạy các bài kiểm tra.
Bản tóm tắt
Lĩnh vực | |
---|---|
public static final String | ISOLATION_COST |
public static final String | MODULE_ABI |
public static final String | MODULE_CONTROLLER |
public static final String | MODULE_EXTERNAL_DEPENDENCIES |
public static final String | MODULE_ID ID mô-đun tên sẽ được sử dụng để xác định duy nhất mô-đun trong quá trình testRunStart. |
public static final String | MODULE_ISOLATED Thuộc tính này được đặt thành true nếu mô-đun đang chạy trên thiết bị mới được chuẩn bị. |
public static final String | MODULE_NAME Tên mô-đun là tên cơ sở được liên kết với mô-đun, thường đến từ tệp cấu hình Xml TF mà mô-đun được tải từ đó. |
public static final String | MODULE_PARAMETERIZATION |
public static final String | MODULE_TEST_COUNT |
public static final String | PREPARATION_TIME |
public static final String | RETRY_FAIL_COUNT |
public static final String | RETRY_SUCCESS_COUNT |
public static final String | RETRY_TIME |
public static final String | TEAR_DOWN_TIME |
public static final String | TEST_TIME
|
nhà thầu công cộng | |
---|---|
ModuleDefinition () | |
ModuleDefinition (String name, tests, preparersPerDevice, multiPreparers, IConfiguration moduleConfig) ModuleDefinition (String name, tests, preparersPerDevice, multiPreparers, IConfiguration moduleConfig) ModuleDefinition (String name, tests, preparersPerDevice, multiPreparers, IConfiguration moduleConfig) ModuleDefinition (String name, tests, preparersPerDevice, multiPreparers, IConfiguration moduleConfig) Người xây dựng | |
ModuleDefinition (String name, tests, preparersPerDevice, suitePreparersPerDevice, multiPreparers, IConfiguration moduleConfig) ModuleDefinition (String name, tests, preparersPerDevice, suitePreparersPerDevice, multiPreparers, IConfiguration moduleConfig) ModuleDefinition (String name, tests, preparersPerDevice, suitePreparersPerDevice, multiPreparers, IConfiguration moduleConfig) ModuleDefinition (String name, tests, preparersPerDevice, suitePreparersPerDevice, multiPreparers, IConfiguration moduleConfig) ModuleDefinition (String name, tests, preparersPerDevice, suitePreparersPerDevice, multiPreparers, IConfiguration moduleConfig) Người xây dựng |
Phương thức công khai | |
---|---|
int | compareTo ( ModuleDefinition moduleDef) |
String | getId () Trả về tên mô-đun duy nhất. |
IConfiguration | getModuleConfiguration () |
IInvocationContext | getModuleInvocationContext () Trả về |
getRequiredTokens ( TestInformation testInfo) | |
long | getRuntimeHint () Trả về thời gian gần đúng để chạy tất cả các bài kiểm tra trong mô-đun. |
boolean | hasModuleFailed () Trả về True nếu một testRunFailure đã được gọi trên mô-đun * |
int | neededDevices () Trả về số lượng thiết bị dự kiến sẽ chạy thử nghiệm này. |
int | numTests () Trả về số lượng |
final void | reportNotExecuted ( ITestInvocationListener listener, String message) Báo cáo các mô-đun hoàn toàn không được thực thi. |
final void | run ( TestInformation moduleInfo, ITestInvocationListener listener, moduleLevelListeners, TestFailureListener failureListener, int maxRunLimit) run ( TestInformation moduleInfo, ITestInvocationListener listener, moduleLevelListeners, TestFailureListener failureListener, int maxRunLimit) Chạy tất cả |
final void | run ( TestInformation moduleInfo, ITestInvocationListener listener, moduleLevelListeners, TestFailureListener failureListener) run ( TestInformation moduleInfo, ITestInvocationListener listener, moduleLevelListeners, TestFailureListener failureListener) Chạy tất cả |
final void | run ( TestInformation moduleInfo, ITestInvocationListener listener) Chạy tất cả |
Throwable | runPreparation (boolean includeSuitePreparers) Chạy trình chuẩn bị thử nghiệm, bao gồm cả trình chuẩn bị cấp bộ nếu được chỉ định. |
void | setBuild ( IBuildInfo build) Tiêm |
void | setCollectTestsOnly (boolean collectTestsOnly) Bật hoặc tắt chế độ thu bài kiểm tra |
void | setDevice ( ITestDevice device) Tiêm |
void | setEnableDynamicDownload (boolean enableDynamicDownload) Có hay không kích hoạt tải xuống động ở cấp độ mô-đun. |
void | setLogSaver ( ILogSaver logSaver) Truyền trình bảo vệ nhật ký lệnh gọi cho mô-đun để mô-đun có thể sử dụng nó nếu cần. |
final void | setMergeAttemps (boolean mergeAttempts) Đặt xem chúng ta có nên hợp nhất các kết quả hay không. |
void | setMetricCollectors ( collectors) setMetricCollectors ( collectors) Đưa vào Danh sách |
final void | setRetryDecision ( IRetryDecision decision) Đặt |
String | toString () |
void | transferSuiteLevelOptions ( IConfiguration mSuiteConfiguration) Sao chép một vài cấu hình cấp bộ |
phương pháp được bảo vệ | |
---|---|
boolean | hasTests () Trả về True nếu Mô-đun vẫn có |
Lĩnh vực
ISOLATION_COST
public static final String ISOLATION_COST
MODULE_ABI
public static final String MODULE_ABI
MODULE_CONTROLLER
public static final String MODULE_CONTROLLER
MODULE_EXTERNAL_DEPENDENCIES
public static final String MODULE_EXTERNAL_DEPENDENCIES
MODULE_ID
public static final String MODULE_ID
ID mô-đun tên sẽ được sử dụng để xác định duy nhất mô-đun trong quá trình testRunStart. Nó thường là sự kết hợp của MODULE_ABI + MODULE_NAME.
MODULE_ISOLATED
public static final String MODULE_ISOLATED
Thuộc tính này được đặt thành true nếu mô-đun đang chạy trên thiết bị mới được chuẩn bị.
MODULE_NAME
public static final String MODULE_NAME
Tên mô-đun là tên cơ sở được liên kết với mô-đun, thường đến từ tệp cấu hình Xml TF mà mô-đun được tải từ đó.
MODULE_PARAMETERIZATION
public static final String MODULE_PARAMETERIZATION
MODULE_TEST_COUNT
public static final String MODULE_TEST_COUNT
THỜI GIAN CHUẨN BỊ
public static final String PREPARATION_TIME
RETRY_FAIL_COUNT
public static final String RETRY_FAIL_COUNT
RETRY_SUCCESS_COUNT
public static final String RETRY_SUCCESS_COUNT
RETRY_TIME
public static final String RETRY_TIME
TEAR_DOWN_TIME
public static final String TEAR_DOWN_TIME
TEST_TIME
public static final String TEST_TIME
nhà thầu công cộng
mô-đunĐịnh nghĩa
public ModuleDefinition ()
mô-đunĐịnh nghĩa
public ModuleDefinition (String name,tests, preparersPerDevice, multiPreparers, IConfiguration moduleConfig)
Người xây dựng
Thông số | |
---|---|
name | String : tên duy nhất của cấu hình thử nghiệm. |
tests | IRemoteTest cần chạy. |
preparersPerDevice | ITargetPreparer sẽ được sử dụng để thiết lập thiết bị. |
multiPreparers | |
moduleConfig | IConfiguration : IConfiguration của cấu hình mô-đun bên dưới. |
mô-đunĐịnh nghĩa
public ModuleDefinition (String name,tests, preparersPerDevice, suitePreparersPerDevice, multiPreparers, IConfiguration moduleConfig)
Người xây dựng
Thông số | |
---|---|
name | String : tên duy nhất của cấu hình thử nghiệm. |
tests | IRemoteTest cần chạy. |
preparersPerDevice | ITargetPreparer sẽ được sử dụng để thiết lập thiết bị. |
suitePreparersPerDevice | |
multiPreparers | |
moduleConfig | IConfiguration : IConfiguration của cấu hình mô-đun bên dưới. |
Phương thức công khai
so với
public int compareTo (ModuleDefinition moduleDef)
Thông số | |
---|---|
moduleDef | ModuleDefinition |
trả lại | |
---|---|
int |
getId
public String getId ()
Trả về tên mô-đun duy nhất.
trả lại | |
---|---|
String |
getModuleInvocationContext
public IInvocationContext getModuleInvocationContext ()
Trả về IInvocationContext
được liên kết với mô-đun.
trả lại | |
---|---|
IInvocationContext |
getRequiredTokens
publicgetRequiredTokens (TestInformation testInfo)
Thông số | |
---|---|
testInfo | TestInformation |
trả lại | |
---|---|
getRuntimeHint
public long getRuntimeHint ()
Trả về thời gian gần đúng để chạy tất cả các bài kiểm tra trong mô-đun.
trả lại | |
---|---|
long |
hasModuleThất bại
public boolean hasModuleFailed ()
Trả về True nếu một testRunFailure đã được gọi trên mô-đun *
trả lại | |
---|---|
boolean |
thiết bị cần thiết
public int neededDevices ()
Trả về số lượng thiết bị dự kiến sẽ chạy thử nghiệm này.
trả lại | |
---|---|
int |
numTests
public int numTests ()
Trả về số lượng IRemoteTest
hiện tại đang chờ được thực thi.
trả lại | |
---|---|
int |
báo cáoChưa thực hiện
public final void reportNotExecuted (ITestInvocationListener listener, String message)
Báo cáo các mô-đun hoàn toàn không được thực thi.
Thông số | |
---|---|
listener | ITestInvocationListener |
message | String |
chạy
public final void run (TestInformation moduleInfo, ITestInvocationListener listener,moduleLevelListeners, TestFailureListener failureListener, int maxRunLimit)
Chạy tất cả IRemoteTest
có trong mô-đun và sử dụng tất cả các công cụ chuẩn bị trước và sau để thiết lập và làm sạch thiết bị.
Thông số | |
---|---|
moduleInfo | TestInformation : TestInformation cho mô-đun. |
listener | ITestInvocationListener : ITestInvocationListener nơi báo cáo kết quả. |
moduleLevelListeners | |
failureListener | TestFailureListener : một trình lắng nghe cụ thể để thu thập nhật ký trên testFail. Có thể là vô giá trị. |
maxRunLimit | int : số lần chạy tối đa cho mỗi testcase. |
ném | |
---|---|
DeviceNotAvailableException | trong trường hợp thiết bị ngoại tuyến. |
chạy
public final void run (TestInformation moduleInfo, ITestInvocationListener listener,moduleLevelListeners, TestFailureListener failureListener)
Chạy tất cả IRemoteTest
có trong mô-đun và sử dụng tất cả các công cụ chuẩn bị trước và sau để thiết lập và làm sạch thiết bị.
Thông số | |
---|---|
moduleInfo | TestInformation |
listener | ITestInvocationListener : ITestInvocationListener nơi báo cáo kết quả. |
moduleLevelListeners | |
failureListener | TestFailureListener : một trình lắng nghe cụ thể để thu thập nhật ký trên testFail. Có thể là vô giá trị. |
ném | |
---|---|
DeviceNotAvailableException | trong trường hợp thiết bị ngoại tuyến. |
chạy
public final void run (TestInformation moduleInfo, ITestInvocationListener listener)
Chạy tất cả IRemoteTest
có trong mô-đun và sử dụng tất cả các công cụ chuẩn bị trước và sau để thiết lập và làm sạch thiết bị.
Thông số | |
---|---|
moduleInfo | TestInformation |
listener | ITestInvocationListener : ITestInvocationListener nơi báo cáo kết quả. |
ném | |
---|---|
DeviceNotAvailableException | trong trường hợp thiết bị ngoại tuyến. |
chuẩn bị chạy
public Throwable runPreparation (boolean includeSuitePreparers)
Chạy trình chuẩn bị thử nghiệm, bao gồm cả trình chuẩn bị cấp bộ nếu được chỉ định.
Thông số | |
---|---|
includeSuitePreparers | boolean : Đặt thành true để cũng chạy trình chuẩn bị cấp bộ. |
trả lại | |
---|---|
Throwable | ERROR(/Throwable) của bất kỳ ngoại lệ nào được đưa ra khi chạy trình chuẩn bị. |
thiết lậpBuild
public void setBuild (IBuildInfo build)
Tiêm IBuildInfo
để sử dụng trong quá trình kiểm tra.
Thông số | |
---|---|
build | IBuildInfo |
setCollectTestsOnly
public void setCollectTestsOnly (boolean collectTestsOnly)
Bật hoặc tắt chế độ thu bài kiểm tra
thiết bị
public void setDevice (ITestDevice device)
Tiêm ITestDevice
sẽ được sử dụng trong quá trình kiểm tra.
Thông số | |
---|---|
device | ITestDevice |
setEnableDynamicDownload
public void setEnableDynamicDownload (boolean enableDynamicDownload)
Có hay không kích hoạt tải xuống động ở cấp độ mô-đun.
Thông số | |
---|---|
enableDynamicDownload | boolean |
setLogSaver
public void setLogSaver (ILogSaver logSaver)
Truyền trình bảo vệ nhật ký lệnh gọi cho mô-đun để mô-đun có thể sử dụng nó nếu cần.
Thông số | |
---|---|
logSaver | ILogSaver |
setMergeAttemps
public final void setMergeAttemps (boolean mergeAttempts)
Đặt xem chúng ta có nên hợp nhất các kết quả hay không.
Thông số | |
---|---|
mergeAttempts | boolean |
setMetricCollector
public void setMetricCollectors (collectors)
Đưa vào Danh sách IMetricCollector
sẽ được mô-đun sử dụng.
Thông số | |
---|---|
collectors |
setRetryQuyết định
public final void setRetryDecision (IRetryDecision decision)
Đặt IRetryDecision
được sử dụng để thử lại trong mô-đun.
Thông số | |
---|---|
decision | IRetryDecision |
toString
public String toString ()
trả lại | |
---|---|
String |
chuyểnSuiteLevelTùy chọn
public void transferSuiteLevelOptions (IConfiguration mSuiteConfiguration)
Sao chép một vài cấu hình cấp bộ
Thông số | |
---|---|
mSuiteConfiguration | IConfiguration |
phương pháp được bảo vệ
hasTests
protected boolean hasTests ()
Trả về True nếu Mô-đun vẫn có IRemoteTest
để chạy trong nhóm của nó. Sai nếu không.
trả lại | |
---|---|
boolean |