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 設置步驟。

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

getLabPreparersToRun ( IConfiguration config, String deviceName)

檢索要在此設備上運行的實驗室準備者列表。

IRunUtil getRunUtil ()
getTargetPreparersToRun ( IConfiguration config, String deviceName)

檢索要在此設備上運行的目標準備程序列表。

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

返回運行沙箱的結果狀態。

公共構造函數

ParentSandboxInvocationExecution

public ParentSandboxInvocationExecution ()

公共方法

清理

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 設置步驟。是否設置了測試運行所需的所有設備。

參數
testInfo TestInformation :調用的TestInformation

config IConfiguration :本次測試運行的IConfiguration

listener ITestLogger :用於報告設置失敗日誌的ITestLogger

投擲
BuildError
DeviceNotAvailableException
TargetSetupError

拆解

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如果我們成功下載構建,則為真,否則為假。

投擲
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 :測試運行時拋出的原始異常(如果有)。

runDevicePreInvocationSetup

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

受保護的方法

獲取工廠

protected IConfigurationFactory getFactory ()

返回用於創建配置的IConfigurationFactory

退貨
IConfigurationFactory

getLabPreparersToRun

protected  getLabPreparersToRun (IConfiguration config, 
                String deviceName)

檢索要在此設備上運行的實驗室準備者列表。

在沙盒類中覆蓋以限制實驗室準備者在沙盒子類中運行

參數
config IConfiguration

deviceName String

退貨

getRunUtil

protected IRunUtil getRunUtil ()

退貨
IRunUtil

getTargetPreparersToRun

protected  getTargetPreparersToRun (IConfiguration config, 
                String deviceName)

檢索要在此設備上運行的目標準備程序列表。

在沙盒類中覆蓋以限制實驗室準備者在沙盒子類中運行

參數
config IConfiguration

deviceName String

退貨

準備和運行沙箱

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

返回運行沙箱的結果狀態。

參數
info TestInformation

config IConfiguration

listener ITestInvocationListener

退貨
boolean