ISandbox

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)

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

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()

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

パブリック メソッド

createClasspath

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 を返します。

discoverTests

public  discoverTests (IInvocationContext context, 
                IConfiguration configuration)

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

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

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

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

discoverTests

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

パラメータ
context IInvocationContext

configuration IConfiguration

logger ITestLogger

戻り値

fetchSandboxExtraArtifacts

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
IOException
BuildRetrievalError
ConfigurationException

getTradefedSandboxEnvironment

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

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

パラメータ
context IInvocationContext: 親の IInvocationContext

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

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

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

getTradefedSandboxEnvironment

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

パラメータ
context IInvocationContext

nonVersionedConfig IConfiguration

logger ITestLogger

args String

戻り値
File

prepareEnvironment

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

tearDown

public abstract void tearDown ()

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