コレクションでコンテンツを整理 必要に応じて、コンテンツの保存と分類を行います。

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

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バージョンを返します。

getPreparersToRun ( IConfiguration config, String deviceName)

このデバイスで実行する作成者のリストを取得します。

void logHostAdb ( IConfiguration config, ITestLogger logger)

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

void runPreparersSetup (TestInformation testInfo, IConfiguration config, ITestLogger listener)
Throwable runPreparersTearDown (TestInformation testInfo, ITestDevice device, String deviceName, int deviceIndex, ITestLogger logger, Throwable exception, preparersToRun) runPreparersTearDown (TestInformation testInfo, ITestDevice device, String deviceName, int deviceIndex, ITestLogger logger, Throwable exception, preparersToRun)
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_preparercleanUpステップを実行します。デバイスはクリーンアップされますか?

パラメーター
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 IReschedulerIRescheduler

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

getPreparersToRun

protected  getPreparersToRun (IConfiguration config, 
                String deviceName)

このデバイスで実行する作成者のリストを取得します。

サンドボックスクラスでオーバーライドされ、ラボの作成者がサンドボックスの子内で実行されるのを制限します

パラメーター
config IConfiguration

deviceName String

戻り値

logHostAdb

protected void logHostAdb (IConfiguration config, 
                ITestLogger logger)

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

パラメーター
config IConfiguration

logger ITestLogger

runPreparersSetup

protected void runPreparersSetup (TestInformation testInfo, 
                IConfiguration config, 
                ITestLogger listener)

パラメーター
testInfo TestInformation

config IConfiguration

listener ITestLogger

スロー
BuildError
DeviceNotAvailableException
TargetSetupError

runPreparersTearDown

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

パラメーター
testInfo TestInformation

device ITestDevice

deviceName String

deviceIndex int

logger ITestLogger

exception Throwable

preparersToRun

戻り値
Throwable

setTestTag

protected void setTestTag (IBuildInfo info, 
                IConfiguration config)

ビルド情報でのテストタグの設定を処理します。

パラメーター
info IBuildInfo

config IConfiguration