GoogleTradefedSandbox

public class GoogleTradefedSandbox
extends TradefedSandbox

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


實驗室基礎架構中使用的 TradefedSandbox 內部專業化。這可滿足與建構作業相關聯的正確版本下載需求。如果有一天我們能透過 AOSP API 下載建構版本,或許就能將這項功能移至 AOSP。

摘要

公用建構函式

GoogleTradefedSandbox()

公用方法

String createClasspath(File workingDir)

Google Tradefed Sandbox 只會使用工作目錄內的 JAR。

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

特殊模式與主要執行作業中斷連線:如果設定未顯示在父項中,我們會改用精簡啟動器,嘗試使用目前已知的資訊設定沙箱,並填入工作目錄,在版本目錄中完整建立設定。

Map<String, List<String>> discoverTests(IInvocationContext context, IConfiguration nonVersionedConfig, ITestLogger logger)
IFolderBuildInfo fetchSandboxExtraArtifacts(IInvocationContext context, IConfiguration nonVersionedConfig, String[] args)
File getTradefedSandboxEnvironment(IInvocationContext context, IConfiguration nonVersionedConfig, ITestLogger logger, String[] args)
void tearDown()

清理可能已變更的任何狀態、檔案或環境。

受保護的方法

File dumpGlobalConfig(IConfiguration config, Set<String> exclusionPatterns)

傾印從部分物件篩選的全域設定。

File prepareContext(IInvocationContext context, IConfiguration config)

準備並序列化 IInvocationContext

公用建構函式

GoogleTradefedSandbox

public GoogleTradefedSandbox ()

公用方法

createClasspath

public String createClasspath (File workingDir)

Google Tradefed Sandbox 只會使用工作目錄中的 JAR。

參數
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 的檔案。如果無法建立精簡啟動器設定,則傳回空值。

discoverTests

public Map<String, List<String>> discoverTests (IInvocationContext context, 
                IConfiguration nonVersionedConfig, 
                ITestLogger logger)

參數
context IInvocationContext

nonVersionedConfig IConfiguration

logger ITestLogger

傳回
Map<String, List<String>>

fetchSandboxExtraArtifacts

public IFolderBuildInfo fetchSandboxExtraArtifacts (IInvocationContext context, 
                IConfiguration nonVersionedConfig, 
                String[] args)

參數
context IInvocationContext

nonVersionedConfig IConfiguration

args String

傳回
IFolderBuildInfo

擲回
BuildRetrievalError
ConfigurationException
IOException

getTradefedSandboxEnvironment

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

參數
context IInvocationContext

nonVersionedConfig IConfiguration

logger ITestLogger

args String

傳回
File

擲回
Exception

tearDown

public void tearDown ()

清理可能已變更的任何狀態、檔案或環境。

受保護的方法

dumpGlobalConfig

protected File dumpGlobalConfig (IConfiguration config, 
                Set<String> exclusionPatterns)

從部分物件篩選並傾印全域設定。

參數
config IConfiguration

exclusionPatterns Set

傳回
File

擲回
ConfigurationException
IOException

prepareContext

protected File prepareContext (IInvocationContext context, 
                IConfiguration config)

準備並序列化 IInvocationContext

參數
context IInvocationContext:要準備的 IInvocationContext

config IConfiguration:沙箱的 IConfiguration

傳回
File 序列化 IInvocationContext

擲回
IOException