DelegatedInvocationExecution

public class DelegatedInvocationExecution
extends InvocationExecution

java.lang.Object
   ↳ com.android.tradefed.invoker.InvocationExecution
     ↳ com.android.tradefed.invoker.DelegatedInvocationExecution


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 的 setUp 步驟。

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

如果存在,則叫用會在委派模式下執行

公用建構函式

DelegatedInvocationExecution

public DelegatedInvocationExecution ()

公用方法

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 ITestLoggerITestLogger 用於回報設定失敗記錄。

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

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

shardConfig

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