ParentSandboxInvocationExecution

public class ParentSandboxInvocationExecution
extends InvocationExecution

java.lang.Object
   ↳ com.android.tradefed.invoker.InvocationExecution
     ↳ com.android.tradefed.invoker.sandbox.ParentSandboxInvocationExecution


Version of InvocationExecution for the parent invocation special actions when running a sandbox.

Summary

Public constructors

ParentSandboxInvocationExecution()

Public methods

void doCleanUp(IInvocationContext context, IConfiguration config, Throwable exception)

Execute the target_preparer and multi_target_preparer cleanUp step.

void doSetup(IInvocationContext context, IConfiguration config, ITestInvocationListener listener)

Execute the target_preparer and multi_target_preparer setUp step.

void doTeardown(IInvocationContext context, IConfiguration config, ITestLogger logger, Throwable exception)

Execute the target_preparer and multi_target_preparer teardown step.

boolean fetchBuild(IInvocationContext context, IConfiguration config, IRescheduler rescheduler, ITestInvocationListener listener)

Execute the build_provider step of the invocation.

void reportLogs(ITestDevice device, ITestInvocationListener listener, TestInvocation.Stage stage)

Report some device logs at different stage of the invocation.

void runTests(IInvocationContext context, IConfiguration config, ITestInvocationListener listener)

Runs the test.

Protected methods

IConfigurationFactory getFactory()

Returns the IConfigurationFactory used to created configurations.

Public constructors

ParentSandboxInvocationExecution

public ParentSandboxInvocationExecution ()

Public methods

doCleanUp

public void doCleanUp (IInvocationContext context, 
                IConfiguration config, 
                Throwable exception)

Execute the target_preparer and multi_target_preparer cleanUp step. Does the devices clean up.

Parameters
context IInvocationContext: the IInvocationContext of the invocation.

config IConfiguration: the IConfiguration of this test run.

exception Throwable: the original exception thrown by the test running.

doSetup

public void doSetup (IInvocationContext context, 
                IConfiguration config, 
                ITestInvocationListener listener)

Execute the target_preparer and multi_target_preparer setUp step. Does all the devices setup required for the test to run.

Parameters
context IInvocationContext: the IInvocationContext of the invocation.

config IConfiguration: the IConfiguration of this test run.

listener ITestInvocationListener: the ITestInvocation to report setup failures.

Throws
BuildError
DeviceNotAvailableException
TargetSetupError

doTeardown

public void doTeardown (IInvocationContext context, 
                IConfiguration config, 
                ITestLogger logger, 
                Throwable exception)

Execute the target_preparer and multi_target_preparer teardown step. Does the devices tear down associated with the setup.

Parameters
context IInvocationContext: the IInvocationContext of the invocation.

config IConfiguration: the IConfiguration of this test run.

logger ITestLogger: the ITestLogger to report logs.

exception Throwable: the original exception thrown by the test running.

fetchBuild

public boolean fetchBuild (IInvocationContext context, 
                IConfiguration config, 
                IRescheduler rescheduler, 
                ITestInvocationListener listener)

Execute the build_provider step of the invocation.

Parameters
context IInvocationContext: the IInvocationContext of the invocation.

config IConfiguration: the IConfiguration of this test run.

rescheduler IRescheduler: the IRescheduler, for rescheduling portions of the invocation for execution on another resource(s)

listener ITestInvocationListener: the ITestInvocation to report build download failures.

Returns
boolean True if we successfully downloaded the build, false otherwise.

Throws
BuildRetrievalError
DeviceNotAvailableException

reportLogs

public void reportLogs (ITestDevice device, 
                ITestInvocationListener listener, 
                TestInvocation.Stage stage)

Report some device logs at different stage of the invocation. For example: logcat.

Parameters
device ITestDevice: The device to report logs from.

listener ITestInvocationListener: The logger for the logs.

stage TestInvocation.Stage: The stage of the invocation we are at.

runTests

public void runTests (IInvocationContext context, 
                IConfiguration config, 
                ITestInvocationListener listener)

Runs the test.

Parameters
context IInvocationContext: the IInvocationContext to run tests on

config IConfiguration: the IConfiguration to run

listener ITestInvocationListener: the ITestInvocationListener of test results

Protected methods

getFactory

protected IConfigurationFactory getFactory ()

Returns the IConfigurationFactory used to created configurations.

Returns
IConfigurationFactory