From 72d5de71f205d1c7f43c495d01185b0fbba7c47f Mon Sep 17 00:00:00 2001 From: Andy Stadler <> Date: Tue, 21 Apr 2009 11:54:14 -0700 Subject: [PATCH] AI 147169: am: CL 147167 am: CL 147162 Emphasize in the javadoc that the "pkg" parameters to InstrumentationTestCase and its descendants should be the package manager package name (not the java package name, and not the test package) of the package holding the Activity under test. Added similar notations to the ApiDemos call sites. JAVADOC ONLY - should be safe change for cupcake sdk. Original author: stadler Merged from: //branches/cupcake/... Original author: android-build Automated import of CL 147169 --- core/java/android/test/InstrumentationTestCase.java | 9 +++++++++ .../test/ActivityInstrumentationTestCase.java | 12 ++++++++++-- .../test/ActivityInstrumentationTestCase2.java | 6 +++++- .../android/test/SingleLaunchActivityTestCase.java | 6 +++++- 4 files changed, 29 insertions(+), 4 deletions(-) diff --git a/core/java/android/test/InstrumentationTestCase.java b/core/java/android/test/InstrumentationTestCase.java index 82f2ef9dd8ebb..470ab0d9a48e6 100644 --- a/core/java/android/test/InstrumentationTestCase.java +++ b/core/java/android/test/InstrumentationTestCase.java @@ -62,6 +62,10 @@ public class InstrumentationTestCase extends TestCase { * action = {@link Intent#ACTION_MAIN} * extras = null, unless a custom bundle is provided here * All other fields are null or empty. + * + *

NOTE: The parameter pkg must refer to the package identifier of the + * package hosting the activity to be launched, which is specified in the AndroidManifest.xml + * file. This is not necessarily the same as the java package name. * * @param pkg The package hosting the activity to be launched. * @param activityCls The activity class to launch. @@ -82,6 +86,11 @@ public class InstrumentationTestCase extends TestCase { /** * Utility method for launching an activity with a specific Intent. + * + *

NOTE: The parameter pkg must refer to the package identifier of the + * package hosting the activity to be launched, which is specified in the AndroidManifest.xml + * file. This is not necessarily the same as the java package name. + * * @param pkg The package hosting the activity to be launched. * @param activityCls The activity class to launch. * @param intent The intent to launch with diff --git a/test-runner/android/test/ActivityInstrumentationTestCase.java b/test-runner/android/test/ActivityInstrumentationTestCase.java index e5a9991ae5571..f6b31ad208f7d 100644 --- a/test-runner/android/test/ActivityInstrumentationTestCase.java +++ b/test-runner/android/test/ActivityInstrumentationTestCase.java @@ -40,7 +40,11 @@ public abstract class ActivityInstrumentationTestCase boolean mInitialTouchMode = false; /** - * @param pkg The package of the instrumentation. + * NOTE: The parameter pkg must refer to the package identifier of the + * package hosting the activity to be launched, which is specified in the AndroidManifest.xml + * file. This is not necessarily the same as the java package name. + * + * @param pkg The package hosting the activity to be launched. * @param activityClass The activity to test. */ public ActivityInstrumentationTestCase(String pkg, Class activityClass) { @@ -48,7 +52,11 @@ public abstract class ActivityInstrumentationTestCase } /** - * @param pkg The package of the instrumentation. + * NOTE: The parameter pkg must refer to the package identifier of the + * package hosting the activity to be launched, which is specified in the AndroidManifest.xml + * file. This is not necessarily the same as the java package name. + * + * @param pkg The package hosting the activity to be launched. * @param activityClass The activity to test. * @param initialTouchMode true = in touch mode */ diff --git a/test-runner/android/test/ActivityInstrumentationTestCase2.java b/test-runner/android/test/ActivityInstrumentationTestCase2.java index 7a84ecae7b388..679f6346537b9 100644 --- a/test-runner/android/test/ActivityInstrumentationTestCase2.java +++ b/test-runner/android/test/ActivityInstrumentationTestCase2.java @@ -46,7 +46,11 @@ public abstract class ActivityInstrumentationTestCase2 Intent mActivityIntent = null; /** - * @param pkg The package of the instrumentation. + * NOTE: The parameter pkg must refer to the package identifier of the + * package hosting the activity to be launched, which is specified in the AndroidManifest.xml + * file. This is not necessarily the same as the java package name. + * + * @param pkg The package hosting the activity to be launched. * @param activityClass The activity to test. */ public ActivityInstrumentationTestCase2(String pkg, Class activityClass) { diff --git a/test-runner/android/test/SingleLaunchActivityTestCase.java b/test-runner/android/test/SingleLaunchActivityTestCase.java index 8d43b732cf857..b63b3ce19759c 100644 --- a/test-runner/android/test/SingleLaunchActivityTestCase.java +++ b/test-runner/android/test/SingleLaunchActivityTestCase.java @@ -37,7 +37,11 @@ public abstract class SingleLaunchActivityTestCase private static boolean sActivityLaunchedFlag = false; /** - * @param pkg The package of the instrumentation. + * NOTE: The parameter pkg must refer to the package identifier of the + * package hosting the activity to be launched, which is specified in the AndroidManifest.xml + * file. This is not necessarily the same as the java package name. + * + * @param pkg The package hosting the activity to be launched. * @param activityClass The activity to test. */ public SingleLaunchActivityTestCase(String pkg, Class activityClass) {