GoogleTradefedSandbox

public class GoogleTradefedSandbox
extends TradefedSandbox

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


Internal specialization of TradefedSandbox to be used in the lab infrastructure. This address the download need of the proper version associated with the build. We might be able to move this to AOSP if one day we can rely on AOSP API to download builds.

Summary

Public constructors

GoogleTradefedSandbox()

Public methods

String createClasspath(File workingDir)

Google Tradefed Sandbox only use the jars inside the working dir.

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

Special mode disconnected from main run: When a configuration does not appear to exists in the parent, we fallback to thin launcher where we attempt to setup the sandbox with currently known informations and fill up the working directory to create the config fully in the versioned dir.

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()

Clean up any states, files or environment that may have been changed.

Protected methods

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

Dump the global configuration filtered from some objects.

File prepareContext(IInvocationContext context, IConfiguration config)

Prepare and serialize the IInvocationContext.

Public constructors

GoogleTradefedSandbox

public GoogleTradefedSandbox ()

Public methods

createClasspath

public String createClasspath (File workingDir)

Google Tradefed Sandbox only use the jars inside the working dir.

Parameters
workingDir File: the current working directory for the sandbox.

Returns
String The classpath to be use.

Throws
ConfigurationException

createThinLauncherConfig

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

Special mode disconnected from main run: When a configuration does not appear to exists in the parent, we fallback to thin launcher where we attempt to setup the sandbox with currently known informations and fill up the working directory to create the config fully in the versioned dir.

Parameters
args String: The original command line args.

keyStoreClient IKeyStoreClient: the current keystore client to use to create configurations.

runUtil IRunUtil: the current IRunUtil to run host commands.

globalConfig File: The global configuration to use to run subprocesses of TF.

Returns
IConfiguration a File pointing to the configuration XML of TF for NON_VERSIONED objects. Returns null if no thin launcher config could be created.

discoverTests

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

Parameters
context IInvocationContext

nonVersionedConfig IConfiguration

logger ITestLogger

Returns
Map<String, List<String>>

fetchSandboxExtraArtifacts

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

Parameters
context IInvocationContext

nonVersionedConfig IConfiguration

args String

Returns
IFolderBuildInfo

Throws
BuildRetrievalError
ConfigurationException
IOException

getTradefedSandboxEnvironment

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

Parameters
context IInvocationContext

nonVersionedConfig IConfiguration

logger ITestLogger

args String

Returns
File

Throws
Exception

tearDown

public void tearDown ()

Clean up any states, files or environment that may have been changed.

Protected methods

dumpGlobalConfig

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

Dump the global configuration filtered from some objects.

Parameters
config IConfiguration

exclusionPatterns Set

Returns
File

Throws
ConfigurationException
IOException

prepareContext

protected File prepareContext (IInvocationContext context, 
                IConfiguration config)

Prepare and serialize the IInvocationContext.

Parameters
context IInvocationContext: the IInvocationContext to be prepared.

config IConfiguration: The IConfiguration of the sandbox.

Returns
File the serialized IInvocationContext.

Throws
IOException