ISandbox
public
interface
ISandbox
com.android.tradefed.sandbox.ISandbox |
定義可用於執行叫用作業的沙箱的介面。
摘要
公用方法 | |
---|---|
abstract
String
|
createClasspath(File workingDir)
根據環境和 |
abstract
IConfiguration
|
createThinLauncherConfig(String[] args, IKeyStoreClient keyStoreClient, IRunUtil runUtil, File globalConfig)
特殊模式與主要執行作業中斷連:當父項中似乎沒有設定時,我們會改用精簡啟動器,嘗試使用目前已知資訊設定沙箱,並填入工作目錄,以便在版本目錄中完整建立設定。 |
abstract
File
|
getTradefedSandboxEnvironment(IInvocationContext context, IConfiguration nonVersionedConfig, String[] args)
根據指令列引數傳回要使用的沙箱環境 TF。 |
abstract
Exception
|
prepareEnvironment(IInvocationContext context, IConfiguration configuration, ITestInvocationListener listener)
準備環境,讓沙箱正常運作。 |
abstract
CommandResult
|
run(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 |
要使用的 classpath。 |
擲回 | |
---|---|
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 的檔案。如果無法建立精簡啟動器設定,則會傳回空值。 |
getTradefedSandboxEnvironment
public abstract File getTradefedSandboxEnvironment (IInvocationContext context, IConfiguration nonVersionedConfig, String[] args)
根據指令列引數,傳回要使用的沙箱環境 TF。
參數 | |
---|---|
context |
IInvocationContext :父項的 IInvocationContext 。 |
nonVersionedConfig |
IConfiguration :代表非版本化物件的 IConfiguration 。 |
args |
String :指令列引數。 |
傳回 | |
---|---|
File |
ERROR(/File) 目錄,其中包含 TF 沙箱環境 JAR 檔案。 |
prepareEnvironment
public abstract Exception prepareEnvironment (IInvocationContext context, IConfiguration configuration, ITestInvocationListener listener)
準備環境,讓沙箱正常運作。
參數 | |
---|---|
context |
IInvocationContext :目前的叫用 IInvocationContext 。 |
configuration |
IConfiguration :要執行的指令的 IConfiguration 。 |
listener |
ITestInvocationListener :應將最終結果管道傳送至目前的叫用 ITestInvocationListener 。 |
傳回 | |
---|---|
Exception |
包含失敗的 Exception ,如果成功則為空值。 |
得分
public abstract CommandResult run (IConfiguration configuration, ITestLogger logger)
使用已設定的環境執行沙箱。
參數 | |
---|---|
configuration |
IConfiguration :要執行的指令的 IConfiguration 。 |
logger |
ITestLogger :可記錄檔案的 ITestLogger 。 |
傳回 | |
---|---|
CommandResult |
包含沙箱執行狀態和記錄檔的 CommandResult 。 |
tearDown
public abstract void tearDown ()
清理所有可能已變更的狀態、檔案或環境。