委託呼叫執行

public class DelegatedInvocationExecution
extends InvocationExecution

java.lang.Object
com.android.tradefed.invoker.InitationExecution
com.android.tradefed.invoker.Dele表格


InvocationExecution將執行委託給另一個 Tradefed 二進位。

概括

領域

public static final String DELEGATED_MODE_VAR

如果存在,則呼叫正在委託模式下執行

公共構造函數

DelegatedInvocationExecution ()

公共方法

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

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)

為呼叫的每個裝置部分呼叫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)

運行測試。

boolean shardConfig ( IConfiguration config, TestInformation testInfo, IRescheduler rescheduler, ITestLogger logger)

嘗試將配置分割為子配置,以便重新安排在多個資源上並行運行。

領域

DELEGATED_MODE_VAR

public static final String DELEGATED_MODE_VAR

如果存在,則呼叫正在委託模式下執行

公共構造函數

委託呼叫執行

public DelegatedInvocationExecution ()

公共方法

清理

public void doCleanUp (IInvocationContext context, 
                IConfiguration config, 
                Throwable exception)

執行 target_preparer 和 multi_target_preparer cleanUp 步驟。設備是否清理乾淨。

參數
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 void reportLogs (ITestDevice device, 
                ITestLogger logger, 
                TestInvocation.Stage stage)

報告調用不同階段的一些設備日誌。例如:logcat。

參數
device ITestDevice :報告日誌的設備。

logger ITestLogger :日誌記錄器。

stage TestInvocation.Stage :我們所處的呼叫階段。

runDevicePostInspirationTearDown

public void runDevicePostInvocationTearDown (IInvocationContext context, 
                IConfiguration config, 
                Throwable exception)

為呼叫的每個裝置部分呼叫ITestDevice#postInvocationTearDown(Throwable)

參數
context IInvocationContext :呼叫的IInvocationContext

config IConfiguration :本次測試運行的IConfiguration

exception Throwable :測試運行時拋出的原始異常(如果有)。

運行設備預調用設定

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

分片配置

public boolean shardConfig (IConfiguration config, 
                TestInformation testInfo, 
                IRescheduler rescheduler, 
                ITestLogger logger)

嘗試將配置分割為子配置,以便重新安排在多個資源上並行運行。

如果分片計數大於 1,它將透過設定分片索引並重新安排它們來簡單地為每個分片建立配置。如果未設定分片計數,它將回退到IShardHelper#shardConfig

參數
config IConfiguration :目前的IConfiguration

testInfo TestInformation :儲存測試資訊的TestInformation

rescheduler IReschedulerIRescheduler

logger ITestLoggerITestLogger用於在分片期間記錄檔案。

退貨
boolean如果測試被分片則為 true。否則回傳false