自 2025 年 3 月 27 日起,我們建議您使用 android-latest-release
而非 aosp-main
建構及貢獻 AOSP。詳情請參閱「Android 開放原始碼計畫變更」。
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
TradefedSandbox
public
class
TradefedSandbox
extends Object
implements
ISandbox
java.lang.Object
|
↳ |
com.android.tradefed.sandbox.TradefedSandbox
|
可執行 Trade Federation 叫用作業的沙箱容器。TODO:允許將選項傳遞至沙箱。
摘要
公用方法 |
String
|
createClasspath(File workingDir)
根據環境和 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, String[] args)
根據指令列引數傳回要使用的沙箱環境 TF。
|
Exception
|
prepareEnvironment(IInvocationContext context, IConfiguration config, ITestInvocationListener listener)
準備環境,讓沙箱正常運作。
|
CommandResult
|
run(IConfiguration config, ITestLogger logger)
使用已設定的環境執行沙箱。
|
void
|
tearDown()
清除所有可能已變更的狀態、檔案或環境。
|
公用建構函式
TradefedSandbox
public TradefedSandbox ()
公用方法
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 的檔案。如果無法建立精簡啟動器設定,則會傳回空值。 |
getTradefedSandboxEnvironment
public File getTradefedSandboxEnvironment (IInvocationContext context,
IConfiguration nonVersionedConfig,
String[] args)
根據指令列引數,傳回要使用的沙箱環境 TF。
prepareEnvironment
public Exception prepareEnvironment (IInvocationContext context,
IConfiguration config,
ITestInvocationListener listener)
準備環境,讓沙箱正常運作。
得分
public CommandResult run (IConfiguration config,
ITestLogger logger)
使用已設定的環境執行沙箱。
tearDown
public void tearDown ()
清理所有可能已變更的狀態、檔案或環境。
受保護的方法
dumpGlobalConfig
protected File dumpGlobalConfig (IConfiguration config,
exclusionPatterns)
傾印從部分物件篩選出來的全域設定。
參數 |
config |
IConfiguration |
exclusionPatterns |
|
擲回 |
ConfigurationException |
|
prepareConfiguration
protected Exception prepareConfiguration (IInvocationContext context,
IConfiguration config,
ITestInvocationListener listener)
準備將傳遞至子程序的 IConfiguration
,並驅動容器執行作業。
傳回 |
Exception |
如果發生任何錯誤,則傳回例外狀況,否則傳回空值。 |
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-03-26 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-03-26 (世界標準時間)。"],[],[]]