ParentSandboxInvocationExecution
public
class
ParentSandboxInvocationExecution
extends InvocationExecution
| java.lang.Object | ||
| ↳ | com.android.tradefed.invoker.InvocationExecution | |
| ↳ | com.android.tradefed.invoker.sandbox.ParentSandboxInvocationExecution | |
執行沙箱時,用於父項叫用特殊動作的 InvocationExecution 版本。
摘要
公用建構函式 | |
|---|---|
ParentSandboxInvocationExecution()
|
|
公用方法 | |
|---|---|
void
|
doCleanUp(IInvocationContext context, IConfiguration config, Throwable exception)
執行 target_preparer 和 multi_target_preparer 的 cleanUp 步驟。 |
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 的拆卸步驟。 |
boolean
|
fetchBuild(TestInformation testInfo, IConfiguration config, IRescheduler rescheduler, ITestInvocationListener listener)
執行叫用動作的 build_provider 步驟。 |
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)
執行測試。 |
受保護的方法 | |
|---|---|
IConfigurationFactory
|
getFactory()
會傳回用於建立設定的 |
|
getPreparersToRun(IConfiguration config, String deviceName)
擷取要在裝置上執行的預備作業清單。 |
IRunUtil
|
getRunUtil()
|
boolean
|
prepareAndRunSandbox(TestInformation info, IConfiguration config, ITestInvocationListener listener)
傳回執行沙箱的結果狀態。 |
公用建構函式
ParentSandboxInvocationExecution
public ParentSandboxInvocationExecution ()
公用方法
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:測試執行時擲回的原始例外狀況。 |
fetchBuild
public boolean fetchBuild (TestInformation testInfo,
IConfiguration config,
IRescheduler rescheduler,
ITestInvocationListener listener)執行叫用動作的 build_provider 步驟。
| 參數 | |
|---|---|
testInfo |
TestInformation:叫用作業的 TestInformation。 |
config |
IConfiguration:此測試執行作業的 IConfiguration。 |
rescheduler |
IRescheduler:IRescheduler,用於重新排定部分呼叫,以便在其他資源上執行 |
listener |
ITestInvocationListener:用於回報建構下載失敗的 ITestInvocation。 |
| 傳回 | |
|---|---|
boolean |
如果成功下載版本,則傳回 True,否則傳回 False。 |
| 擲回 | |
|---|---|
BuildRetrievalError |
|
DeviceNotAvailableException |
|
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 |
受保護的方法
getFactory
protected IConfigurationFactory getFactory ()
會傳回用於建立設定的 IConfigurationFactory。
| 傳回 | |
|---|---|
IConfigurationFactory |
|
getPreparersToRun
protectedgetPreparersToRun (IConfiguration config, String deviceName)
擷取要在裝置上執行的預備作業清單。
在沙箱類別中覆寫,限制研究室準備工具在沙箱子項中執行
| 參數 | |
|---|---|
config |
IConfiguration |
deviceName |
String |
| 傳回 | |
|---|---|
|
|
getRunUtil
protected IRunUtil getRunUtil ()
| 傳回 | |
|---|---|
IRunUtil |
|
prepareAndRunSandbox
protected boolean prepareAndRunSandbox (TestInformation info,
IConfiguration config,
ITestInvocationListener listener)傳回執行沙箱的結果狀態。
| 參數 | |
|---|---|
info |
TestInformation |
config |
IConfiguration |
listener |
ITestInvocationListener |
| 傳回 | |
|---|---|
boolean |
|