diff options
author | jdesprez <jdesprez@google.com> | 2017-06-21 09:13:20 -0700 |
---|---|---|
committer | jdesprez <jdesprez@google.com> | 2017-06-21 09:14:12 -0700 |
commit | c304e037429e79e45d0b9625ad7955e96411b3aa (patch) | |
tree | b62e13629f8222fe8942b7096ad051fea0e32021 | |
parent | 1c18c8678de95ab20398e687af58b66f0a1594d5 (diff) | |
download | tradefederation-c304e037429e79e45d0b9625ad7955e96411b3aa.tar.gz |
Deprecate the legacy single device invoke() callback
Remove the deprecated invoke() callback that existed before
multi device support.
Test: unit tests, func tests
Change-Id: Ia3b74912234d15f0e95dd4967153ce87b12fe55f
3 files changed, 8 insertions, 58 deletions
diff --git a/src/com/android/tradefed/invoker/ITestInvocation.java b/src/com/android/tradefed/invoker/ITestInvocation.java index d2d29c1a3..0214071cc 100644 --- a/src/com/android/tradefed/invoker/ITestInvocation.java +++ b/src/com/android/tradefed/invoker/ITestInvocation.java @@ -18,7 +18,6 @@ package com.android.tradefed.invoker; import com.android.tradefed.config.IConfiguration; import com.android.tradefed.device.DeviceNotAvailableException; -import com.android.tradefed.device.ITestDevice; import com.android.tradefed.result.ITestInvocationListener; /** @@ -28,26 +27,6 @@ public interface ITestInvocation { /** * Perform the test invocation. - * FIXME: Remove when fully moved to new interface. - * - * @param device the {@link ITestDevice} to perform tests. - * @param config the {@link IConfiguration} of this test run. - * @param rescheduler the {@link IRescheduler}, for rescheduling portions of the invocation for - * execution on another resource(s) - * @param extraListeners {@link ITestInvocationListener}s to notify, in addition to those in - * <var>config</var> - * @throws DeviceNotAvailableException if communication with device was lost - * @throws Throwable - * @deprecated Use {@link #invoke(IInvocationContext, IConfiguration, IRescheduler, - * ITestInvocationListener...)} instead. - */ - @Deprecated - public void invoke(ITestDevice device, IConfiguration config, IRescheduler rescheduler, - ITestInvocationListener... extraListeners) throws DeviceNotAvailableException, - Throwable; - - /** - * Perform the test invocation. * * @param metadata the {@link IInvocationContext} to perform tests. * @param config the {@link IConfiguration} of this test run. diff --git a/src/com/android/tradefed/invoker/TestInvocation.java b/src/com/android/tradefed/invoker/TestInvocation.java index f08cbbb3a..2d42caac0 100644 --- a/src/com/android/tradefed/invoker/TestInvocation.java +++ b/src/com/android/tradefed/invoker/TestInvocation.java @@ -22,7 +22,6 @@ import com.android.tradefed.build.IBuildInfo; import com.android.tradefed.build.IBuildProvider; import com.android.tradefed.build.IDeviceBuildProvider; import com.android.tradefed.command.CommandRunner.ExitCode; -import com.android.tradefed.config.ConfigurationDef; import com.android.tradefed.config.GlobalConfiguration; import com.android.tradefed.config.IConfiguration; import com.android.tradefed.config.IDeviceConfiguration; @@ -153,22 +152,6 @@ public class TestInvocation implements ITestInvocation { } /** - * {@inheritDoc} - * @deprecated use {@link #invoke(IInvocationContext, IConfiguration, IRescheduler, - ITestInvocationListener[])} instead. - */ - @Override - @Deprecated - public void invoke(ITestDevice device, IConfiguration config, IRescheduler rescheduler, - ITestInvocationListener... extraListeners) - throws DeviceNotAvailableException, Throwable { - IInvocationContext context = new InvocationContext(); - context.setConfigurationDescriptor(config.getConfigurationDescription()); - context.addAllocatedDevice(ConfigurationDef.DEFAULT_DEVICE_NAME, device); - invoke(context, config, rescheduler, extraListeners); - } - - /** * Attempt to shard the configuration into sub-configurations, to be re-scheduled to run on * multiple resources in parallel. * diff --git a/tests/src/com/android/tradefed/command/CommandSchedulerFuncTest.java b/tests/src/com/android/tradefed/command/CommandSchedulerFuncTest.java index f05f2ab61..0ad2d9993 100644 --- a/tests/src/com/android/tradefed/command/CommandSchedulerFuncTest.java +++ b/tests/src/com/android/tradefed/command/CommandSchedulerFuncTest.java @@ -199,9 +199,11 @@ public class CommandSchedulerFuncTest extends TestCase { public boolean runInterrupted = false; public boolean printedStop = false; - @Deprecated @Override - public void invoke(ITestDevice device, IConfiguration config, IRescheduler rescheduler, + public void invoke( + IInvocationContext metadata, + IConfiguration config, + IRescheduler rescheduler, ITestInvocationListener... listeners) throws DeviceNotAvailableException { try { @@ -239,14 +241,6 @@ public class CommandSchedulerFuncTest extends TestCase { } @Override - public void invoke( - IInvocationContext metadata, IConfiguration config, IRescheduler rescheduler, - ITestInvocationListener... extraListeners) - throws DeviceNotAvailableException, Throwable { - invoke(metadata.getDevices().get(0), config, rescheduler, extraListeners); - } - - @Override public void notifyInvocationStopped() { printedStop = true; } @@ -467,9 +461,11 @@ public class CommandSchedulerFuncTest extends TestCase { mIteration = iteration; } - @Deprecated @Override - public void invoke(ITestDevice device, IConfiguration config, IRescheduler rescheduler, + public void invoke( + IInvocationContext metadata, + IConfiguration config, + IRescheduler rescheduler, ITestInvocationListener... listeners) throws DeviceNotAvailableException { try { @@ -492,14 +488,6 @@ public class CommandSchedulerFuncTest extends TestCase { } } } - - @Override - public void invoke( - IInvocationContext metadata, IConfiguration config, IRescheduler rescheduler, - ITestInvocationListener... extraListeners) - throws DeviceNotAvailableException, Throwable { - invoke(metadata.getDevices().get(0), config, rescheduler, extraListeners); - } } /** |