ModuleDefinition
public class ModuleDefinition
extends Object
implements ITestCollector
java.lang.Object | |
↳ | com.android.tradefed.testtype.suite.ModuleDefinition |
Vùng chứa cho 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 | 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 một 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
|
Các nhà xây dựng 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 pháp công khai | |
---|---|
int | compareTo ( ModuleDefinition moduleDef) |
String | getId () Trả lại 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 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ố |
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 bộ chuẩn bị của bài kiểm tra, bao gồm bộ 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 thập thử nghiệm |
void | setDevice ( ITestDevice device) Tiêm |
void | setEnableDynamicDownload (boolean enableDynamicDownload) Có bật tải xuống động ở cấp mô-đun hay không. |
void | setLogSaver ( ILogSaver logSaver) Chuyển trình tiết kiệm nhật ký lời gọi đến mô-đun để nó có thể sử dụng 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ộ |
Các phương pháp được bảo vệ | |
---|---|
boolean | hasTests () Trả về True nếu Mô-đun vẫn có |
Lĩnh vực
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 sẽ 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 một 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
Các nhà xây dựng công cộng
ModuleDefinition
public ModuleDefinition ()
ModuleDefinition
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 : cấu hình IConfiguration của cấu hình mô-đun bên dưới. |
ModuleDefinition
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 : cấu hình IConfiguration của cấu hình mô-đun bên dưới. |
Phương pháp công khai
so với
public int compareTo (ModuleDefinition moduleDef)
Thông số | |
---|---|
moduleDef | ModuleDefinition |
Lợi nhuận | |
---|---|
int |
getId
public String getId ()
Trả lại tên mô-đun duy nhất.
Lợi nhuận | |
---|---|
String |
getModuleInvocationContext
public IInvocationContext getModuleInvocationContext ()
Trả về IInvocationContext
liên kết với mô-đun.
Lợi nhuận | |
---|---|
IInvocationContext |
getRequiredTokens
publicgetRequiredTokens (TestInformation testInfo)
Thông số | |
---|---|
testInfo | TestInformation |
Lợi nhuận | |
---|---|
getRuntimeH Gợi ý
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.
Lợi nhuận | |
---|---|
long |
hasModuleFailed
public boolean hasModuleFailed ()
Trả về True nếu testRunFailure đã được gọi trên mô-đun *
Lợi nhuận | |
---|---|
boolean |
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.
Lợi nhuận | |
---|---|
int |
numTests
public int numTests ()
Trả về số IRemoteTest
hiện tại đang chờ được thực thi.
Lợi nhuận | |
---|---|
int |
reportNotExecuted
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 trình 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 nghe cụ thể để thu thập nhật ký trên testFail. Có thể là null. |
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 trình 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 nghe cụ thể để thu thập nhật ký trên testFail. Có thể là null. |
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 trình 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. |
run
public Throwable runPreparation (boolean includeSuitePreparers)
Chạy bộ chuẩn bị của bài kiểm tra, bao gồm bộ 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ộ. |
Lợi nhuận | |
---|---|
Throwable | Throwable bất kỳ ngoại lệ nào được nêu ra khi chạy người chuẩn bị. |
setBuild
public void setBuild (IBuildInfo build)
Tiêm IBuildInfo
sẽ được 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 thập thử nghiệm
setDevice
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ó bật tải xuống động ở cấp mô-đun hay không.
Thông số | |
---|---|
enableDynamicDownload | boolean |
setLogSaver
public void setLogSaver (ILogSaver logSaver)
Chuyển trình tiết kiệm nhật ký lời gọi đến mô-đun để nó có thể sử dụng 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 |
setMetricCollectors
public void setMetricCollectors (collectors)
Đưa vào Danh sách IMetricCollector
sẽ được sử dụng bởi mô-đun.
Thông số | |
---|---|
collectors |
setRetryDecision
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 ()
Lợi nhuận | |
---|---|
String |
transferSuiteLevelOptions
public void transferSuiteLevelOptions (IConfiguration mSuiteConfiguration)
Sao chép một vài cấu hình cấp bộ
Thông số | |
---|---|
mSuiteConfiguration | IConfiguration |
Các 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 khác.
Lợi nhuận | |
---|---|
boolean |