TradefedSandbox
public
class
TradefedSandbox
extends Object
implements
ISandbox
| java.lang.Object | |
| ↳ | com.android.tradefed.sandbox.TradefedSandbox |
Trade Federation 呼び出しを実行できるサンドボックス コンテナ。TODO: オプションをサンドボックスに渡すことを許可します。
概要
フィールド | |
|---|---|
public
static
final
String |
EXTRA_TARGET_LAB
|
public
static
final
String |
GENERAL_TESTS_ZIP
|
public
static
final
String |
SANDBOX_ENABLED
|
パブリック コンストラクタ | |
|---|---|
TradefedSandbox()
|
|
パブリック メソッド | |
|---|---|
String
|
createClasspath(File workingDir)
環境と |
IConfiguration
|
createThinLauncherConfig(String[] args, IKeyStoreClient keyStoreClient, IRunUtil runUtil, File globalConfig)
メイン実行から切断された特別なモード: 親に構成が存在しないと思われる場合は、シン ランチャーにフォールバックします。ここでは、現在知られている情報を使用してサンドボックスをセットアップし、作業ディレクトリを埋めて、バージョニングされたディレクトリに構成を完全に作成します。 |
File
|
getTradefedSandboxEnvironment(IInvocationContext context, IConfiguration nonVersionedConfig, ITestLogger logger, String[] args)
|
static
|
matchSandboxExtraBuildTargetByConfigName(String configName)
テスト構成名に基づいて、サンドボックスの追加ビルド ターゲットの追加ビルド ターゲットを照合します。 |
Exception
|
prepareEnvironment(IInvocationContext context, IConfiguration config, ITestInvocationListener listener)
サンドボックスが適切に実行されるように環境を準備します。 |
CommandResult
|
run(TestInformation info, IConfiguration config, ITestLogger logger)
設定した環境でサンドボックスを実行します。 |
void
|
tearDown()
変更された可能性のある状態、ファイル、環境をクリーンアップします。 |
保護されたメソッド | |
|---|---|
File
|
dumpGlobalConfig(IConfiguration config,
一部のオブジェクトからフィルタされたグローバル構成をダンプします。 |
String
|
getJava()
|
Exception
|
prepareConfiguration(IInvocationContext context, IConfiguration config, ITestInvocationListener listener)
サブプロセスに渡され、コンテナの実行を駆動する |
File
|
prepareContext(IInvocationContext context, IConfiguration config)
|
フィールド
EXTRA_TARGET_LAB
public static final String EXTRA_TARGET_LAB
GENERAL_TESTS_ZIP
public static final String GENERAL_TESTS_ZIP
SANDBOX_ENABLED
public static final String 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 staticmatchSandboxExtraBuildTargetByConfigName (String configName)
テスト構成名に基づいて、サンドボックスの追加ビルド ターゲットの追加ビルド ターゲットを照合します。
| パラメータ | |
|---|---|
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 |