InvocationExecution

public class InvocationExecution
extends Object implements IInvocationExecution

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


ビルドのダウンロード、target_prep、テストの実行、クリーンアップなど、すべての呼び出し手順を記述するクラス。拡張して、一部のステップのデフォルトの動作をオーバーライドできます。ステップの順序は TestInvocation によって決まります。

概要

フィールド

public static final String ADB_VERSION_KEY

public static final String JAVA_CLASSPATH_KEY

public static final String JAVA_VERSION_KEY

パブリック コンストラクタ

InvocationExecution()

パブリック メソッド

void cleanUpBuilds(IInvocationContext context, IConfiguration config)

build_provider のクリーンアップ ステップを実行します。

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 の削除ステップを実行します。

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

呼び出しの build_provider ステップを実行します。

void reportLogs(ITestDevice device, ITestLogger listener, 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)

構成をサブ構成にシャーディングし、複数のリソースで並行して実行するように再スケジュールします。

保護されたメソッド

void collectAutoInfo(IConfiguration config, TestInformation info)

テスト対象のメインデバイスに関する情報を自動的に収集します。

IShardHelper createShardHelper()

使用する IShardHelper を作成して返します。

void customizeDevicePreInvocation(IConfiguration config, IInvocationContext context)

preInvocationSetup の前に、デバイスの一部をカスタマイズする機会を与えます。

String getAdbVersion()

呼び出しに使用されている adb バージョンを返します。

getLabPreparersToRun(IConfiguration config, String deviceName)

このデバイスで実行するラボ準備ツールのリストを取得します。

getTargetPreparersToRun(IConfiguration config, String deviceName)

このデバイスで実行するターゲット準備ツールのリストを取得します。

void linkExternalDirs(IBuildInfo info, TestInformation testInfo)
void logHostAdb(IConfiguration config, ITestLogger logger)

$TMPDIR/adb.$UID.log からログを収集します。

Throwable runPreparersTearDown(TestInformation testInfo, ITestDevice device, String deviceName, int deviceIndex, ITestLogger logger, Throwable exception, preparersToRun, trackPreparersMap)
void setTestTag(IBuildInfo info, IConfiguration config)

ビルド情報にテストタグを設定する処理を処理。

フィールド

ADB_VERSION_KEY

public static final String ADB_VERSION_KEY

JAVA_CLASSPATH_KEY

public static final String JAVA_CLASSPATH_KEY

JAVA_VERSION_KEY

public static final String JAVA_VERSION_KEY

パブリック コンストラクタ

InvocationExecution

public InvocationExecution ()

パブリック メソッド

cleanUpBuilds

public void cleanUpBuilds (IInvocationContext context, 
                IConfiguration config)

build_provider のクリーンアップ ステップを実行します。ビルドの取得に関連しています。

パラメータ
context IInvocationContext: 呼び出しの IInvocationContext

config IConfiguration: このテスト実行の IConfiguration

doCleanUp

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

target_preparer と multi_target_preparer のクリーンアップ ステップを実行します。デバイスがクリーンアップされます。

パラメータ
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: テストの実行によってスローされた元の例外。

fetchBuild

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

呼び出しの build_provider ステップを実行します。

パラメータ
testInfo TestInformation: 呼び出しの TestInformation

config IConfiguration: このテスト実行の IConfiguration

rescheduler IRescheduler: IRescheduler。呼び出しの一部を別のリソースで実行するようにスケジュールを変更します。

listener ITestInvocationListener: ビルドのダウンロードの失敗を報告する ITestInvocation

戻り値
boolean ビルドが正常にダウンロードされた場合は true、それ以外の場合は false。

例外
BuildRetrievalError
DeviceNotAvailableException

reportLogs

public void reportLogs (ITestDevice device, 
                ITestLogger listener, 
                TestInvocation.Stage stage)

呼び出しのさまざまな段階でデバイスログの一部を報告します。例: logcat。

パラメータ
device ITestDevice: ログを報告するデバイス。

listener 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 IRescheduler: IRescheduler

logger ITestLogger: シャーディング中にファイルをロギングするために使用される ITestLogger

戻り値
boolean テストがシャーディングされている場合は true。同じでない場合は、false を返します。

保護されたメソッド

collectAutoInfo

protected void collectAutoInfo (IConfiguration config, 
                TestInformation info)

テスト対象のメインデバイスに関する一部の情報を自動的に収集します。

パラメータ
config IConfiguration

info TestInformation

例外
DeviceNotAvailableException

createShardHelper

protected IShardHelper createShardHelper ()

使用する IShardHelper を作成して返します。

戻り値
IShardHelper

customizeDevicePreInvocation

protected void customizeDevicePreInvocation (IConfiguration config, 
                IInvocationContext context)

preInvocationSetup の前に、デバイスの一部をカスタマイズする機会を与えます。

パラメータ
config IConfiguration: 呼び出しの構成。

context IInvocationContext: 現在の呼び出しコンテキスト。

getAdbVersion

protected String getAdbVersion ()

呼び出しに使用されている adb バージョンを返します。

戻り値
String

getLabPreparersToRun

protected  getLabPreparersToRun (IConfiguration config, 
                String deviceName)

このデバイスで実行するラボ準備ツールのリストを取得します。

サンドボックス クラスでオーバーライドされ、ラボ準備ツールがサンドボックスの子内で実行されないように制限

パラメータ
config IConfiguration

deviceName String

戻り値

getTargetPreparersToRun

protected  getTargetPreparersToRun (IConfiguration config, 
                String deviceName)

このデバイスで実行するターゲット準備ツールのリストを取得します。

サンドボックス クラスでオーバーライドされ、ラボ準備ツールがサンドボックスの子内で実行されないように制限

パラメータ
config IConfiguration

deviceName String

戻り値

linkExternalDirs

protected void linkExternalDirs (IBuildInfo info, 
                TestInformation testInfo)

パラメータ
info IBuildInfo

testInfo TestInformation

logHostAdb

protected void logHostAdb (IConfiguration config, 
                ITestLogger logger)

$TMPDIR/adb.$UID.log からログを収集します。

パラメータ
config IConfiguration

logger ITestLogger

runPreparersTearDown

protected Throwable runPreparersTearDown (TestInformation testInfo, 
                ITestDevice device, 
                String deviceName, 
                int deviceIndex, 
                ITestLogger logger, 
                Throwable exception, 
                 preparersToRun, 
                 trackPreparersMap)

パラメータ
testInfo TestInformation

device ITestDevice

deviceName String

deviceIndex int

logger ITestLogger

exception Throwable

preparersToRun

trackPreparersMap

戻り値
Throwable

setTestTag

protected void setTestTag (IBuildInfo info, 
                IConfiguration config)

ビルド情報にテストタグを設定する処理を追加。

パラメータ
info IBuildInfo

config IConfiguration