Iサンドボックス

public interface ISandbox

com.android.tradefed.sandbox.ISandbox


呼び出しの実行に使用できるサンドボックスを定義するインターフェイス。

まとめ

パブリックメソッド

abstract String createClasspath (File workingDir)

getTradefedSandboxEnvironment(com.android.tradefed.invoker.IInvocationContext, com.android.tradefed.config.IConfiguration, String[])によって返される環境と作業ディレクトリに基づいてクラスパスを作成します。

abstract IConfiguration createThinLauncherConfig (String[] args, IKeyStoreClient keyStoreClient, IRunUtil runUtil, File globalConfig)

メイン実行から切断された特殊モード: 親に構成が存在しないように見える場合、シン ランチャーにフォールバックし、現在既知の情報でサンドボックスをセットアップし、作業ディレクトリを埋めて、バージョン管理されたディレクトリに構成を完全に作成しようとします。 。

default discoverTests ( IInvocationContext context, IConfiguration configuration)

prepareEnvironment(com.android.tradefed.invoker.IInvocationContext, com.android.tradefed.config.IConfiguration, com.android.tradefed.result.ITestInvocationListener)のサブステップはSandboxOptions.shouldUseTestDiscovery()有効になっているかどうかのテストを検出します。

default discoverTests ( IInvocationContext context, IConfiguration configuration, ITestLogger logger)
default IFolderBuildInfo fetchSandboxExtraArtifacts ( IInvocationContext context, IConfiguration configuration, String[] args)

サンドボックスに必要な追加ファイルをフェッチするprepareEnvironment(com.android.tradefed.invoker.IInvocationContext, com.android.tradefed.config.IConfiguration, com.android.tradefed.result.ITestInvocationListener)のサブステップ。

default File getTradefedSandboxEnvironment ( IInvocationContext context, IConfiguration nonVersionedConfig, String[] args)

コマンドライン引数に基づいて、使用されるサンドボックス環境 TF を返します。

default File getTradefedSandboxEnvironment ( IInvocationContext context, IConfiguration nonVersionedConfig, ITestLogger logger, String[] args)
abstract Exception prepareEnvironment ( IInvocationContext context, IConfiguration configuration, ITestInvocationListener listener)

サンドボックスが適切に実行できるように環境を準備します。

abstract CommandResult run ( TestInformation info, IConfiguration configuration, ITestLogger logger)

設定した環境でサンドボックスを実行します。

abstract void tearDown ()

変更された可能性のある状態、ファイル、または環境をクリーンアップします。

パブリックメソッド

クラスパスの作成

public abstract String createClasspath (File workingDir)

getTradefedSandboxEnvironment(com.android.tradefed.invoker.IInvocationContext, com.android.tradefed.config.IConfiguration, String[])によって返される環境と作業ディレクトリに基づいてクラスパスを作成します。

パラメーター
workingDir File : サンドボックスの現在の作業ディレクトリ。

戻り値
String使用するクラスパス。

投げる
ConfigurationException

createThinLauncherConfig

public abstract IConfiguration createThinLauncherConfig (String[] args, 
                IKeyStoreClient keyStoreClient, 
                IRunUtil runUtil, 
                File globalConfig)

メイン実行から切断された特殊モード: 親に構成が存在しないように見える場合、シン ランチャーにフォールバックし、現在既知の情報でサンドボックスをセットアップし、作業ディレクトリを埋めて、バージョン管理されたディレクトリに構成を完全に作成しようとします。 。

パラメーター
args String : 元のコマンドライン引数。

keyStoreClient IKeyStoreClient : 構成の作成に使用する現在のキーストア クライアント。

runUtil IRunUtil : ホスト コマンドを実行するための現在のIRunUtil

globalConfig File : TF のサブプロセスを実行するために使用するグローバル構成。

戻り値
IConfiguration NON_VERSIONED オブジェクトの TF の構成 XML を指すファイル。シン ランチャー構成を作成できなかった場合は null を返します。

発見テスト

public  discoverTests (IInvocationContext context, 
                IConfiguration configuration)

prepareEnvironment(com.android.tradefed.invoker.IInvocationContext, com.android.tradefed.config.IConfiguration, com.android.tradefed.result.ITestInvocationListener)のサブステップはSandboxOptions.shouldUseTestDiscovery()有効になっているかどうかのテストを検出します。

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

configuration IConfiguration : 実行するコマンドのIConfiguration

戻り値
検出されたテストのマップ。サポートされていないか失敗した場合は null。

発見テスト

public  discoverTests (IInvocationContext context, 
                IConfiguration configuration, 
                ITestLogger logger)

パラメーター
context IInvocationContext

configuration IConfiguration

logger ITestLogger

戻り値

フェッチサンドボックスエクストラアーティファクト

public IFolderBuildInfo fetchSandboxExtraArtifacts (IInvocationContext context, 
                IConfiguration configuration, 
                String[] args)

サンドボックスに必要な追加ファイルをフェッチするprepareEnvironment(com.android.tradefed.invoker.IInvocationContext, com.android.tradefed.config.IConfiguration, com.android.tradefed.result.ITestInvocationListener)のサブステップ。

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

configuration IConfiguration : 実行するコマンドのIConfiguration

args String : コマンドライン引数。

戻り値
IFolderBuildInfo追加のサンドボックス ファイル用にフェッチされたビルド。

投げる
com.android.tradefed.build.BuildRetrievalError
com.android.tradefed.config.ConfigurationException
IO例外
BuildRetrievalError
ConfigurationException

getTradefedサンドボックス環境

public File getTradefedSandboxEnvironment (IInvocationContext context, 
                IConfiguration nonVersionedConfig, 
                String[] args)

コマンドライン引数に基づいて、使用されるサンドボックス環境 TF を返します。

パラメーター
context IInvocationContext : 親のIInvocationContext

nonVersionedConfig IConfiguration : バージョン管理されていないオブジェクトを表すIConfiguration

args String : コマンドライン引数。

戻り値
File TF サンドボックス環境の jar を含むERROR(/File)ディレクトリ。

getTradefedサンドボックス環境

public File getTradefedSandboxEnvironment (IInvocationContext context, 
                IConfiguration nonVersionedConfig, 
                ITestLogger logger, 
                String[] args)

パラメーター
context IInvocationContext

nonVersionedConfig IConfiguration

logger ITestLogger

args String

戻り値
File

環境を準備する

public abstract Exception prepareEnvironment (IInvocationContext context, 
                IConfiguration configuration, 
                ITestInvocationListener listener)

サンドボックスが適切に実行できるように環境を準備します。

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

configuration IConfiguration : 実行するコマンドのIConfiguration

listener ITestInvocationListener : 最終結果がパイプされる現在の呼び出しITestInvocationListener

戻り値
Exception失敗を含むException 。成功した場合は Null。

走る

public abstract CommandResult run (TestInformation info, 
                IConfiguration configuration, 
                ITestLogger logger)

設定した環境でサンドボックスを実行します。

パラメーター
info TestInformation : 呼び出しを説明するTestInformation

configuration IConfiguration : 実行するコマンドのIConfiguration

logger ITestLogger : ファイルのログを記録できるITestLogger

戻り値
CommandResultサンドボックスの実行ステータスとログを含むCommandResult

取り壊す

public abstract void tearDown ()

変更された可能性のある状態、ファイル、または環境をクリーンアップします。