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 清理步驟。

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)

針對ITestDevice#postInvocationTearDown(Throwable) 呼叫。

void runDevicePreInvocationSetup(IInvocationContext context, IConfiguration config, ITestLogger logger)

針對ERROR(ITestDevice#preInvocationSetup(IBuildInfo)/com.android.tradefed.device.ITestDevice#preInvocationSetup(com.android.tradefed.build.IBuildInfo) ITestDevice#preInvocationSetup(IBuildInfo)) 呼叫。

void runTests(TestInformation info, IConfiguration config, ITestInvocationListener listener)

執行測試。

保護方法

IConfigurationFactory getFactory()

傳回用於已建立設定的 IConfigurationFactory

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 清理步驟。裝置是否乾淨 上。

參數
context IInvocationContext:叫用的 IInvocationContext

config IConfiguration:這項測試執行的 IConfiguration

exception Throwable:測試執行時擲回的原始例外狀況。

設定

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

Teardown

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:測試執行時擲回的原始例外狀況。

擷取版本

public boolean fetchBuild (TestInformation testInfo, 
                IConfiguration config, 
                IRescheduler rescheduler, 
                ITestInvocationListener listener)

執行叫用的 build_provider 步驟。

參數
testInfo TestInformation:叫用的 TestInformation

config IConfiguration:這項測試執行的 IConfiguration

rescheduler IReschedulerIRescheduler,用於重新排程叫用的部分 對另一個資源執行

listener ITestInvocationListener:用來回報建構下載失敗的 ITestInvocation

傳回
boolean 如果已成功下載版本,則為「true」,否則傳回「false」。

擲回
BuildRetrievalError
DeviceNotAvailableException

報告記錄檔

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:測試執行時擲回的原始例外狀況 (如果有的話)。

runDevicePreInvocation 設定

public void runDevicePreInvocationSetup (IInvocationContext context, 
                IConfiguration config, 
                ITestLogger logger)

針對ERROR(ITestDevice#preInvocationSetup(IBuildInfo)/com.android.tradefed.device.ITestDevice#preInvocationSetup(com.android.tradefed.build.IBuildInfo) ITestDevice#preInvocationSetup(IBuildInfo)) 呼叫。

參數
context IInvocationContext:叫用的 IInvocationContext

config IConfiguration:這項測試執行的 IConfiguration

logger ITestLogger:用於回報記錄的 ITestLogger

擲回
DeviceNotAvailableException
TargetSetupError

執行測試

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

protected  getPreparersToRun (IConfiguration config, 
                String deviceName)

擷取要在這部裝置上執行的準備工具清單。

覆寫沙箱類別,限制研究室準備工具在沙箱中執行 孩子

參數
config IConfiguration

deviceName String

傳回

getRunUtil

protected IRunUtil getRunUtil ()

傳回
IRunUtil

準備執行沙箱

protected boolean prepareAndRunSandbox (TestInformation info, 
                IConfiguration config, 
                ITestInvocationListener listener)

傳回沙箱執行結果的狀態。

參數
info TestInformation

config IConfiguration

listener ITestInvocationListener

傳回
boolean