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

List<ITargetPreparer> getLabPreparersToRun(IConfiguration config, String deviceName)

在這部裝置上擷取實驗室準備人員清單。

IRunUtil getRunUtil()
List<ITargetPreparer> getTargetPreparersToRun(IConfiguration config, String deviceName)

擷取要在這部裝置上執行的目標準備人員清單。

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

擲回
Throwable

fetchBuild

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

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)

針對叫用的每個裝置部分,叫用 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

runTests

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

執行測試。

參數
info TestInformation:用於執行測試的 TestInformation

config IConfiguration:要執行的 IConfiguration

listener ITestInvocationListener:測試結果的 ITestInvocationListener

擲回
Throwable

受保護的方法

getFactory

protected IConfigurationFactory getFactory ()

傳回用於建立設定的 IConfigurationFactory

傳回
IConfigurationFactory

getLabPreparersToRun

protected List<ITargetPreparer> getLabPreparersToRun (IConfiguration config, 
                String deviceName)

擷取要在這部裝置上執行的實驗室準備人員清單。

在沙箱類別中覆寫,限制實驗室準備人員在沙箱子項中執行作業

參數
config IConfiguration

deviceName String

傳回
List<ITargetPreparer>

getRunUtil

protected IRunUtil getRunUtil ()

傳回
IRunUtil

getTargetPreparersToRun

protected List<ITargetPreparer> getTargetPreparersToRun (IConfiguration config, 
                String deviceName)

擷取要在這部裝置上執行的目標準備人員清單。

在沙箱類別中覆寫,限制實驗室準備人員在沙箱子項中執行作業

參數
config IConfiguration

deviceName String

傳回
List<ITargetPreparer>

prepareAndRunSandbox

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

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

參數
info TestInformation

config IConfiguration

listener ITestInvocationListener

傳回
boolean

擲回
Throwable