沙盒
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 () 清理可能已變更的任何狀態、檔案或環境。 |
公共方法
建立類別路徑
public abstract String createClasspath (File workingDir)
根據環境和getTradefedSandboxEnvironment(com.android.tradefed.invoker.IInvocationContext, com.android.tradefed.config.IConfiguration, String[])
傳回的工作目錄建立類別路徑。
參數 | |
---|---|
workingDir | File :沙箱的目前工作目錄。 |
退貨 | |
---|---|
String | 要使用的類別路徑。 |
投擲 | |
---|---|
ConfigurationException |
建立ThinLauncherConfig
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。 |
getTradefedSandboxEnvironment
public abstract File getTradefedSandboxEnvironment (IInvocationContext context, IConfiguration nonVersionedConfig, String[] args)
根據命令列參數傳回要使用的沙箱環境 TF。
參數 | |
---|---|
context | IInvocationContext :父級的IInvocationContext 。 |
nonVersionedConfig | IConfiguration :表示非版本化物件的IConfiguration 。 |
args | String :命令列參數。 |
退貨 | |
---|---|
File | 包含 TF 沙箱環境 jar 的ERROR(/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 (IConfiguration configuration, ITestLogger logger)
使用設定的環境運行沙箱。
參數 | |
---|---|
configuration | IConfiguration :要運行的命令的IConfiguration 。 |
logger | ITestLogger :一個ITestLogger ,我們可以在其中記錄檔案。 |
退貨 | |
---|---|
CommandResult | 包含沙箱運作狀態和日誌的CommandResult 。 |
拆除
public abstract void tearDown ()
清理可能已變更的任何狀態、檔案或環境。