DelegatedInvocationExecution
  public
  
  
  
  class
  DelegatedInvocationExecution
  
  
  
  
    extends InvocationExecution
  
  
  
  
  
  
| java.lang.Object | ||
| ↳ | com.android.tradefed.invoker.InvocationExecution | |
| ↳ | com.android.tradefed.invoker.DelegatedInvocationExecution | |
InvocationExecution which delegate the execution to another Tradefed binary.
Summary
| Fields | |
|---|---|
| 
    public
    static
    final
    String | DELEGATED_MODE_VARIf present the invocation is executing within a delegated mode | 
| Public constructors | |
|---|---|
| 
      DelegatedInvocationExecution()
       | |
| Public methods | |
|---|---|
| 
        
        
        
        
        
        void | 
      doCleanUp(IInvocationContext context, IConfiguration config, Throwable exception)
      Execute the target_preparer and multi_target_preparer cleanUp step. | 
| 
        
        
        
        
        
        void | 
      doSetup(TestInformation testInfo, IConfiguration config, ITestLogger listener)
      Execute the target_preparer and multi_target_preparer setUp step. | 
| 
        
        
        
        
        
        void | 
      doTeardown(TestInformation testInfo, IConfiguration config, ITestLogger logger, Throwable exception)
      Execute the target_preparer and multi_target_preparer teardown step. | 
| 
        
        
        
        
        
        void | 
      reportLogs(ITestDevice device, ITestLogger logger, TestInvocation.Stage stage)
      Report some device logs at different stage of the invocation. | 
| 
        
        
        
        
        
        void | 
      runDevicePostInvocationTearDown(IInvocationContext context, IConfiguration config, Throwable exception)
      Invoke the  | 
| 
        
        
        
        
        
        void | 
      runDevicePreInvocationSetup(IInvocationContext context, IConfiguration config, ITestLogger logger)
      Invoke the  | 
| 
        
        
        
        
        
        void | 
      runTests(TestInformation info, IConfiguration config, ITestInvocationListener listener)
      Runs the test. | 
| 
        
        
        
        
        
        boolean | 
      shardConfig(IConfiguration config, TestInformation testInfo, IRescheduler rescheduler, ITestLogger logger)
      Attempt to shard the configuration into sub-configurations, to be re-scheduled to run on multiple resources in parallel. | 
Fields
DELEGATED_MODE_VAR
public static final String DELEGATED_MODE_VAR
If present the invocation is executing within a delegated mode
Public constructors
DelegatedInvocationExecution
public DelegatedInvocationExecution ()
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: theIInvocationContextof the invocation. | 
| config | IConfiguration: theIConfigurationof this test run. | 
| exception | Throwable: the original exception thrown by the test running. | 
doSetup
public void doSetup (TestInformation testInfo, IConfiguration config, ITestLogger listener)
Execute the target_preparer and multi_target_preparer setUp step. Does all the devices setup required for the test to run.
| Parameters | |
|---|---|
| testInfo | TestInformation: theTestInformationof the invocation. | 
| config | IConfiguration: theIConfigurationof this test run. | 
| listener | ITestLogger: theITestLoggerto report setup failures logs. | 
| Throws | |
|---|---|
| BuildError | |
| DeviceNotAvailableException | |
| TargetSetupError | |
doTeardown
public void doTeardown (TestInformation testInfo, 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 | |
|---|---|
| testInfo | TestInformation: theTestInformationof the invocation. | 
| config | IConfiguration: theIConfigurationof this test run. | 
| logger | ITestLogger: theITestLoggerto report logs. | 
| exception | Throwable: the original exception thrown by the test running. | 
reportLogs
public void reportLogs (ITestDevice device, ITestLogger logger, 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. | 
| logger | ITestLogger: The logger for the logs. | 
| stage | TestInvocation.Stage: The stage of the invocation we are at. | 
runDevicePostInvocationTearDown
public void runDevicePostInvocationTearDown (IInvocationContext context, IConfiguration config, Throwable exception)
Invoke the ITestDevice.postInvocationTearDown(Throwable) for each device part of the
 invocation.
| Parameters | |
|---|---|
| context | IInvocationContext: theIInvocationContextof the invocation. | 
| config | IConfiguration: theIConfigurationof this test run. | 
| exception | Throwable: the original exception thrown by the test running if any. | 
runDevicePreInvocationSetup
public void runDevicePreInvocationSetup (IInvocationContext context, IConfiguration config, ITestLogger logger)
Invoke the ERROR(ITestDevice.preInvocationSetup(IBuildInfo)/com.android.tradefed.device.ITestDevice#preInvocationSetup(com.android.tradefed.build.IBuildInfo) ITestDevice.preInvocationSetup(IBuildInfo)) for each device part of the
 invocation.
| Parameters | |
|---|---|
| context | IInvocationContext: theIInvocationContextof the invocation. | 
| config | IConfiguration: theIConfigurationof this test run. | 
| logger | ITestLogger: theITestLoggerto report logs. | 
| Throws | |
|---|---|
| DeviceNotAvailableException | |
| TargetSetupError | |
runTests
public void runTests (TestInformation info, IConfiguration config, ITestInvocationListener listener)
Runs the test.
| Parameters | |
|---|---|
| info | TestInformation: theTestInformationto run tests with. | 
| config | IConfiguration: theIConfigurationto run | 
| listener | ITestInvocationListener: theITestInvocationListenerof test results | 
shardConfig
public boolean shardConfig (IConfiguration config, TestInformation testInfo, IRescheduler rescheduler, ITestLogger logger)
Attempt to shard the configuration into sub-configurations, to be re-scheduled to run on multiple resources in parallel.
If a shard count is greater than 1, it will simply create configs for each shard by
 setting shard indices and reschedule them. If a shard count is not set,it would fallback to
 IShardHelper.shardConfig.
| Parameters | |
|---|---|
| config | IConfiguration: the currentIConfiguration. | 
| testInfo | TestInformation: theTestInformationholding the info of the tests. | 
| rescheduler | IRescheduler: theIRescheduler. | 
| logger | ITestLogger:ITestLoggerused to log file during sharding. | 
| Returns | |
|---|---|
| boolean | true if test was sharded. Otherwise return false | 
