DelegatedInvocationExecution
public
class
DelegatedInvocationExecution
extends InvocationExecution
| java.lang.Object | ||
| ↳ | com.android.tradefed.invoker.InvocationExecution | |
| ↳ | com.android.tradefed.invoker.DelegatedInvocationExecution | |
InvocationExecution,將執行作業委派給另一個 Tradefed 二進位檔。
摘要
常數 | |
|---|---|
String |
DELEGATED_MODE_VAR
如果存在,則表示呼叫是在委派模式下執行 |
公用建構函式 | |
|---|---|
DelegatedInvocationExecution()
|
|
公用方法 | |
|---|---|
void
|
doCleanUp(IInvocationContext context, IConfiguration config, Throwable exception)
執行 target_preparer 和 multi_target_preparer 的清除步驟。 |
void
|
doSetup(TestInformation testInfo, IConfiguration config, ITestLogger listener)
執行 target_preparer 和 multi_target_preparer setUp 步驟。 |
void
|
doTeardown(TestInformation testInfo, IConfiguration config, ITestLogger logger, Throwable exception)
執行 target_preparer 和 multi_target_preparer 拆除步驟。 |
void
|
reportLogs(ITestDevice device, ITestLogger logger, TestInvocation.Stage stage)
在呼叫的不同階段回報部分裝置記錄。 |
void
|
runDevicePostInvocationTearDown(IInvocationContext context, IConfiguration config, Throwable exception)
針對叫用的每個裝置部分,叫用 |
void
|
runDevicePreInvocationSetup(IInvocationContext context, IConfiguration config, ITestLogger logger)
|
void
|
runTests(TestInformation info, IConfiguration config, ITestInvocationListener listener)
執行測試。 |
boolean
|
shardConfig(IConfiguration config, TestInformation testInfo, IRescheduler rescheduler, ITestLogger logger)
嘗試將設定分片為子設定,以便重新排程,在多個資源上平行執行。 |
常數
DELEGATED_MODE_VAR
public static final String DELEGATED_MODE_VAR
如果存在,則表示呼叫是在委派模式下執行
常數值: "DELEGATED_MODE"
公用建構函式
DelegatedInvocationExecution
public DelegatedInvocationExecution ()
公用方法
doCleanUp
public void doCleanUp (IInvocationContext context, IConfiguration config, Throwable exception)
執行 target_preparer 和 multi_target_preparer 的 cleanUp 步驟。裝置是否會清理。
| 參數 | |
|---|---|
context |
IInvocationContext:叫用的 IInvocationContext。 |
config |
IConfiguration:這次測試執行的 IConfiguration。 |
exception |
Throwable:測試執行時擲回的原始例外狀況。 |
doSetup
public void doSetup (TestInformation testInfo, IConfiguration config, ITestLogger listener)
執行 target_preparer 和 multi_target_preparer 的 setUp 步驟。設定測試所需的所有裝置。
| 參數 | |
|---|---|
testInfo |
TestInformation:叫用的 TestInformation。 |
config |
IConfiguration:這次測試執行的 IConfiguration。 |
listener |
ITestLogger:回報設定失敗記錄的 ITestLogger。 |
| 擲回 | |
|---|---|
BuildError |
|
DeviceNotAvailableException |
|
TargetSetupError |
|
doTeardown
public void doTeardown (TestInformation testInfo, IConfiguration config, ITestLogger logger, Throwable exception)
執行 target_preparer 和 multi_target_preparer 拆除步驟。是否拆除與設定相關聯的裝置。
| 參數 | |
|---|---|
testInfo |
TestInformation:叫用的 TestInformation。 |
config |
IConfiguration:這次測試執行的 IConfiguration。 |
logger |
ITestLogger:ITestLogger,用於回報記錄。 |
exception |
Throwable:測試執行時擲回的原始例外狀況。 |
reportLogs
public void reportLogs (ITestDevice device, ITestLogger logger, TestInvocation.Stage stage)
在呼叫的不同階段回報部分裝置記錄。例如:logcat。
| 參數 | |
|---|---|
device |
ITestDevice:要回報記錄的裝置。 |
logger |
ITestLogger:記錄的記錄器。 |
stage |
TestInvocation.Stage:我們目前處於的叫用階段。 |
runDevicePostInvocationTearDown
public void runDevicePostInvocationTearDown (IInvocationContext context, IConfiguration config, Throwable exception)
針對叫用的每個裝置部分,叫用 ITestDevice.postInvocationTearDown(Throwable)。
| 參數 | |
|---|---|
context |
IInvocationContext:叫用的 IInvocationContext。 |
config |
IConfiguration:這次測試執行的 IConfiguration。 |
exception |
Throwable:測試執行時擲回的原始例外狀況 (如有)。 |
runDevicePreInvocationSetup
public void runDevicePreInvocationSetup (IInvocationContext context, IConfiguration config, ITestLogger logger)
| 參數 | |
|---|---|
context |
IInvocationContext:叫用的 IInvocationContext。 |
config |
IConfiguration:這次測試執行的 IConfiguration。 |
logger |
ITestLogger:ITestLogger,用於回報記錄。 |
| 擲回 | |
|---|---|
DeviceNotAvailableException |
|
TargetSetupError |
|
runTests
public void runTests (TestInformation info, IConfiguration config, ITestInvocationListener listener)
執行測試。
| 參數 | |
|---|---|
info |
TestInformation:用於執行測試的 TestInformation。 |
config |
IConfiguration:要執行的 IConfiguration |
listener |
ITestInvocationListener:測試結果的 ITestInvocationListener |
shardConfig
public boolean shardConfig (IConfiguration config, TestInformation testInfo, IRescheduler rescheduler, ITestLogger logger)
嘗試將設定分片為子設定,以便重新排程,在多個資源上平行執行。
如果分片數大於 1,系統會設定分片索引並重新排程,為每個分片建立設定。如果未設定分片計數,系統會改用 IShardHelper.shardConfig。
| 參數 | |
|---|---|
config |
IConfiguration:目前的 IConfiguration。 |
testInfo |
TestInformation:TestInformation,其中包含測試資訊。 |
rescheduler |
IRescheduler:IRescheduler。 |
logger |
ITestLogger:用於在分片期間記錄檔案的 ITestLogger。 |
| 傳回 | |
|---|---|
boolean |
如果測試已分片,則為 true。否則傳回 false |