TradefedSandbox

public class TradefedSandbox
extends Object implements ISandbox

java.lang.Object
   ↳ com.android.tradefed.sandbox.TradefedSandbox


Trade Federation 呼び出しを実行できるサンドボックス コンテナ。TODO: オプションをサンドボックスに渡せるようにします。

概要

定数

String EXTRA_TARGET_LAB

String GENERAL_TESTS_ZIP

String SANDBOX_ENABLED

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

TradefedSandbox()

パブリック メソッド

String createClasspath(File workingDir)

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

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

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

File getTradefedSandboxEnvironment(IInvocationContext context, IConfiguration nonVersionedConfig, ITestLogger logger, String[] args)
static matchSandboxExtraBuildTargetByConfigName(String configName)

テスト構成名が指定されたら、Sandbox の追加ビルド ターゲットから追加ビルド ターゲットを照合します。

Exception prepareEnvironment(IInvocationContext context, IConfiguration config, ITestInvocationListener listener)

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

CommandResult run(TestInformation info, IConfiguration config, ITestLogger logger)

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

void tearDown()

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

保護されたメソッド

File dumpGlobalConfig(IConfiguration config, exclusionPatterns)

一部のオブジェクトからフィルタされたグローバル構成をダンプします。

String getJava()
Exception prepareConfiguration(IInvocationContext context, IConfiguration config, ITestInvocationListener listener)

サブプロセスに渡され、コンテナの実行を駆動する IConfiguration を準備します。

File prepareContext(IInvocationContext context, IConfiguration config)

IInvocationContext を準備してシリアル化します。

定数

EXTRA_TARGET_LAB

public static final String EXTRA_TARGET_LAB

定数値: "lab"

GENERAL_TESTS_ZIP

public static final String GENERAL_TESTS_ZIP

定数値: "general-tests.zip"

SANDBOX_ENABLED

public static final String SANDBOX_ENABLED

定数値: "SANDBOX_ENABLED"

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

TradefedSandbox

public TradefedSandbox ()

パブリック メソッド

createClasspath

public String createClasspath (File workingDir)

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

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

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

例外
ConfigurationException

createThinLauncherConfig

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

getTradefedSandboxEnvironment

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

パラメータ
context IInvocationContext

nonVersionedConfig IConfiguration

logger ITestLogger

args String

戻り値
File

matchSandboxExtraBuildTargetByConfigName

public static  matchSandboxExtraBuildTargetByConfigName (String configName)

テスト構成名が指定されたら、Sandbox の追加ビルド ターゲットから追加ビルド ターゲットを照合します。

パラメータ
configName String

戻り値

prepareEnvironment

public Exception prepareEnvironment (IInvocationContext context, 
                IConfiguration config, 
                ITestInvocationListener listener)

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

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

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

listener ITestInvocationListener: 最終結果をパイプ処理する現在の呼び出し ITestInvocationListener

戻り値
Exception 失敗した場合は Exception、成功した場合は Null。

ホームラン

public CommandResult run (TestInformation info, 
                IConfiguration config, 
                ITestLogger logger)

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

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

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

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

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

tearDown

public void tearDown ()

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

保護されたメソッド

dumpGlobalConfig

protected File dumpGlobalConfig (IConfiguration config, 
                 exclusionPatterns)

一部のオブジェクトからフィルタされたグローバル構成をダンプします。

パラメータ
config IConfiguration

exclusionPatterns

戻り値
File

例外
ConfigurationException

getJava

protected String getJava ()

戻り値
String

prepareConfiguration

protected Exception prepareConfiguration (IInvocationContext context, 
                IConfiguration config, 
                ITestInvocationListener listener)

サブプロセスに渡され、コンテナの実行を制御する IConfiguration を準備します。

パラメータ
context IInvocationContext: 現在の IInvocationContext

config IConfiguration: 準備する IConfiguration

listener ITestInvocationListener: 現在の呼び出し ITestInvocationListener

戻り値
Exception 問題が発生した場合は Exception、それ以外の場合は null。

prepareContext

protected File prepareContext (IInvocationContext context, 
                IConfiguration config)

IInvocationContext を準備してシリアル化します。

パラメータ
context IInvocationContext: 準備する IInvocationContext

config IConfiguration: サンドボックスの IConfiguration

戻り値
File シリアル化された IInvocationContext

例外
IOException