diff options
author | Xavier Ducrohet <xav@android.com> | 2010-07-20 17:25:36 -0700 |
---|---|---|
committer | Xavier Ducrohet <xav@android.com> | 2010-07-26 10:55:08 -0700 |
commit | 9db3286c710abeb2c9478c2f95657d945a55d176 (patch) | |
tree | d3e5b901646d1c2ee6bd3990bb8da99c05eb78d3 /ddms/libs/ddmlib/tests | |
parent | f56173887a9f6430425c93203a8c260a73b1480a (diff) | |
download | sdk-9db3286c710abeb2c9478c2f95657d945a55d176.zip sdk-9db3286c710abeb2c9478c2f95657d945a55d176.tar.gz sdk-9db3286c710abeb2c9478c2f95657d945a55d176.tar.bz2 |
Update the ddmlib api for push/pull/install
The API now throws SyncException instead of returning SyncResult.
The IDevice API to install/uninstall now returns a single
InstallException that encapsulate all the other ddmlib
exception.
Also, the recently added exceptions now don't extend IOException
anymore.
Change-Id: Ib334c4157a6add1882233dfaaa032aea1910eede
Diffstat (limited to 'ddms/libs/ddmlib/tests')
-rw-r--r-- | ddms/libs/ddmlib/tests/src/com/android/ddmlib/testrunner/RemoteAndroidTestRunnerTest.java | 45 |
1 files changed, 34 insertions, 11 deletions
diff --git a/ddms/libs/ddmlib/tests/src/com/android/ddmlib/testrunner/RemoteAndroidTestRunnerTest.java b/ddms/libs/ddmlib/tests/src/com/android/ddmlib/testrunner/RemoteAndroidTestRunnerTest.java index 9d4e77b..343efdc 100644 --- a/ddms/libs/ddmlib/tests/src/com/android/ddmlib/testrunner/RemoteAndroidTestRunnerTest.java +++ b/ddms/libs/ddmlib/tests/src/com/android/ddmlib/testrunner/RemoteAndroidTestRunnerTest.java @@ -16,12 +16,16 @@ package com.android.ddmlib.testrunner; +import com.android.ddmlib.AdbCommandRejectedException; import com.android.ddmlib.Client; import com.android.ddmlib.FileListingService; import com.android.ddmlib.IDevice; import com.android.ddmlib.IShellOutputReceiver; +import com.android.ddmlib.InstallException; import com.android.ddmlib.RawImage; +import com.android.ddmlib.ShellCommandUnresponsiveException; import com.android.ddmlib.SyncService; +import com.android.ddmlib.TimeoutException; import com.android.ddmlib.log.LogReceiver; import java.io.IOException; @@ -51,8 +55,12 @@ public class RemoteAndroidTestRunnerTest extends TestCase { /** * Test the basic case building of the instrumentation runner command with no arguments. + * @throws ShellCommandUnresponsiveException + * @throws AdbCommandRejectedException + * @throws TimeoutException */ - public void testRun() throws IOException { + public void testRun() throws IOException, TimeoutException, AdbCommandRejectedException, + ShellCommandUnresponsiveException { mRunner.run(new EmptyListener()); assertStringsEquals(String.format("am instrument -w -r %s/%s", TEST_PACKAGE, TEST_RUNNER), mMockDevice.getLastShellCommand()); @@ -60,8 +68,12 @@ public class RemoteAndroidTestRunnerTest extends TestCase { /** * Test the building of the instrumentation runner command with log set. + * @throws ShellCommandUnresponsiveException + * @throws AdbCommandRejectedException + * @throws TimeoutException */ - public void testRunWithLog() throws IOException { + public void testRunWithLog() throws IOException, TimeoutException, AdbCommandRejectedException, + ShellCommandUnresponsiveException { mRunner.setLogOnly(true); mRunner.run(new EmptyListener()); assertStringsEquals(String.format("am instrument -w -r -e log true %s/%s", TEST_PACKAGE, @@ -70,8 +82,12 @@ public class RemoteAndroidTestRunnerTest extends TestCase { /** * Test the building of the instrumentation runner command with method set. + * @throws ShellCommandUnresponsiveException + * @throws AdbCommandRejectedException + * @throws TimeoutException */ - public void testRunWithMethod() throws IOException { + public void testRunWithMethod() throws IOException, TimeoutException, + AdbCommandRejectedException, ShellCommandUnresponsiveException { final String className = "FooTest"; final String testName = "fooTest"; mRunner.setMethodName(className, testName); @@ -82,8 +98,12 @@ public class RemoteAndroidTestRunnerTest extends TestCase { /** * Test the building of the instrumentation runner command with test package set. + * @throws ShellCommandUnresponsiveException + * @throws AdbCommandRejectedException + * @throws TimeoutException */ - public void testRunWithPackage() throws IOException { + public void testRunWithPackage() throws IOException, TimeoutException, + AdbCommandRejectedException, ShellCommandUnresponsiveException { final String packageName = "foo.test"; mRunner.setTestPackageName(packageName); mRunner.run(new EmptyListener()); @@ -93,8 +113,12 @@ public class RemoteAndroidTestRunnerTest extends TestCase { /** * Test the building of the instrumentation runner command with extra argument added. + * @throws ShellCommandUnresponsiveException + * @throws AdbCommandRejectedException + * @throws TimeoutException */ - public void testRunWithAddInstrumentationArg() throws IOException { + public void testRunWithAddInstrumentationArg() throws IOException, TimeoutException, + AdbCommandRejectedException, ShellCommandUnresponsiveException { final String extraArgName = "blah"; final String extraArgValue = "blahValue"; mRunner.addInstrumentationArg(extraArgName, extraArgValue); @@ -103,7 +127,6 @@ public class RemoteAndroidTestRunnerTest extends TestCase { extraArgValue, TEST_PACKAGE, TEST_RUNNER), mMockDevice.getLastShellCommand()); } - /** * Assert two strings are equal ignoring whitespace. */ @@ -233,21 +256,21 @@ public class RemoteAndroidTestRunnerTest extends TestCase { } public String installPackage(String packageFilePath, boolean reinstall) - throws IOException { + throws InstallException { throw new UnsupportedOperationException(); } - public String uninstallPackage(String packageName) throws IOException { + public String uninstallPackage(String packageName) throws InstallException { throw new UnsupportedOperationException(); } - public String installRemotePackage(String remoteFilePath, - boolean reinstall) throws IOException { + public String installRemotePackage(String remoteFilePath, boolean reinstall) + throws InstallException { throw new UnsupportedOperationException(); } public void removeRemotePackage(String remoteFilePath) - throws IOException { + throws InstallException { throw new UnsupportedOperationException(); } |