Merge "Deprecated platform Android testing APIs"
diff --git a/api/current.txt b/api/current.txt
index ebeaefc..aa503af 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -37186,7 +37186,7 @@
method public void testActivityTestCaseSetUpProperly() throws java.lang.Exception;
}
- public abstract class ActivityInstrumentationTestCase2 extends android.test.ActivityTestCase {
+ public abstract deprecated class ActivityInstrumentationTestCase2 extends android.test.ActivityTestCase {
ctor public deprecated ActivityInstrumentationTestCase2(java.lang.String, java.lang.Class<T>);
ctor public ActivityInstrumentationTestCase2(java.lang.Class<T>);
method public T getActivity();
@@ -37194,14 +37194,14 @@
method public void setActivityIntent(android.content.Intent);
}
- public abstract class ActivityTestCase extends android.test.InstrumentationTestCase {
+ public abstract deprecated class ActivityTestCase extends android.test.InstrumentationTestCase {
ctor public ActivityTestCase();
method protected android.app.Activity getActivity();
method protected void scrubClass(java.lang.Class<?>) throws java.lang.IllegalAccessException;
method protected void setActivity(android.app.Activity);
}
- public abstract class ActivityUnitTestCase extends android.test.ActivityTestCase {
+ public abstract deprecated class ActivityUnitTestCase extends android.test.ActivityTestCase {
ctor public ActivityUnitTestCase(java.lang.Class<T>);
method public T getActivity();
method public int getFinishedActivityRequest();
@@ -37214,7 +37214,7 @@
method protected T startActivity(android.content.Intent, android.os.Bundle, java.lang.Object);
}
- public class AndroidTestCase extends junit.framework.TestCase {
+ public deprecated class AndroidTestCase extends junit.framework.TestCase {
ctor public AndroidTestCase();
method public void assertActivityRequiresPermission(java.lang.String, java.lang.String, java.lang.String);
method public void assertReadingContentUriRequiresPermission(android.net.Uri, java.lang.String);
@@ -37226,7 +37226,7 @@
field protected android.content.Context mContext;
}
- public class AndroidTestRunner extends junit.runner.BaseTestRunner {
+ public deprecated class AndroidTestRunner extends junit.runner.BaseTestRunner {
ctor public AndroidTestRunner();
method public void addTestListener(junit.framework.TestListener);
method public void clearTestListeners();
@@ -37247,7 +37247,7 @@
method public void testStarted(java.lang.String);
}
- public abstract class ApplicationTestCase extends android.test.AndroidTestCase {
+ public abstract deprecated class ApplicationTestCase extends android.test.AndroidTestCase {
ctor public ApplicationTestCase(java.lang.Class<T>);
method protected final void createApplication();
method public T getApplication();
@@ -37265,10 +37265,10 @@
ctor public ComparisonFailure(java.lang.String, java.lang.String, java.lang.String);
}
- public abstract class FlakyTest implements java.lang.annotation.Annotation {
+ public abstract deprecated class FlakyTest implements java.lang.annotation.Annotation {
}
- public class InstrumentationTestCase extends junit.framework.TestCase {
+ public deprecated class InstrumentationTestCase extends junit.framework.TestCase {
ctor public InstrumentationTestCase();
method public android.app.Instrumentation getInstrumentation();
method public deprecated void injectInsrumentation(android.app.Instrumentation);
@@ -37281,7 +37281,7 @@
method public void sendRepeatedKeys(int...);
}
- public class InstrumentationTestRunner extends android.app.Instrumentation implements android.test.TestSuiteProvider {
+ public deprecated class InstrumentationTestRunner extends android.app.Instrumentation implements android.test.TestSuiteProvider {
ctor public InstrumentationTestRunner();
method public junit.framework.TestSuite getAllTests();
method protected android.test.AndroidTestRunner getAndroidTestRunner();
@@ -37300,14 +37300,14 @@
field public static final int REPORT_VALUE_RESULT_START = 1; // 0x1
}
- public class InstrumentationTestSuite extends junit.framework.TestSuite {
+ public deprecated class InstrumentationTestSuite extends junit.framework.TestSuite {
ctor public InstrumentationTestSuite(android.app.Instrumentation);
ctor public InstrumentationTestSuite(java.lang.String, android.app.Instrumentation);
ctor public InstrumentationTestSuite(java.lang.Class, android.app.Instrumentation);
method public void addTestSuite(java.lang.Class);
}
- public class IsolatedContext extends android.content.ContextWrapper {
+ public deprecated class IsolatedContext extends android.content.ContextWrapper {
ctor public IsolatedContext(android.content.ContentResolver, android.content.Context);
method public java.util.List<android.content.Intent> getAndClearBroadcastIntents();
}
@@ -37317,7 +37317,7 @@
method public T getLoaderResultSynchronously(android.content.Loader<T>);
}
- public final class MoreAsserts {
+ public final deprecated class MoreAsserts {
method public static void assertAssignableFrom(java.lang.Class<?>, java.lang.Object);
method public static void assertAssignableFrom(java.lang.Class<?>, java.lang.Class<?>);
method public static java.util.regex.MatchResult assertContainsRegex(java.lang.String, java.lang.String, java.lang.String);
@@ -37356,7 +37356,7 @@
method public static void checkEqualsAndHashCodeMethods(java.lang.Object, java.lang.Object, boolean);
}
- public abstract interface PerformanceTestCase {
+ public abstract deprecated interface PerformanceTestCase {
method public abstract boolean isPerformanceOnly();
method public abstract int startPerformance(android.test.PerformanceTestCase.Intermediates);
}
@@ -37385,7 +37385,7 @@
method public static android.content.ContentResolver newResolverWithContentProviderFromSql(android.content.Context, java.lang.String, java.lang.Class<T>, java.lang.String, java.lang.String, int, java.lang.String) throws java.lang.IllegalAccessException, java.lang.InstantiationException;
}
- public class RenamingDelegatingContext extends android.content.ContextWrapper {
+ public deprecated class RenamingDelegatingContext extends android.content.ContextWrapper {
ctor public RenamingDelegatingContext(android.content.Context, java.lang.String);
ctor public RenamingDelegatingContext(android.content.Context, android.content.Context, java.lang.String);
method public java.lang.String getDatabasePrefix();
@@ -37394,7 +37394,7 @@
method public static T providerWithRenamedContext(java.lang.Class<T>, android.content.Context, java.lang.String, boolean) throws java.lang.IllegalAccessException, java.lang.InstantiationException;
}
- public abstract class ServiceTestCase extends android.test.AndroidTestCase {
+ public abstract deprecated class ServiceTestCase extends android.test.AndroidTestCase {
ctor public ServiceTestCase(java.lang.Class<T>);
method protected android.os.IBinder bindService(android.content.Intent);
method public android.app.Application getApplication();
@@ -37407,23 +37407,23 @@
method public void testServiceTestCaseSetUpProperly() throws java.lang.Exception;
}
- public abstract class SingleLaunchActivityTestCase extends android.test.InstrumentationTestCase {
+ public abstract deprecated class SingleLaunchActivityTestCase extends android.test.InstrumentationTestCase {
ctor public SingleLaunchActivityTestCase(java.lang.String, java.lang.Class<T>);
method public T getActivity();
method public void testActivityTestCaseSetUpProperly() throws java.lang.Exception;
}
- public class SyncBaseInstrumentation extends android.test.InstrumentationTestCase {
+ public deprecated class SyncBaseInstrumentation extends android.test.InstrumentationTestCase {
ctor public SyncBaseInstrumentation();
method protected void cancelSyncsandDisableAutoSync();
method protected void syncProvider(android.net.Uri, java.lang.String, java.lang.String) throws java.lang.Exception;
}
- public abstract interface TestSuiteProvider {
+ public abstract deprecated interface TestSuiteProvider {
method public abstract junit.framework.TestSuite getTestSuite();
}
- public class TouchUtils {
+ public deprecated class TouchUtils {
ctor public TouchUtils();
method public static void clickView(android.test.InstrumentationTestCase, android.view.View);
method public static deprecated void drag(android.test.ActivityInstrumentationTestCase, float, float, float, float, int);
@@ -37458,10 +37458,10 @@
method public static void touchAndCancelView(android.test.InstrumentationTestCase, android.view.View);
}
- public abstract class UiThreadTest implements java.lang.annotation.Annotation {
+ public abstract deprecated class UiThreadTest implements java.lang.annotation.Annotation {
}
- public class ViewAsserts {
+ public deprecated class ViewAsserts {
method public static void assertBaselineAligned(android.view.View, android.view.View);
method public static void assertBottomAligned(android.view.View, android.view.View);
method public static void assertBottomAligned(android.view.View, android.view.View, int);
@@ -37486,11 +37486,11 @@
package android.test.mock {
- public class MockApplication extends android.app.Application {
+ public deprecated class MockApplication extends android.app.Application {
ctor public MockApplication();
}
- public class MockContentProvider extends android.content.ContentProvider {
+ public deprecated class MockContentProvider extends android.content.ContentProvider {
ctor protected MockContentProvider();
ctor public MockContentProvider(android.content.Context);
ctor public MockContentProvider(android.content.Context, java.lang.String, java.lang.String, android.content.pm.PathPermission[]);
@@ -37502,13 +37502,13 @@
method public int update(android.net.Uri, android.content.ContentValues, java.lang.String, java.lang.String[]);
}
- public class MockContentResolver extends android.content.ContentResolver {
+ public deprecated class MockContentResolver extends android.content.ContentResolver {
ctor public MockContentResolver();
ctor public MockContentResolver(android.content.Context);
method public void addProvider(java.lang.String, android.content.ContentProvider);
}
- public class MockContext extends android.content.Context {
+ public deprecated class MockContext extends android.content.Context {
ctor public MockContext();
method public boolean bindService(android.content.Intent, android.content.ServiceConnection, int);
method public int checkCallingOrSelfPermission(java.lang.String);
@@ -37608,7 +37608,7 @@
method public void unregisterReceiver(android.content.BroadcastReceiver);
}
- public class MockCursor implements android.database.Cursor {
+ public deprecated class MockCursor implements android.database.Cursor {
ctor public MockCursor();
method public void close();
method public void copyStringToBuffer(int, android.database.CharArrayBuffer);
@@ -37653,13 +37653,13 @@
method public void unregisterDataSetObserver(android.database.DataSetObserver);
}
- public class MockDialogInterface implements android.content.DialogInterface {
+ public deprecated class MockDialogInterface implements android.content.DialogInterface {
ctor public MockDialogInterface();
method public void cancel();
method public void dismiss();
}
- public class MockPackageManager extends android.content.pm.PackageManager {
+ public deprecated class MockPackageManager extends android.content.pm.PackageManager {
ctor public MockPackageManager();
method public void addPackageToPreferred(java.lang.String);
method public boolean addPermission(android.content.pm.PermissionInfo);
@@ -37746,7 +37746,7 @@
method public void verifyPendingInstall(int, int);
}
- public class MockResources extends android.content.res.Resources {
+ public deprecated class MockResources extends android.content.res.Resources {
ctor public MockResources();
}
@@ -37787,19 +37787,19 @@
package android.test.suitebuilder.annotation {
- public abstract class LargeTest implements java.lang.annotation.Annotation {
+ public abstract deprecated class LargeTest implements java.lang.annotation.Annotation {
}
- public abstract class MediumTest implements java.lang.annotation.Annotation {
+ public abstract deprecated class MediumTest implements java.lang.annotation.Annotation {
}
- public abstract class SmallTest implements java.lang.annotation.Annotation {
+ public abstract deprecated class SmallTest implements java.lang.annotation.Annotation {
}
- public abstract class Smoke implements java.lang.annotation.Annotation {
+ public abstract deprecated class Smoke implements java.lang.annotation.Annotation {
}
- public abstract class Suppress implements java.lang.annotation.Annotation {
+ public abstract deprecated class Suppress implements java.lang.annotation.Annotation {
}
}
diff --git a/api/removed.txt b/api/removed.txt
index 6b7961e..2c6729d 100644
--- a/api/removed.txt
+++ b/api/removed.txt
@@ -201,7 +201,7 @@
package android.test.mock {
- public class MockPackageManager extends android.content.pm.PackageManager {
+ public deprecated class MockPackageManager extends android.content.pm.PackageManager {
method public deprecated java.lang.String getDefaultBrowserPackageName(int);
method public deprecated boolean setDefaultBrowserPackageName(java.lang.String, int);
}
diff --git a/api/system-current.txt b/api/system-current.txt
index 07e30a8..95c19d7 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -39446,7 +39446,7 @@
method public void testActivityTestCaseSetUpProperly() throws java.lang.Exception;
}
- public abstract class ActivityInstrumentationTestCase2 extends android.test.ActivityTestCase {
+ public abstract deprecated class ActivityInstrumentationTestCase2 extends android.test.ActivityTestCase {
ctor public deprecated ActivityInstrumentationTestCase2(java.lang.String, java.lang.Class<T>);
ctor public ActivityInstrumentationTestCase2(java.lang.Class<T>);
method public T getActivity();
@@ -39454,14 +39454,14 @@
method public void setActivityIntent(android.content.Intent);
}
- public abstract class ActivityTestCase extends android.test.InstrumentationTestCase {
+ public abstract deprecated class ActivityTestCase extends android.test.InstrumentationTestCase {
ctor public ActivityTestCase();
method protected android.app.Activity getActivity();
method protected void scrubClass(java.lang.Class<?>) throws java.lang.IllegalAccessException;
method protected void setActivity(android.app.Activity);
}
- public abstract class ActivityUnitTestCase extends android.test.ActivityTestCase {
+ public abstract deprecated class ActivityUnitTestCase extends android.test.ActivityTestCase {
ctor public ActivityUnitTestCase(java.lang.Class<T>);
method public T getActivity();
method public int getFinishedActivityRequest();
@@ -39474,7 +39474,7 @@
method protected T startActivity(android.content.Intent, android.os.Bundle, java.lang.Object);
}
- public class AndroidTestCase extends junit.framework.TestCase {
+ public deprecated class AndroidTestCase extends junit.framework.TestCase {
ctor public AndroidTestCase();
method public void assertActivityRequiresPermission(java.lang.String, java.lang.String, java.lang.String);
method public void assertReadingContentUriRequiresPermission(android.net.Uri, java.lang.String);
@@ -39486,7 +39486,7 @@
field protected android.content.Context mContext;
}
- public class AndroidTestRunner extends junit.runner.BaseTestRunner {
+ public deprecated class AndroidTestRunner extends junit.runner.BaseTestRunner {
ctor public AndroidTestRunner();
method public void addTestListener(junit.framework.TestListener);
method public void clearTestListeners();
@@ -39507,7 +39507,7 @@
method public void testStarted(java.lang.String);
}
- public abstract class ApplicationTestCase extends android.test.AndroidTestCase {
+ public abstract deprecated class ApplicationTestCase extends android.test.AndroidTestCase {
ctor public ApplicationTestCase(java.lang.Class<T>);
method protected final void createApplication();
method public T getApplication();
@@ -39525,10 +39525,10 @@
ctor public ComparisonFailure(java.lang.String, java.lang.String, java.lang.String);
}
- public abstract class FlakyTest implements java.lang.annotation.Annotation {
+ public abstract deprecated class FlakyTest implements java.lang.annotation.Annotation {
}
- public class InstrumentationTestCase extends junit.framework.TestCase {
+ public deprecated class InstrumentationTestCase extends junit.framework.TestCase {
ctor public InstrumentationTestCase();
method public android.app.Instrumentation getInstrumentation();
method public deprecated void injectInsrumentation(android.app.Instrumentation);
@@ -39541,7 +39541,7 @@
method public void sendRepeatedKeys(int...);
}
- public class InstrumentationTestRunner extends android.app.Instrumentation implements android.test.TestSuiteProvider {
+ public deprecated class InstrumentationTestRunner extends android.app.Instrumentation implements android.test.TestSuiteProvider {
ctor public InstrumentationTestRunner();
method public junit.framework.TestSuite getAllTests();
method protected android.test.AndroidTestRunner getAndroidTestRunner();
@@ -39560,14 +39560,14 @@
field public static final int REPORT_VALUE_RESULT_START = 1; // 0x1
}
- public class InstrumentationTestSuite extends junit.framework.TestSuite {
+ public deprecated class InstrumentationTestSuite extends junit.framework.TestSuite {
ctor public InstrumentationTestSuite(android.app.Instrumentation);
ctor public InstrumentationTestSuite(java.lang.String, android.app.Instrumentation);
ctor public InstrumentationTestSuite(java.lang.Class, android.app.Instrumentation);
method public void addTestSuite(java.lang.Class);
}
- public class IsolatedContext extends android.content.ContextWrapper {
+ public deprecated class IsolatedContext extends android.content.ContextWrapper {
ctor public IsolatedContext(android.content.ContentResolver, android.content.Context);
method public java.util.List<android.content.Intent> getAndClearBroadcastIntents();
}
@@ -39577,7 +39577,7 @@
method public T getLoaderResultSynchronously(android.content.Loader<T>);
}
- public final class MoreAsserts {
+ public final deprecated class MoreAsserts {
method public static void assertAssignableFrom(java.lang.Class<?>, java.lang.Object);
method public static void assertAssignableFrom(java.lang.Class<?>, java.lang.Class<?>);
method public static java.util.regex.MatchResult assertContainsRegex(java.lang.String, java.lang.String, java.lang.String);
@@ -39616,7 +39616,7 @@
method public static void checkEqualsAndHashCodeMethods(java.lang.Object, java.lang.Object, boolean);
}
- public abstract interface PerformanceTestCase {
+ public abstract deprecated interface PerformanceTestCase {
method public abstract boolean isPerformanceOnly();
method public abstract int startPerformance(android.test.PerformanceTestCase.Intermediates);
}
@@ -39645,7 +39645,7 @@
method public static android.content.ContentResolver newResolverWithContentProviderFromSql(android.content.Context, java.lang.String, java.lang.Class<T>, java.lang.String, java.lang.String, int, java.lang.String) throws java.lang.IllegalAccessException, java.lang.InstantiationException;
}
- public class RenamingDelegatingContext extends android.content.ContextWrapper {
+ public deprecated class RenamingDelegatingContext extends android.content.ContextWrapper {
ctor public RenamingDelegatingContext(android.content.Context, java.lang.String);
ctor public RenamingDelegatingContext(android.content.Context, android.content.Context, java.lang.String);
method public java.lang.String getDatabasePrefix();
@@ -39654,7 +39654,7 @@
method public static T providerWithRenamedContext(java.lang.Class<T>, android.content.Context, java.lang.String, boolean) throws java.lang.IllegalAccessException, java.lang.InstantiationException;
}
- public abstract class ServiceTestCase extends android.test.AndroidTestCase {
+ public abstract deprecated class ServiceTestCase extends android.test.AndroidTestCase {
ctor public ServiceTestCase(java.lang.Class<T>);
method protected android.os.IBinder bindService(android.content.Intent);
method public android.app.Application getApplication();
@@ -39667,23 +39667,23 @@
method public void testServiceTestCaseSetUpProperly() throws java.lang.Exception;
}
- public abstract class SingleLaunchActivityTestCase extends android.test.InstrumentationTestCase {
+ public abstract deprecated class SingleLaunchActivityTestCase extends android.test.InstrumentationTestCase {
ctor public SingleLaunchActivityTestCase(java.lang.String, java.lang.Class<T>);
method public T getActivity();
method public void testActivityTestCaseSetUpProperly() throws java.lang.Exception;
}
- public class SyncBaseInstrumentation extends android.test.InstrumentationTestCase {
+ public deprecated class SyncBaseInstrumentation extends android.test.InstrumentationTestCase {
ctor public SyncBaseInstrumentation();
method protected void cancelSyncsandDisableAutoSync();
method protected void syncProvider(android.net.Uri, java.lang.String, java.lang.String) throws java.lang.Exception;
}
- public abstract interface TestSuiteProvider {
+ public abstract deprecated interface TestSuiteProvider {
method public abstract junit.framework.TestSuite getTestSuite();
}
- public class TouchUtils {
+ public deprecated class TouchUtils {
ctor public TouchUtils();
method public static void clickView(android.test.InstrumentationTestCase, android.view.View);
method public static deprecated void drag(android.test.ActivityInstrumentationTestCase, float, float, float, float, int);
@@ -39718,10 +39718,10 @@
method public static void touchAndCancelView(android.test.InstrumentationTestCase, android.view.View);
}
- public abstract class UiThreadTest implements java.lang.annotation.Annotation {
+ public abstract deprecated class UiThreadTest implements java.lang.annotation.Annotation {
}
- public class ViewAsserts {
+ public deprecated class ViewAsserts {
method public static void assertBaselineAligned(android.view.View, android.view.View);
method public static void assertBottomAligned(android.view.View, android.view.View);
method public static void assertBottomAligned(android.view.View, android.view.View, int);
@@ -39746,11 +39746,11 @@
package android.test.mock {
- public class MockApplication extends android.app.Application {
+ public deprecated class MockApplication extends android.app.Application {
ctor public MockApplication();
}
- public class MockContentProvider extends android.content.ContentProvider {
+ public deprecated class MockContentProvider extends android.content.ContentProvider {
ctor protected MockContentProvider();
ctor public MockContentProvider(android.content.Context);
ctor public MockContentProvider(android.content.Context, java.lang.String, java.lang.String, android.content.pm.PathPermission[]);
@@ -39762,13 +39762,13 @@
method public int update(android.net.Uri, android.content.ContentValues, java.lang.String, java.lang.String[]);
}
- public class MockContentResolver extends android.content.ContentResolver {
+ public deprecated class MockContentResolver extends android.content.ContentResolver {
ctor public MockContentResolver();
ctor public MockContentResolver(android.content.Context);
method public void addProvider(java.lang.String, android.content.ContentProvider);
}
- public class MockContext extends android.content.Context {
+ public deprecated class MockContext extends android.content.Context {
ctor public MockContext();
method public boolean bindService(android.content.Intent, android.content.ServiceConnection, int);
method public int checkCallingOrSelfPermission(java.lang.String);
@@ -39872,7 +39872,7 @@
method public void unregisterReceiver(android.content.BroadcastReceiver);
}
- public class MockCursor implements android.database.Cursor {
+ public deprecated class MockCursor implements android.database.Cursor {
ctor public MockCursor();
method public void close();
method public void copyStringToBuffer(int, android.database.CharArrayBuffer);
@@ -39917,13 +39917,13 @@
method public void unregisterDataSetObserver(android.database.DataSetObserver);
}
- public class MockDialogInterface implements android.content.DialogInterface {
+ public deprecated class MockDialogInterface implements android.content.DialogInterface {
ctor public MockDialogInterface();
method public void cancel();
method public void dismiss();
}
- public class MockPackageManager extends android.content.pm.PackageManager {
+ public deprecated class MockPackageManager extends android.content.pm.PackageManager {
ctor public MockPackageManager();
method public void addOnPermissionsChangeListener(android.content.pm.PackageManager.OnPermissionsChangedListener);
method public void addPackageToPreferred(java.lang.String);
@@ -40017,7 +40017,7 @@
method public void verifyPendingInstall(int, int);
}
- public class MockResources extends android.content.res.Resources {
+ public deprecated class MockResources extends android.content.res.Resources {
ctor public MockResources();
}
@@ -40058,19 +40058,19 @@
package android.test.suitebuilder.annotation {
- public abstract class LargeTest implements java.lang.annotation.Annotation {
+ public abstract deprecated class LargeTest implements java.lang.annotation.Annotation {
}
- public abstract class MediumTest implements java.lang.annotation.Annotation {
+ public abstract deprecated class MediumTest implements java.lang.annotation.Annotation {
}
- public abstract class SmallTest implements java.lang.annotation.Annotation {
+ public abstract deprecated class SmallTest implements java.lang.annotation.Annotation {
}
- public abstract class Smoke implements java.lang.annotation.Annotation {
+ public abstract deprecated class Smoke implements java.lang.annotation.Annotation {
}
- public abstract class Suppress implements java.lang.annotation.Annotation {
+ public abstract deprecated class Suppress implements java.lang.annotation.Annotation {
}
}
diff --git a/api/system-removed.txt b/api/system-removed.txt
index 90a5dc7..27de913 100644
--- a/api/system-removed.txt
+++ b/api/system-removed.txt
@@ -192,7 +192,7 @@
package android.test.mock {
- public class MockPackageManager extends android.content.pm.PackageManager {
+ public deprecated class MockPackageManager extends android.content.pm.PackageManager {
method public deprecated java.lang.String getDefaultBrowserPackageName(int);
method public deprecated boolean setDefaultBrowserPackageName(java.lang.String, int);
}
diff --git a/api/test-current.txt b/api/test-current.txt
index ddb7dc9..081c471 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -37201,7 +37201,7 @@
method public void testActivityTestCaseSetUpProperly() throws java.lang.Exception;
}
- public abstract class ActivityInstrumentationTestCase2 extends android.test.ActivityTestCase {
+ public abstract deprecated class ActivityInstrumentationTestCase2 extends android.test.ActivityTestCase {
ctor public deprecated ActivityInstrumentationTestCase2(java.lang.String, java.lang.Class<T>);
ctor public ActivityInstrumentationTestCase2(java.lang.Class<T>);
method public T getActivity();
@@ -37209,14 +37209,14 @@
method public void setActivityIntent(android.content.Intent);
}
- public abstract class ActivityTestCase extends android.test.InstrumentationTestCase {
+ public abstract deprecated class ActivityTestCase extends android.test.InstrumentationTestCase {
ctor public ActivityTestCase();
method protected android.app.Activity getActivity();
method protected void scrubClass(java.lang.Class<?>) throws java.lang.IllegalAccessException;
method protected void setActivity(android.app.Activity);
}
- public abstract class ActivityUnitTestCase extends android.test.ActivityTestCase {
+ public abstract deprecated class ActivityUnitTestCase extends android.test.ActivityTestCase {
ctor public ActivityUnitTestCase(java.lang.Class<T>);
method public T getActivity();
method public int getFinishedActivityRequest();
@@ -37229,7 +37229,7 @@
method protected T startActivity(android.content.Intent, android.os.Bundle, java.lang.Object);
}
- public class AndroidTestCase extends junit.framework.TestCase {
+ public deprecated class AndroidTestCase extends junit.framework.TestCase {
ctor public AndroidTestCase();
method public void assertActivityRequiresPermission(java.lang.String, java.lang.String, java.lang.String);
method public void assertReadingContentUriRequiresPermission(android.net.Uri, java.lang.String);
@@ -37241,7 +37241,7 @@
field protected android.content.Context mContext;
}
- public class AndroidTestRunner extends junit.runner.BaseTestRunner {
+ public deprecated class AndroidTestRunner extends junit.runner.BaseTestRunner {
ctor public AndroidTestRunner();
method public void addTestListener(junit.framework.TestListener);
method public void clearTestListeners();
@@ -37262,7 +37262,7 @@
method public void testStarted(java.lang.String);
}
- public abstract class ApplicationTestCase extends android.test.AndroidTestCase {
+ public abstract deprecated class ApplicationTestCase extends android.test.AndroidTestCase {
ctor public ApplicationTestCase(java.lang.Class<T>);
method protected final void createApplication();
method public T getApplication();
@@ -37280,10 +37280,10 @@
ctor public ComparisonFailure(java.lang.String, java.lang.String, java.lang.String);
}
- public abstract class FlakyTest implements java.lang.annotation.Annotation {
+ public abstract deprecated class FlakyTest implements java.lang.annotation.Annotation {
}
- public class InstrumentationTestCase extends junit.framework.TestCase {
+ public deprecated class InstrumentationTestCase extends junit.framework.TestCase {
ctor public InstrumentationTestCase();
method public android.app.Instrumentation getInstrumentation();
method public deprecated void injectInsrumentation(android.app.Instrumentation);
@@ -37296,7 +37296,7 @@
method public void sendRepeatedKeys(int...);
}
- public class InstrumentationTestRunner extends android.app.Instrumentation implements android.test.TestSuiteProvider {
+ public deprecated class InstrumentationTestRunner extends android.app.Instrumentation implements android.test.TestSuiteProvider {
ctor public InstrumentationTestRunner();
method public junit.framework.TestSuite getAllTests();
method protected android.test.AndroidTestRunner getAndroidTestRunner();
@@ -37315,14 +37315,14 @@
field public static final int REPORT_VALUE_RESULT_START = 1; // 0x1
}
- public class InstrumentationTestSuite extends junit.framework.TestSuite {
+ public deprecated class InstrumentationTestSuite extends junit.framework.TestSuite {
ctor public InstrumentationTestSuite(android.app.Instrumentation);
ctor public InstrumentationTestSuite(java.lang.String, android.app.Instrumentation);
ctor public InstrumentationTestSuite(java.lang.Class, android.app.Instrumentation);
method public void addTestSuite(java.lang.Class);
}
- public class IsolatedContext extends android.content.ContextWrapper {
+ public deprecated class IsolatedContext extends android.content.ContextWrapper {
ctor public IsolatedContext(android.content.ContentResolver, android.content.Context);
method public java.util.List<android.content.Intent> getAndClearBroadcastIntents();
}
@@ -37332,7 +37332,7 @@
method public T getLoaderResultSynchronously(android.content.Loader<T>);
}
- public final class MoreAsserts {
+ public final deprecated class MoreAsserts {
method public static void assertAssignableFrom(java.lang.Class<?>, java.lang.Object);
method public static void assertAssignableFrom(java.lang.Class<?>, java.lang.Class<?>);
method public static java.util.regex.MatchResult assertContainsRegex(java.lang.String, java.lang.String, java.lang.String);
@@ -37371,7 +37371,7 @@
method public static void checkEqualsAndHashCodeMethods(java.lang.Object, java.lang.Object, boolean);
}
- public abstract interface PerformanceTestCase {
+ public abstract deprecated interface PerformanceTestCase {
method public abstract boolean isPerformanceOnly();
method public abstract int startPerformance(android.test.PerformanceTestCase.Intermediates);
}
@@ -37400,7 +37400,7 @@
method public static android.content.ContentResolver newResolverWithContentProviderFromSql(android.content.Context, java.lang.String, java.lang.Class<T>, java.lang.String, java.lang.String, int, java.lang.String) throws java.lang.IllegalAccessException, java.lang.InstantiationException;
}
- public class RenamingDelegatingContext extends android.content.ContextWrapper {
+ public deprecated class RenamingDelegatingContext extends android.content.ContextWrapper {
ctor public RenamingDelegatingContext(android.content.Context, java.lang.String);
ctor public RenamingDelegatingContext(android.content.Context, android.content.Context, java.lang.String);
method public java.lang.String getDatabasePrefix();
@@ -37409,7 +37409,7 @@
method public static T providerWithRenamedContext(java.lang.Class<T>, android.content.Context, java.lang.String, boolean) throws java.lang.IllegalAccessException, java.lang.InstantiationException;
}
- public abstract class ServiceTestCase extends android.test.AndroidTestCase {
+ public abstract deprecated class ServiceTestCase extends android.test.AndroidTestCase {
ctor public ServiceTestCase(java.lang.Class<T>);
method protected android.os.IBinder bindService(android.content.Intent);
method public android.app.Application getApplication();
@@ -37422,23 +37422,23 @@
method public void testServiceTestCaseSetUpProperly() throws java.lang.Exception;
}
- public abstract class SingleLaunchActivityTestCase extends android.test.InstrumentationTestCase {
+ public abstract deprecated class SingleLaunchActivityTestCase extends android.test.InstrumentationTestCase {
ctor public SingleLaunchActivityTestCase(java.lang.String, java.lang.Class<T>);
method public T getActivity();
method public void testActivityTestCaseSetUpProperly() throws java.lang.Exception;
}
- public class SyncBaseInstrumentation extends android.test.InstrumentationTestCase {
+ public deprecated class SyncBaseInstrumentation extends android.test.InstrumentationTestCase {
ctor public SyncBaseInstrumentation();
method protected void cancelSyncsandDisableAutoSync();
method protected void syncProvider(android.net.Uri, java.lang.String, java.lang.String) throws java.lang.Exception;
}
- public abstract interface TestSuiteProvider {
+ public abstract deprecated interface TestSuiteProvider {
method public abstract junit.framework.TestSuite getTestSuite();
}
- public class TouchUtils {
+ public deprecated class TouchUtils {
ctor public TouchUtils();
method public static void clickView(android.test.InstrumentationTestCase, android.view.View);
method public static deprecated void drag(android.test.ActivityInstrumentationTestCase, float, float, float, float, int);
@@ -37473,10 +37473,10 @@
method public static void touchAndCancelView(android.test.InstrumentationTestCase, android.view.View);
}
- public abstract class UiThreadTest implements java.lang.annotation.Annotation {
+ public abstract deprecated class UiThreadTest implements java.lang.annotation.Annotation {
}
- public class ViewAsserts {
+ public deprecated class ViewAsserts {
method public static void assertBaselineAligned(android.view.View, android.view.View);
method public static void assertBottomAligned(android.view.View, android.view.View);
method public static void assertBottomAligned(android.view.View, android.view.View, int);
@@ -37501,11 +37501,11 @@
package android.test.mock {
- public class MockApplication extends android.app.Application {
+ public deprecated class MockApplication extends android.app.Application {
ctor public MockApplication();
}
- public class MockContentProvider extends android.content.ContentProvider {
+ public deprecated class MockContentProvider extends android.content.ContentProvider {
ctor protected MockContentProvider();
ctor public MockContentProvider(android.content.Context);
ctor public MockContentProvider(android.content.Context, java.lang.String, java.lang.String, android.content.pm.PathPermission[]);
@@ -37517,13 +37517,13 @@
method public int update(android.net.Uri, android.content.ContentValues, java.lang.String, java.lang.String[]);
}
- public class MockContentResolver extends android.content.ContentResolver {
+ public deprecated class MockContentResolver extends android.content.ContentResolver {
ctor public MockContentResolver();
ctor public MockContentResolver(android.content.Context);
method public void addProvider(java.lang.String, android.content.ContentProvider);
}
- public class MockContext extends android.content.Context {
+ public deprecated class MockContext extends android.content.Context {
ctor public MockContext();
method public boolean bindService(android.content.Intent, android.content.ServiceConnection, int);
method public int checkCallingOrSelfPermission(java.lang.String);
@@ -37624,7 +37624,7 @@
method public void unregisterReceiver(android.content.BroadcastReceiver);
}
- public class MockCursor implements android.database.Cursor {
+ public deprecated class MockCursor implements android.database.Cursor {
ctor public MockCursor();
method public void close();
method public void copyStringToBuffer(int, android.database.CharArrayBuffer);
@@ -37669,13 +37669,13 @@
method public void unregisterDataSetObserver(android.database.DataSetObserver);
}
- public class MockDialogInterface implements android.content.DialogInterface {
+ public deprecated class MockDialogInterface implements android.content.DialogInterface {
ctor public MockDialogInterface();
method public void cancel();
method public void dismiss();
}
- public class MockPackageManager extends android.content.pm.PackageManager {
+ public deprecated class MockPackageManager extends android.content.pm.PackageManager {
ctor public MockPackageManager();
method public void addPackageToPreferred(java.lang.String);
method public boolean addPermission(android.content.pm.PermissionInfo);
@@ -37763,7 +37763,7 @@
method public void verifyPendingInstall(int, int);
}
- public class MockResources extends android.content.res.Resources {
+ public deprecated class MockResources extends android.content.res.Resources {
ctor public MockResources();
}
@@ -37804,19 +37804,19 @@
package android.test.suitebuilder.annotation {
- public abstract class LargeTest implements java.lang.annotation.Annotation {
+ public abstract deprecated class LargeTest implements java.lang.annotation.Annotation {
}
- public abstract class MediumTest implements java.lang.annotation.Annotation {
+ public abstract deprecated class MediumTest implements java.lang.annotation.Annotation {
}
- public abstract class SmallTest implements java.lang.annotation.Annotation {
+ public abstract deprecated class SmallTest implements java.lang.annotation.Annotation {
}
- public abstract class Smoke implements java.lang.annotation.Annotation {
+ public abstract deprecated class Smoke implements java.lang.annotation.Annotation {
}
- public abstract class Suppress implements java.lang.annotation.Annotation {
+ public abstract deprecated class Suppress implements java.lang.annotation.Annotation {
}
}
diff --git a/api/test-removed.txt b/api/test-removed.txt
index 6b7961e..2c6729d 100644
--- a/api/test-removed.txt
+++ b/api/test-removed.txt
@@ -201,7 +201,7 @@
package android.test.mock {
- public class MockPackageManager extends android.content.pm.PackageManager {
+ public deprecated class MockPackageManager extends android.content.pm.PackageManager {
method public deprecated java.lang.String getDefaultBrowserPackageName(int);
method public deprecated boolean setDefaultBrowserPackageName(java.lang.String, int);
}
diff --git a/core/java/android/test/AndroidTestCase.java b/core/java/android/test/AndroidTestCase.java
index 2ecbfae..1e6bd9c 100644
--- a/core/java/android/test/AndroidTestCase.java
+++ b/core/java/android/test/AndroidTestCase.java
@@ -29,7 +29,13 @@
/**
* Extend this if you need to access Resources or other things that depend on Activity Context.
+ *
+ * @deprecated Use
+ * <a href="{@docRoot}reference/android/support/test/InstrumentationRegistry.html">
+ * InstrumentationRegistry</a> instead. New tests should be written using the
+ * <a href="{@docRoot}tools/testing-support-library/index.html">Android Testing Support Library</a>.
*/
+@Deprecated
public class AndroidTestCase extends TestCase {
protected Context mContext;
diff --git a/core/java/android/test/FlakyTest.java b/core/java/android/test/FlakyTest.java
index 919767f..4e5c4e3 100644
--- a/core/java/android/test/FlakyTest.java
+++ b/core/java/android/test/FlakyTest.java
@@ -26,7 +26,13 @@
* test methods. When the annotation is present, the test method is re-executed if
* the test fails. The total number of executions is specified by the tolerance and
* defaults to 1.
+ *
+ * @deprecated Use
+ * <a href="{@docRoot}reference/android/support/test/filters/FlakyTest.html">
+ * FlakyTest</a> instead. New tests should be written using the
+ * <a href="{@docRoot}tools/testing-support-library/index.html">Android Testing Support Library</a>.
*/
+@Deprecated
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface FlakyTest {
diff --git a/core/java/android/test/InstrumentationTestCase.java b/core/java/android/test/InstrumentationTestCase.java
index ca427ea..6b79314 100644
--- a/core/java/android/test/InstrumentationTestCase.java
+++ b/core/java/android/test/InstrumentationTestCase.java
@@ -32,7 +32,13 @@
/**
* A test case that has access to {@link Instrumentation}.
+ *
+ * @deprecated Use
+ * <a href="{@docRoot}reference/android/support/test/InstrumentationRegistry.html">
+ * InstrumentationRegistry</a> instead. New tests should be written using the
+ * <a href="{@docRoot}tools/testing-support-library/index.html">Android Testing Support Library</a>.
*/
+@Deprecated
public class InstrumentationTestCase extends TestCase {
private Instrumentation mInstrumentation;
@@ -40,7 +46,7 @@
/**
* Injects instrumentation into this test case. This method is
* called by the test runner during test setup.
- *
+ *
* @param instrumentation the instrumentation to use with this instance
*/
public void injectInstrumentation(Instrumentation instrumentation) {
diff --git a/core/java/android/test/InstrumentationTestSuite.java b/core/java/android/test/InstrumentationTestSuite.java
index 7a78ffb..a53fa26 100644
--- a/core/java/android/test/InstrumentationTestSuite.java
+++ b/core/java/android/test/InstrumentationTestSuite.java
@@ -25,7 +25,13 @@
/**
* A {@link junit.framework.TestSuite} that injects {@link android.app.Instrumentation} into
* {@link InstrumentationTestCase} before running them.
+ *
+ * @deprecated Use
+ * <a href="{@docRoot}reference/android/support/test/InstrumentationRegistry.html">
+ * InstrumentationRegistry</a> instead. New tests should be written using the
+ * <a href="{@docRoot}tools/testing-support-library/index.html">Android Testing Support Library</a>.
*/
+@Deprecated
public class InstrumentationTestSuite extends TestSuite {
private final Instrumentation mInstrumentation;
diff --git a/core/java/android/test/PerformanceTestCase.java b/core/java/android/test/PerformanceTestCase.java
index 679ad40..65bd4a4 100644
--- a/core/java/android/test/PerformanceTestCase.java
+++ b/core/java/android/test/PerformanceTestCase.java
@@ -18,10 +18,11 @@
/**
* More complex interface performance for test cases.
- *
+ *
* If you want your test to be used as a performance test, you must
* implement this interface.
*/
+@Deprecated
public interface PerformanceTestCase
{
/**
@@ -37,27 +38,27 @@
}
/**
- * Set up to begin performance tests. The 'intermediates' is a
+ * Set up to begin performance tests. The 'intermediates' is a
* communication channel to send back intermediate performance numbers --
* if you use it, you will probably want to ensure your test is only
* executed once by returning 1. Otherwise, return 0 to allow the test
* harness to decide the number of iterations.
- *
+ *
* <p>If you return a non-zero iteration count, you should call
* {@link Intermediates#startTiming intermediates.startTiming} and
* {@link Intermediates#finishTiming intermediates.endTiming} to report the
* duration of the test whose performance should actually be measured.
- *
+ *
* @param intermediates Callback for sending intermediate results.
- *
+ *
* @return int Maximum number of iterations to run, or 0 to let the caller
- * decide.
+ * decide.
*/
int startPerformance(Intermediates intermediates);
-
+
/**
* This method is used to determine what modes this test case can run in.
- *
+ *
* @return true if this test case can only be run in performance mode.
*/
boolean isPerformanceOnly();
diff --git a/core/java/android/test/UiThreadTest.java b/core/java/android/test/UiThreadTest.java
index cd92231..cd06ab8 100644
--- a/core/java/android/test/UiThreadTest.java
+++ b/core/java/android/test/UiThreadTest.java
@@ -26,7 +26,13 @@
* When the annotation is present, the test method is executed on the application's
* main thread (or UI thread.) Note that instrumentation methods may not be used
* when this annotation is present.
+ *
+ * @deprecated Use
+ * <a href="{@docRoot}reference/android/support/test/annotation/UiThreadTest.html">
+ * UiThreadTest</a> instead. New tests should be written using the
+ * <a href="{@docRoot}tools/testing-support-library/index.html">Android Testing Support Library</a>.
*/
+@Deprecated
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface UiThreadTest {
diff --git a/core/java/android/test/suitebuilder/annotation/LargeTest.java b/core/java/android/test/suitebuilder/annotation/LargeTest.java
index a6269e7..dc77ee6 100644
--- a/core/java/android/test/suitebuilder/annotation/LargeTest.java
+++ b/core/java/android/test/suitebuilder/annotation/LargeTest.java
@@ -23,7 +23,13 @@
/**
* Marks a test that should run as part of the large tests.
+ *
+ * @deprecated Use
+ * <a href="{@docRoot}reference/android/support/test/filters/LargeTest.html">
+ * LargeTest</a> instead. New tests should be written using the
+ * <a href="{@docRoot}tools/testing-support-library/index.html">Android Testing Support Library</a>.
*/
+@Deprecated
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD, ElementType.TYPE})
public @interface LargeTest {
diff --git a/core/java/android/test/suitebuilder/annotation/MediumTest.java b/core/java/android/test/suitebuilder/annotation/MediumTest.java
index 8afeb91..b941da0 100644
--- a/core/java/android/test/suitebuilder/annotation/MediumTest.java
+++ b/core/java/android/test/suitebuilder/annotation/MediumTest.java
@@ -24,7 +24,12 @@
/**
* Marks a test that should run as part of the medium tests.
*
+ * @deprecated Use
+ * <a href="{@docRoot}reference/android/support/test/filters/MediumTest.html">
+ * MediumTest</a> instead. New tests should be written using the
+ * <a href="{@docRoot}tools/testing-support-library/index.html">Android Testing Support Library</a>.
*/
+@Deprecated
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD, ElementType.TYPE})
public @interface MediumTest {
diff --git a/core/java/android/test/suitebuilder/annotation/SmallTest.java b/core/java/android/test/suitebuilder/annotation/SmallTest.java
index ad530e2..d3c74f0 100644
--- a/core/java/android/test/suitebuilder/annotation/SmallTest.java
+++ b/core/java/android/test/suitebuilder/annotation/SmallTest.java
@@ -23,7 +23,13 @@
/**
* Marks a test that should run as part of the small tests.
+ *
+ * @deprecated Use
+ * <a href="{@docRoot}reference/android/support/test/filters/SmallTest.html">
+ * SmallTest</a> instead. New tests should be written using the
+ * <a href="{@docRoot}tools/testing-support-library/index.html">Android Testing Support Library</a>.
*/
+@Deprecated
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD, ElementType.TYPE})
public @interface SmallTest {
diff --git a/core/java/android/test/suitebuilder/annotation/Smoke.java b/core/java/android/test/suitebuilder/annotation/Smoke.java
index 237e033..aac2937 100644
--- a/core/java/android/test/suitebuilder/annotation/Smoke.java
+++ b/core/java/android/test/suitebuilder/annotation/Smoke.java
@@ -27,7 +27,11 @@
* will run all tests with this annotation.
*
* @see android.test.suitebuilder.SmokeTestSuiteBuilder
+ *
+ * @deprecated New tests should be written using the
+ * <a href="{@docRoot}tools/testing-support-library/index.html">Android Testing Support Library</a>.
*/
+@Deprecated
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD, ElementType.TYPE})
public @interface Smoke {
diff --git a/core/java/android/test/suitebuilder/annotation/Suppress.java b/core/java/android/test/suitebuilder/annotation/Suppress.java
index f16c8fa..629a3cf 100644
--- a/core/java/android/test/suitebuilder/annotation/Suppress.java
+++ b/core/java/android/test/suitebuilder/annotation/Suppress.java
@@ -26,7 +26,12 @@
* suite. If the annotation appears on the class then no tests in that class will be included. If
* the annotation appears only on a test method then only that method will be excluded.
*
+ * @deprecated Use
+ * <a href="{@docRoot}reference/android/support/test/filters/Suppress.html">
+ * Suppress</a> instead. New tests should be written using the
+ * <a href="{@docRoot}tools/testing-support-library/index.html">Android Testing Support Library</a>.
*/
+@Deprecated
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD, ElementType.TYPE})
public @interface Suppress {
diff --git a/test-runner/src/android/test/ActivityInstrumentationTestCase.java b/test-runner/src/android/test/ActivityInstrumentationTestCase.java
index a59ee35..aca1c16 100644
--- a/test-runner/src/android/test/ActivityInstrumentationTestCase.java
+++ b/test-runner/src/android/test/ActivityInstrumentationTestCase.java
@@ -23,15 +23,15 @@
* be created using the system infrastructure (by calling InstrumentationTestCase.launchActivity())
* and you will then be able to manipulate your Activity directly. Most of the work is handled
* automatically here by {@link #setUp} and {@link #tearDown}.
- *
+ *
* <p>If you prefer an isolated unit test, see {@link android.test.ActivityUnitTestCase}.
- *
- * @deprecated new tests should be written using
+ *
+ * @deprecated new tests should be written using
* {@link android.test.ActivityInstrumentationTestCase2}, which provides more options for
* configuring the Activity under test
*/
@Deprecated
-public abstract class ActivityInstrumentationTestCase<T extends Activity>
+public abstract class ActivityInstrumentationTestCase<T extends Activity>
extends ActivityTestCase {
String mPackage;
Class<T> mActivityClass;
@@ -39,7 +39,7 @@
/**
* Creates an {@link ActivityInstrumentationTestCase} in non-touch mode.
- *
+ *
* @param pkg ignored - no longer in use.
* @param activityClass The activity to test. This must be a class in the instrumentation
* targetPackage specified in the AndroidManifest.xml
@@ -56,7 +56,7 @@
* targetPackage specified in the AndroidManifest.xml
* @param initialTouchMode true = in touch mode
*/
- public ActivityInstrumentationTestCase(String pkg, Class<T> activityClass,
+ public ActivityInstrumentationTestCase(String pkg, Class<T> activityClass,
boolean initialTouchMode) {
mActivityClass = activityClass;
mInitialTouchMode = initialTouchMode;
@@ -80,8 +80,8 @@
protected void tearDown() throws Exception {
getActivity().finish();
setActivity(null);
-
- // Scrub out members - protects against memory leaks in the case where someone
+
+ // Scrub out members - protects against memory leaks in the case where someone
// creates a non-static inner class (thus referencing the test case) and gives it to
// someone else to hold onto
scrubClass(ActivityInstrumentationTestCase.class);
diff --git a/test-runner/src/android/test/ActivityInstrumentationTestCase2.java b/test-runner/src/android/test/ActivityInstrumentationTestCase2.java
index c4bcf31..0e61ce7 100644
--- a/test-runner/src/android/test/ActivityInstrumentationTestCase2.java
+++ b/test-runner/src/android/test/ActivityInstrumentationTestCase2.java
@@ -25,26 +25,26 @@
* This class provides functional testing of a single activity. The activity under test will
* be created using the system infrastructure (by calling InstrumentationTestCase.launchActivity())
* and you will then be able to manipulate your Activity directly.
- *
+ *
* <p>Other options supported by this test case include:
* <ul>
* <li>You can run any test method on the UI thread (see {@link android.test.UiThreadTest}).</li>
- * <li>You can inject custom Intents into your Activity (see
+ * <li>You can inject custom Intents into your Activity (see
* {@link #setActivityIntent(Intent)}).</li>
* </ul>
- *
+ *
* <p>This class replaces {@link android.test.ActivityInstrumentationTestCase}, which is deprecated.
* New tests should be written using this base class.
- *
+ *
* <p>If you prefer an isolated unit test, see {@link android.test.ActivityUnitTestCase}.
*
- * <div class="special reference">
- * <h3>Developer Guides</h3>
- * <p>For more information about application testing, read the
- * <a href="{@docRoot}guide/topics/testing/index.html">Testing</a> developer guide.</p>
- * </div>
+ * @deprecated Use
+ * <a href="{@docRoot}reference/android/support/test/rule/ActivityTestRule.html">
+ * ActivityTestRule</a> instead. New tests should be written using the
+ * <a href="{@docRoot}tools/testing-support-library/index.html">Android Testing Support Library</a>.
*/
-public abstract class ActivityInstrumentationTestCase2<T extends Activity>
+@Deprecated
+public abstract class ActivityInstrumentationTestCase2<T extends Activity>
extends ActivityTestCase {
Class<T> mActivityClass;
boolean mInitialTouchMode = false;
@@ -78,18 +78,18 @@
* Get the Activity under test, starting it if necessary.
*
* For each test method invocation, the Activity will not actually be created until the first
- * time this method is called.
- *
- * <p>If you wish to provide custom setup values to your Activity, you may call
- * {@link #setActivityIntent(Intent)} and/or {@link #setActivityInitialTouchMode(boolean)}
- * before your first call to getActivity(). Calling them after your Activity has
+ * time this method is called.
+ *
+ * <p>If you wish to provide custom setup values to your Activity, you may call
+ * {@link #setActivityIntent(Intent)} and/or {@link #setActivityInitialTouchMode(boolean)}
+ * before your first call to getActivity(). Calling them after your Activity has
* started will have no effect.
*
* <p><b>NOTE:</b> Activities under test may not be started from within the UI thread.
* If your test method is annotated with {@link android.test.UiThreadTest}, then your Activity
* will be started automatically just before your test method is run. You still call this
* method in order to get the Activity under test.
- *
+ *
* @return the Activity under test
*/
@Override
@@ -113,10 +113,10 @@
/**
* Call this method before the first call to {@link #getActivity} to inject a customized Intent
* into the Activity under test.
- *
+ *
* <p>If you do not call this, the default intent will be provided. If you call this after
* your Activity has been started, it will have no effect.
- *
+ *
* <p><b>NOTE:</b> Activities under test may not be started from within the UI thread.
* If your test method is annotated with {@link android.test.UiThreadTest}, then you must call
* {@link #setActivityIntent(Intent)} from {@link #setUp()}.
@@ -131,28 +131,28 @@
public void setActivityIntent(Intent i) {
mActivityIntent = i;
}
-
+
/**
* Call this method before the first call to {@link #getActivity} to set the initial touch
* mode for the Activity under test.
- *
+ *
* <p>If you do not call this, the touch mode will be false. If you call this after
* your Activity has been started, it will have no effect.
- *
+ *
* <p><b>NOTE:</b> Activities under test may not be started from within the UI thread.
* If your test method is annotated with {@link android.test.UiThreadTest}, then you must call
* {@link #setActivityInitialTouchMode(boolean)} from {@link #setUp()}.
- *
+ *
* @param initialTouchMode true if the Activity should be placed into "touch mode" when started
*/
public void setActivityInitialTouchMode(boolean initialTouchMode) {
mInitialTouchMode = initialTouchMode;
}
-
+
@Override
protected void setUp() throws Exception {
super.setUp();
-
+
mInitialTouchMode = false;
mActivityIntent = null;
}
@@ -165,8 +165,8 @@
a.finish();
setActivity(null);
}
-
- // Scrub out members - protects against memory leaks in the case where someone
+
+ // Scrub out members - protects against memory leaks in the case where someone
// creates a non-static inner class (thus referencing the test case) and gives it to
// someone else to hold onto
scrubClass(ActivityInstrumentationTestCase2.class);
diff --git a/test-runner/src/android/test/ActivityTestCase.java b/test-runner/src/android/test/ActivityTestCase.java
index c7b1d70..51dd3ef 100644
--- a/test-runner/src/android/test/ActivityTestCase.java
+++ b/test-runner/src/android/test/ActivityTestCase.java
@@ -25,7 +25,11 @@
* This is common code used to support Activity test cases. For more useful classes, please see
* {@link android.test.ActivityUnitTestCase} and
* {@link android.test.ActivityInstrumentationTestCase}.
+ *
+ * @deprecated New tests should be written using the
+ * <a href="{@docRoot}tools/testing-support-library/index.html">Android Testing Support Library</a>.
*/
+@Deprecated
public abstract class ActivityTestCase extends InstrumentationTestCase {
/**
diff --git a/test-runner/src/android/test/ActivityUnitTestCase.java b/test-runner/src/android/test/ActivityUnitTestCase.java
index 40cca90..a191445 100644
--- a/test-runner/src/android/test/ActivityUnitTestCase.java
+++ b/test-runner/src/android/test/ActivityUnitTestCase.java
@@ -32,14 +32,14 @@
/**
* This class provides isolated testing of a single activity. The activity under test will
- * be created with minimal connection to the system infrastructure, and you can inject mocked or
+ * be created with minimal connection to the system infrastructure, and you can inject mocked or
* wrappered versions of many of Activity's dependencies. Most of the work is handled
* automatically here by {@link #setUp} and {@link #tearDown}.
- *
+ *
* <p>If you prefer a functional test, see {@link android.test.ActivityInstrumentationTestCase}.
- *
+ *
* <p>It must be noted that, as a true unit test, your Activity will not be running in the
- * normal system and will not participate in the normal interactions with other Activities.
+ * normal system and will not participate in the normal interactions with other Activities.
* The following methods should not be called in this configuration - most of them will throw
* exceptions:
* <ul>
@@ -54,17 +54,17 @@
* <li>{@link android.app.Activity#isTaskRoot()}</li>
* <li>{@link android.app.Activity#moveTaskToBack(boolean)}</li>
* </ul>
- *
- * <p>The following methods may be called but will not do anything. For test purposes, you can use
- * the methods {@link #getStartedActivityIntent()} and {@link #getStartedActivityRequest()} to
+ *
+ * <p>The following methods may be called but will not do anything. For test purposes, you can use
+ * the methods {@link #getStartedActivityIntent()} and {@link #getStartedActivityRequest()} to
* inspect the parameters that they were called with.
* <ul>
* <li>{@link android.app.Activity#startActivity(Intent)}</li>
* <li>{@link android.app.Activity#startActivityForResult(Intent, int)}</li>
* </ul>
*
- * <p>The following methods may be called but will not do anything. For test purposes, you can use
- * the methods {@link #isFinishCalled()} and {@link #getFinishedActivityRequest()} to inspect the
+ * <p>The following methods may be called but will not do anything. For test purposes, you can use
+ * the methods {@link #isFinishCalled()} and {@link #getFinishedActivityRequest()} to inspect the
* parameters that they were called with.
* <ul>
* <li>{@link android.app.Activity#finish()}</li>
@@ -72,8 +72,12 @@
* <li>{@link android.app.Activity#finishActivity(int requestCode)}</li>
* </ul>
*
+ * @deprecated Write
+ * <a href="{@docRoot}training/testing/unit-testing/local-unit-tests.html">Local Unit Tests</a>
+ * instead.
*/
-public abstract class ActivityUnitTestCase<T extends Activity>
+@Deprecated
+public abstract class ActivityUnitTestCase<T extends Activity>
extends ActivityTestCase {
private static final String TAG = "ActivityUnitTestCase";
@@ -102,31 +106,31 @@
// default value for target context, as a default
mActivityContext = getInstrumentation().getTargetContext();
}
-
+
/**
* Start the activity under test, in the same way as if it was started by
- * {@link android.content.Context#startActivity Context.startActivity()}, providing the
+ * {@link android.content.Context#startActivity Context.startActivity()}, providing the
* arguments it supplied. When you use this method to start the activity, it will automatically
* be stopped by {@link #tearDown}.
- *
- * <p>This method will call onCreate(), but if you wish to further exercise Activity life
+ *
+ * <p>This method will call onCreate(), but if you wish to further exercise Activity life
* cycle methods, you must call them yourself from your test case.
- *
+ *
* <p><i>Do not call from your setUp() method. You must call this method from each of your
* test methods.</i>
- *
+ *
* @param intent The Intent as if supplied to {@link android.content.Context#startActivity}.
* @param savedInstanceState The instance state, if you are simulating this part of the life
* cycle. Typically null.
- * @param lastNonConfigurationInstance This Object will be available to the
- * Activity if it calls {@link android.app.Activity#getLastNonConfigurationInstance()}.
+ * @param lastNonConfigurationInstance This Object will be available to the
+ * Activity if it calls {@link android.app.Activity#getLastNonConfigurationInstance()}.
* Typically null.
* @return Returns the Activity that was created
*/
protected T startActivity(Intent intent, Bundle savedInstanceState,
Object lastNonConfigurationInstance) {
assertFalse("Activity already created", mCreated);
-
+
if (!mAttached) {
assertNotNull(mActivityClass);
setActivity(null);
@@ -154,7 +158,7 @@
assertNotNull(newActivity);
setActivity(newActivity);
-
+
mAttached = true;
}
@@ -165,22 +169,22 @@
}
return result;
}
-
+
@Override
protected void tearDown() throws Exception {
-
+
setActivity(null);
-
- // Scrub out members - protects against memory leaks in the case where someone
+
+ // Scrub out members - protects against memory leaks in the case where someone
// creates a non-static inner class (thus referencing the test case) and gives it to
// someone else to hold onto
scrubClass(ActivityInstrumentationTestCase.class);
super.tearDown();
}
-
+
/**
- * Set the application for use during the test. You must call this function before calling
+ * Set the application for use during the test. You must call this function before calling
* {@link #startActivity}. If your test does not call this method,
* @param application The Application object that will be injected into the Activity under test.
*/
@@ -198,7 +202,7 @@
}
/**
- * This method will return the value if your Activity under test calls
+ * This method will return the value if your Activity under test calls
* {@link android.app.Activity#setRequestedOrientation}.
*/
public int getRequestedOrientation() {
@@ -207,10 +211,10 @@
}
return 0;
}
-
+
/**
- * This method will return the launch intent if your Activity under test calls
- * {@link android.app.Activity#startActivity(Intent)} or
+ * This method will return the launch intent if your Activity under test calls
+ * {@link android.app.Activity#startActivity(Intent)} or
* {@link android.app.Activity#startActivityForResult(Intent, int)}.
* @return The Intent provided in the start call, or null if no start call was made.
*/
@@ -220,9 +224,9 @@
}
return null;
}
-
+
/**
- * This method will return the launch request code if your Activity under test calls
+ * This method will return the launch request code if your Activity under test calls
* {@link android.app.Activity#startActivityForResult(Intent, int)}.
* @return The request code provided in the start call, or -1 if no start call was made.
*/
@@ -234,9 +238,9 @@
}
/**
- * This method will notify you if the Activity under test called
- * {@link android.app.Activity#finish()},
- * {@link android.app.Activity#finishFromChild(Activity)}, or
+ * This method will notify you if the Activity under test called
+ * {@link android.app.Activity#finish()},
+ * {@link android.app.Activity#finishFromChild(Activity)}, or
* {@link android.app.Activity#finishActivity(int)}.
* @return Returns true if one of the listed finish methods was called.
*/
@@ -246,9 +250,9 @@
}
return false;
}
-
+
/**
- * This method will return the request code if the Activity under test called
+ * This method will return the request code if the Activity under test called
* {@link android.app.Activity#finishActivity(int)}.
* @return The request code provided in the start call, or -1 if no finish call was made.
*/
@@ -258,7 +262,7 @@
}
return 0;
}
-
+
/**
* This mock Activity represents the "parent" activity. By injecting this, we allow the user
* to call a few more Activity methods, including:
@@ -269,7 +273,7 @@
* <li>{@link android.app.Activity#finishActivity(int requestCode)}</li>
* <li>{@link android.app.Activity#finishFromChild(Activity child)}</li>
* </ul>
- *
+ *
* TODO: Make this overrideable, and the unit test can look for calls to other methods
*/
private static class MockParent extends Activity {
@@ -303,7 +307,7 @@
public Window getWindow() {
return null;
}
-
+
/**
* By defining this in the parent, we allow the tested activity to call
* <ul>
@@ -316,7 +320,7 @@
mStartedActivityIntent = intent;
mStartedActivityRequest = requestCode;
}
-
+
/**
* By defining this in the parent, we allow the tested activity to call
* <ul>
diff --git a/test-runner/src/android/test/AndroidTestRunner.java b/test-runner/src/android/test/AndroidTestRunner.java
index aa7c677..50eaafb 100644
--- a/test-runner/src/android/test/AndroidTestRunner.java
+++ b/test-runner/src/android/test/AndroidTestRunner.java
@@ -33,6 +33,13 @@
import java.lang.reflect.InvocationTargetException;
import java.util.List;
+/**
+ * @deprecated Use
+ * <a href="{@docRoot}reference/android/support/test/runner/AndroidJUnitRunner.html">
+ * AndroidJUnitRunner</a> instead. New tests should be written using the
+ * <a href="{@docRoot}tools/testing-support-library/index.html">Android Testing Support Library</a>.
+ */
+@Deprecated
public class AndroidTestRunner extends BaseTestRunner {
private TestResult mTestResult;
diff --git a/test-runner/src/android/test/ApplicationTestCase.java b/test-runner/src/android/test/ApplicationTestCase.java
index f093181..4d73f53 100644
--- a/test-runner/src/android/test/ApplicationTestCase.java
+++ b/test-runner/src/android/test/ApplicationTestCase.java
@@ -32,7 +32,7 @@
* In order to support the lifecycle of a Application, this test case will make the
* following calls at the following times.
*
- * <ul><li>The test case will not call onCreate() until your test calls
+ * <ul><li>The test case will not call onCreate() until your test calls
* {@link #createApplication()}. This gives you a chance
* to set up or adjust any additional framework or test logic before
* onCreate().</li>
@@ -40,22 +40,28 @@
* automatically called, and it will stop & destroy your application by calling its
* onDestroy() method.</li>
* </ul>
- *
+ *
* <p><b>Dependency Injection.</b>
* Every Application has one inherent dependency, the {@link android.content.Context Context} in
* which it runs.
- * This framework allows you to inject a modified, mock, or isolated replacement for this
+ * This framework allows you to inject a modified, mock, or isolated replacement for this
* dependencies, and thus perform a true unit test.
- *
+ *
* <p>If simply run your tests as-is, your Application will be injected with a fully-functional
* Context.
- * You can create and inject alternative types of Contexts by calling
+ * You can create and inject alternative types of Contexts by calling
* {@link AndroidTestCase#setContext(Context) setContext()}. You must do this <i>before</i> calling
* {@link #createApplication()}. The test framework provides a
- * number of alternatives for Context, including {@link android.test.mock.MockContext MockContext},
- * {@link android.test.RenamingDelegatingContext RenamingDelegatingContext}, and
+ * number of alternatives for Context, including {@link android.test.mock.MockContext MockContext},
+ * {@link android.test.RenamingDelegatingContext RenamingDelegatingContext}, and
* {@link android.content.ContextWrapper ContextWrapper}.
+ *
+ * @deprecated Use
+ * <a href="{@docRoot}reference/android/support/test/InstrumentationRegistry.html">
+ * InstrumentationRegistry</a> instead. New tests should be written using the
+ * <a href="{@docRoot}tools/testing-support-library/index.html">Android Testing Support Library</a>.
*/
+@Deprecated
public abstract class ApplicationTestCase<T extends Application> extends AndroidTestCase {
Class<T> mApplicationClass;
@@ -78,17 +84,17 @@
}
/**
- * This will do the work to instantiate the Application under test. After this, your test
+ * This will do the work to instantiate the Application under test. After this, your test
* code must also start and stop the Application.
*/
@Override
protected void setUp() throws Exception {
super.setUp();
-
+
// get the real context, before the individual tests have a chance to muck with it
mSystemContext = getContext();
}
-
+
/**
* Load and attach the application under test.
*/
@@ -101,26 +107,26 @@
}
mAttached = true;
}
-
+
/**
- * Start the Application under test, in the same way as if it was started by the system.
+ * Start the Application under test, in the same way as if it was started by the system.
* If you use this method to start the Application, it will automatically
* be stopped by {@link #tearDown}. If you wish to inject a specialized Context for your
- * test, by calling {@link AndroidTestCase#setContext(Context) setContext()},
+ * test, by calling {@link AndroidTestCase#setContext(Context) setContext()},
* you must do so before calling this method.
*/
final protected void createApplication() {
assertFalse(mCreated);
-
+
if (!mAttached) {
setupApplication();
}
assertNotNull(mApplication);
-
+
mApplication.onCreate();
mCreated = true;
}
-
+
/**
* This will make the necessary calls to terminate the Application under test (it will
* call onTerminate(). Ordinarily this will be called automatically (by {@link #tearDown}, but
@@ -131,13 +137,13 @@
mApplication.onTerminate();
}
}
-
+
/**
- * Shuts down the Application under test. Also makes sure all resources are cleaned up and
+ * Shuts down the Application under test. Also makes sure all resources are cleaned up and
* garbage collected before moving on to the next
* test. Subclasses that override this method should make sure they call super.tearDown()
* at the end of the overriding method.
- *
+ *
* @throws Exception
*/
@Override
@@ -145,7 +151,7 @@
terminateApplication();
mApplication = null;
- // Scrub out members - protects against memory leaks in the case where someone
+ // Scrub out members - protects against memory leaks in the case where someone
// creates a non-static inner class (thus referencing the test case) and gives it to
// someone else to hold onto
scrubClass(ApplicationTestCase.class);
@@ -156,7 +162,7 @@
/**
* Return a real (not mocked or instrumented) system Context that can be used when generating
* Mock or other Context objects for your Application under test.
- *
+ *
* @return Returns a reference to a normal Context.
*/
public Context getSystemContext() {
@@ -165,7 +171,7 @@
/**
* This test simply confirms that the Application class can be instantiated properly.
- *
+ *
* @throws Exception
*/
final public void testApplicationTestCaseSetUpProperly() throws Exception {
diff --git a/test-runner/src/android/test/AssertionFailedError.java b/test-runner/src/android/test/AssertionFailedError.java
index b3ac6d1..fc3e98e 100644
--- a/test-runner/src/android/test/AssertionFailedError.java
+++ b/test-runner/src/android/test/AssertionFailedError.java
@@ -18,17 +18,18 @@
/**
* Thrown when an assertion failed.
- *
+ *
* @deprecated use junit.framework.AssertionFailedError
*/
+@Deprecated
public class AssertionFailedError extends Error {
-
+
/**
* It is more typical to call {@link #AssertionFailedError(String)}.
*/
public AssertionFailedError() {
}
-
+
public AssertionFailedError(String errorMessage) {
super(errorMessage);
}
diff --git a/test-runner/src/android/test/ClassPathPackageInfo.java b/test-runner/src/android/test/ClassPathPackageInfo.java
index 1f6e647..1ab7c7f 100644
--- a/test-runner/src/android/test/ClassPathPackageInfo.java
+++ b/test-runner/src/android/test/ClassPathPackageInfo.java
@@ -24,9 +24,10 @@
/**
* The Package object doesn't allow you to iterate over the contained
* classes and subpackages of that package. This is a version that does.
- *
+ *
* {@hide} Not needed for 1.0 SDK.
*/
+@Deprecated
public class ClassPathPackageInfo {
private final ClassPathPackageInfoSource source;
diff --git a/test-runner/src/android/test/ClassPathPackageInfoSource.java b/test-runner/src/android/test/ClassPathPackageInfoSource.java
index 0ffecdb..89bb494 100644
--- a/test-runner/src/android/test/ClassPathPackageInfoSource.java
+++ b/test-runner/src/android/test/ClassPathPackageInfoSource.java
@@ -33,9 +33,10 @@
/**
* Generate {@link ClassPathPackageInfo}s by scanning apk paths.
- *
+ *
* {@hide} Not needed for 1.0 SDK.
*/
+@Deprecated
public class ClassPathPackageInfoSource {
private static final String CLASS_EXTENSION = ".class";
@@ -82,7 +83,7 @@
// Don't try to load classes that are generated. They usually aren't in test apks.
continue;
}
-
+
try {
// We get errors in the emulator if we don't use the caller's class loader.
topLevelClasses.add(Class.forName(className, false,
diff --git a/test-runner/src/android/test/DatabaseTestUtils.java b/test-runner/src/android/test/DatabaseTestUtils.java
index 23e0aba..42ef48b 100644
--- a/test-runner/src/android/test/DatabaseTestUtils.java
+++ b/test-runner/src/android/test/DatabaseTestUtils.java
@@ -27,6 +27,7 @@
* A collection of utilities for writing unit tests for database code.
* @hide pending API council approval
*/
+@Deprecated
public class DatabaseTestUtils {
/**
diff --git a/test-runner/src/android/test/InstrumentationCoreTestRunner.java b/test-runner/src/android/test/InstrumentationCoreTestRunner.java
index 655a65c..2b05e4a 100644
--- a/test-runner/src/android/test/InstrumentationCoreTestRunner.java
+++ b/test-runner/src/android/test/InstrumentationCoreTestRunner.java
@@ -41,6 +41,7 @@
*
* @hide
*/
+@Deprecated
public class InstrumentationCoreTestRunner extends InstrumentationTestRunner {
/**
diff --git a/test-runner/src/android/test/InstrumentationTestRunner.java b/test-runner/src/android/test/InstrumentationTestRunner.java
index db80ef951..9bd4c96 100644
--- a/test-runner/src/android/test/InstrumentationTestRunner.java
+++ b/test-runner/src/android/test/InstrumentationTestRunner.java
@@ -155,6 +155,10 @@
* -e coverageFile /sdcard/myFile.ec
* <br/>
* in addition to the other arguments.
+ * @deprecated Use
+ * <a href="{@docRoot}reference/android/support/test/runner/AndroidJUnitRunner.html">
+ * AndroidJUnitRunner</a> instead. New tests should be written using the
+ * <a href="{@docRoot}tools/testing-support-library/index.html">Android Testing Support Library</a>.
*/
/* (not JavaDoc)
@@ -170,6 +174,7 @@
*
* This model is used by many existing app tests, but can probably be deprecated.
*/
+@Deprecated
public class InstrumentationTestRunner extends Instrumentation implements TestSuiteProvider {
/** @hide */
diff --git a/test-runner/src/android/test/InstrumentationUtils.java b/test-runner/src/android/test/InstrumentationUtils.java
index 1a7002a..cc50813 100644
--- a/test-runner/src/android/test/InstrumentationUtils.java
+++ b/test-runner/src/android/test/InstrumentationUtils.java
@@ -17,17 +17,17 @@
package android.test;
/**
- *
* The InstrumentationUtils class has all the utility functions needed for
* instrumentation tests.
*
* {@hide} - Not currently used.
*/
+@Deprecated
public class InstrumentationUtils {
/**
* An utility function that returns the menu identifier for a particular
* menu item.
- *
+ *
* @param cls Class object of the class that handles the menu ite,.
* @param identifier Menu identifier.
* @return The integer corresponding to the menu item.
@@ -35,7 +35,7 @@
public static int getMenuIdentifier(Class cls, String identifier) {
int id = -1;
try {
- Integer field = (Integer)cls.getDeclaredField(identifier).get(cls);
+ Integer field = (Integer)cls.getDeclaredField(identifier).get(cls);
id = field.intValue();
} catch (NoSuchFieldException e) {
e.printStackTrace();
diff --git a/test-runner/src/android/test/IsolatedContext.java b/test-runner/src/android/test/IsolatedContext.java
index f971b5d..3abf38f 100644
--- a/test-runner/src/android/test/IsolatedContext.java
+++ b/test-runner/src/android/test/IsolatedContext.java
@@ -43,9 +43,13 @@
/**
- * A mock context which prevents its users from talking to the rest of the device while
+ * A mock context which prevents its users from talking to the rest of the device while
* stubbing enough methods to satify code that tries to talk to other packages.
+ *
+ * @deprecated New tests should be written using the
+ * <a href="{@docRoot}tools/testing-support-library/index.html">Android Testing Support Library</a>.
*/
+@Deprecated
public class IsolatedContext extends ContextWrapper {
private ContentResolver mResolver;
diff --git a/test-runner/src/android/test/LaunchPerformanceBase.java b/test-runner/src/android/test/LaunchPerformanceBase.java
index d423e62..62c90d6 100644
--- a/test-runner/src/android/test/LaunchPerformanceBase.java
+++ b/test-runner/src/android/test/LaunchPerformanceBase.java
@@ -26,6 +26,7 @@
*
* @hide
*/
+@Deprecated
public class LaunchPerformanceBase extends Instrumentation {
public static final String LOG_TAG = "Launch Performance";
@@ -39,7 +40,7 @@
mIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
setAutomaticPerformanceSnapshots();
}
-
+
/**
* Launches intent, and waits for idle before returning.
*
diff --git a/test-runner/src/android/test/MoreAsserts.java b/test-runner/src/android/test/MoreAsserts.java
index 3364895..d33911a 100644
--- a/test-runner/src/android/test/MoreAsserts.java
+++ b/test-runner/src/android/test/MoreAsserts.java
@@ -30,7 +30,10 @@
/**
* Contains additional assertion methods not found in JUnit.
+ * @deprecated Use
+ * <a href="https://github.com/hamcrest">Hamcrest matchers</a> instead.
*/
+@Deprecated
public final class MoreAsserts {
private MoreAsserts() { }
@@ -375,7 +378,7 @@
failWithMessage(message, "Extra object in actual: (" + actualObj.toString() + ")");
}
}
-
+
if (expectedMap.size() > 0) {
failWithMessage(message, "Extra objects in expected.");
}
diff --git a/test-runner/src/android/test/NoExecTestResult.java b/test-runner/src/android/test/NoExecTestResult.java
index 1ee62c1..a01b6aa 100644
--- a/test-runner/src/android/test/NoExecTestResult.java
+++ b/test-runner/src/android/test/NoExecTestResult.java
@@ -19,11 +19,12 @@
import junit.framework.TestResult;
/**
- * A benign test result that does no actually test execution, just runs
+ * A benign test result that does no actually test execution, just runs
* through the motions
- *
+ *
* {@hide} Not needed for SDK.
*/
+@Deprecated
class NoExecTestResult extends TestResult {
/**
diff --git a/test-runner/src/android/test/PackageInfoSources.java b/test-runner/src/android/test/PackageInfoSources.java
index ef37449..205f86b 100644
--- a/test-runner/src/android/test/PackageInfoSources.java
+++ b/test-runner/src/android/test/PackageInfoSources.java
@@ -19,6 +19,7 @@
/**
* {@hide} Not needed for SDK.
*/
+@Deprecated
public class PackageInfoSources {
private static ClassPathPackageInfoSource classPathSource;
diff --git a/test-runner/src/android/test/PerformanceCollectorTestCase.java b/test-runner/src/android/test/PerformanceCollectorTestCase.java
index 4309ff7..3a5dafc 100644
--- a/test-runner/src/android/test/PerformanceCollectorTestCase.java
+++ b/test-runner/src/android/test/PerformanceCollectorTestCase.java
@@ -30,6 +30,7 @@
*
* {@hide} Not needed for SDK.
*/
+@Deprecated
public interface PerformanceCollectorTestCase {
public PerformanceCollector mPerfCollector = new PerformanceCollector();
diff --git a/test-runner/src/android/test/RenamingDelegatingContext.java b/test-runner/src/android/test/RenamingDelegatingContext.java
index 3c4da9e..36786b0 100644
--- a/test-runner/src/android/test/RenamingDelegatingContext.java
+++ b/test-runner/src/android/test/RenamingDelegatingContext.java
@@ -36,7 +36,11 @@
* This is a class which delegates to the given context, but performs database
* and file operations with a renamed database/file name (prefixes default
* names with a given prefix).
+ *
+ * @deprecated New tests should be written using the
+ * <a href="{@docRoot}tools/testing-support-library/index.html">Android Testing Support Library</a>.
*/
+@Deprecated
public class RenamingDelegatingContext extends ContextWrapper {
private Context mFileContext;
@@ -168,7 +172,7 @@
return false;
}
}
-
+
@Override
public File getDatabasePath(String name) {
return mFileContext.getDatabasePath(renamedFileName(name));
@@ -216,7 +220,7 @@
public String[] fileList() {
return mFileNames.toArray(new String[]{});
}
-
+
/**
* In order to support calls to getCacheDir(), we create a temp cache dir (inside the real
* one) and return it instead. This code is basically getCacheDir(), except it uses the real
@@ -241,21 +245,4 @@
}
return mCacheDir;
}
-
-
-// /**
-// * Given an array of files returns only those whose names indicate that they belong to this
-// * context.
-// * @param allFiles the original list of files
-// * @return the pruned list of files
-// */
-// private String[] prunedFileList(String[] allFiles) {
-// List<String> files = Lists.newArrayList();
-// for (String file : allFiles) {
-// if (file.startsWith(mFilePrefix)) {
-// files.add(file);
-// }
-// }
-// return files.toArray(new String[]{});
-// }
}
diff --git a/test-runner/src/android/test/ServiceTestCase.java b/test-runner/src/android/test/ServiceTestCase.java
index ba20c09..c8ff0f9 100644
--- a/test-runner/src/android/test/ServiceTestCase.java
+++ b/test-runner/src/android/test/ServiceTestCase.java
@@ -92,7 +92,13 @@
* {@link android.test.RenamingDelegatingContext RenamingDelegatingContext},
* {@link android.content.ContextWrapper ContextWrapper}, and
* {@link android.test.IsolatedContext}.
+ *
+ * @deprecated Use
+ * <a href="{@docRoot}reference/android/support/test/rule/ServiceTestRule.html">
+ * ServiceTestRule</a> instead. New tests should be written using the
+ * <a href="{@docRoot}tools/testing-support-library/index.html">Android Testing Support Library</a>.
*/
+@Deprecated
public abstract class ServiceTestCase<T extends Service> extends AndroidTestCase {
Class<T> mServiceClass;
diff --git a/test-runner/src/android/test/SimpleCache.java b/test-runner/src/android/test/SimpleCache.java
index 44424ec..46143e4 100644
--- a/test-runner/src/android/test/SimpleCache.java
+++ b/test-runner/src/android/test/SimpleCache.java
@@ -19,6 +19,7 @@
import java.util.HashMap;
import java.util.Map;
+@Deprecated
abstract class SimpleCache<K, V> {
private Map<K, V> map = new HashMap<K, V>();
diff --git a/test-runner/src/android/test/SingleLaunchActivityTestCase.java b/test-runner/src/android/test/SingleLaunchActivityTestCase.java
index 72c93ce..af1448e 100644
--- a/test-runner/src/android/test/SingleLaunchActivityTestCase.java
+++ b/test-runner/src/android/test/SingleLaunchActivityTestCase.java
@@ -22,13 +22,19 @@
* If you would like to test a single activity with an
* {@link android.test.InstrumentationTestCase}, this provides some of the boiler plate to
* launch and finish the activity in {@link #setUp} and {@link #tearDown}.
- *
- * This launches the activity only once for the entire class instead of doing it
+ *
+ * This launches the activity only once for the entire class instead of doing it
* in every setup / teardown call.
+ *
+ * @deprecated Use
+ * <a href="{@docRoot}reference/android/support/test/rule/ActivityTestRule.html">
+ * ActivityTestRule</a> instead. New tests should be written using the
+ * <a href="{@docRoot}tools/testing-support-library/index.html">Android Testing Support Library</a>.
*/
+@Deprecated
public abstract class SingleLaunchActivityTestCase<T extends Activity>
extends InstrumentationTestCase {
-
+
String mPackage;
Class<T> mActivityClass;
private static int sTestCaseCounter = 0;
@@ -44,10 +50,10 @@
*/
public SingleLaunchActivityTestCase(String pkg, Class<T> activityClass) {
mPackage = pkg;
- mActivityClass = activityClass;
- sTestCaseCounter ++;
+ mActivityClass = activityClass;
+ sTestCaseCounter ++;
}
-
+
/**
* The activity that will be set up for use in each test method.
*/
@@ -66,7 +72,7 @@
getInstrumentation().setInTouchMode(false);
sActivity = launchActivity(mPackage, mActivityClass, null);
sActivityLaunchedFlag = true;
- }
+ }
}
@Override
@@ -75,7 +81,7 @@
sTestCaseCounter --;
if (sTestCaseCounter == 0) {
sActivity.finish();
- }
+ }
super.tearDown();
}
diff --git a/test-runner/src/android/test/SyncBaseInstrumentation.java b/test-runner/src/android/test/SyncBaseInstrumentation.java
index 7d418f0..de36b4f 100644
--- a/test-runner/src/android/test/SyncBaseInstrumentation.java
+++ b/test-runner/src/android/test/SyncBaseInstrumentation.java
@@ -27,7 +27,13 @@
* If you would like to test sync a single provider with an
* {@link InstrumentationTestCase}, this provides some of the boiler plate in {@link #setUp} and
* {@link #tearDown}.
+ *
+ * @deprecated Use
+ * <a href="{@docRoot}reference/android/support/test/InstrumentationRegistry.html">
+ * InstrumentationRegistry</a> instead. New tests should be written using the
+ * <a href="{@docRoot}tools/testing-support-library/index.html">Android Testing Support Library</a>.
*/
+@Deprecated
public class SyncBaseInstrumentation extends InstrumentationTestCase {
private Context mTargetContext;
ContentResolver mContentResolver;
diff --git a/test-runner/src/android/test/TestCase.java b/test-runner/src/android/test/TestCase.java
index 5432ce8..b234f44 100644
--- a/test-runner/src/android/test/TestCase.java
+++ b/test-runner/src/android/test/TestCase.java
@@ -23,14 +23,13 @@
* More complex interface for test cases.
*
* <p>Just implementing Runnable is enough for many test cases. If you
- * have additional setup or teardown, this interface might be for you,
+ * have additional setup or teardown, this interface might be for you,
* especially if you need to share it between different test cases, or your
* teardown code must execute regardless of whether your test passed.
*
* <p>See the android.test package documentation (click the more... link)
* for a full description
*/
-
@Deprecated
public interface TestCase extends Runnable
{
diff --git a/test-runner/src/android/test/TestCaseUtil.java b/test-runner/src/android/test/TestCaseUtil.java
index 3ba9711..c46d403 100644
--- a/test-runner/src/android/test/TestCaseUtil.java
+++ b/test-runner/src/android/test/TestCaseUtil.java
@@ -35,6 +35,7 @@
* @hide - This is part of a framework that is under development and should not be used for
* active development.
*/
+@Deprecated
public class TestCaseUtil {
private TestCaseUtil() {
@@ -67,7 +68,7 @@
*/
if (test instanceof TestCase &&
((TestCase)test).getName() == null) {
- workingTest = invokeSuiteMethodIfPossible(test.getClass(),
+ workingTest = invokeSuiteMethodIfPossible(test.getClass(),
seen);
}
if (workingTest == null) {
@@ -155,7 +156,7 @@
public static TestSuite createTestSuite(Class<? extends Test> testClass)
throws InstantiationException, IllegalAccessException {
- Test test = invokeSuiteMethodIfPossible(testClass,
+ Test test = invokeSuiteMethodIfPossible(testClass,
new HashSet<Class<?>>());
if (test == null) {
return new TestSuite(testClass);
diff --git a/test-runner/src/android/test/TestPrinter.java b/test-runner/src/android/test/TestPrinter.java
index 37bd721..a23f06d 100644
--- a/test-runner/src/android/test/TestPrinter.java
+++ b/test-runner/src/android/test/TestPrinter.java
@@ -30,9 +30,10 @@
* probably will not need to create or extend this class or call its methods manually.
* See the full {@link android.test} package description for information about
* getting test results.
- *
+ *
* {@hide} Not needed for 1.0 SDK.
*/
+@Deprecated
public class TestPrinter implements TestRunner.Listener, TestListener {
private String mTag;
@@ -89,7 +90,7 @@
mFailedTests.add(test.toString());
failed(test.toString(), t);
}
-
+
public void addError(Test test, Throwable t) {
failed(test, t);
}
diff --git a/test-runner/src/android/test/TestRunner.java b/test-runner/src/android/test/TestRunner.java
index 012df35..beecc6f 100644
--- a/test-runner/src/android/test/TestRunner.java
+++ b/test-runner/src/android/test/TestRunner.java
@@ -42,6 +42,7 @@
*
* {@hide} Not needed for 1.0 SDK.
*/
+@Deprecated
public class TestRunner implements PerformanceTestCase.Intermediates {
public static final int REGRESSION = 0;
public static final int PERFORMANCE = 1;
diff --git a/test-runner/src/android/test/TestSuiteProvider.java b/test-runner/src/android/test/TestSuiteProvider.java
index dc9ce6e..c74651c 100644
--- a/test-runner/src/android/test/TestSuiteProvider.java
+++ b/test-runner/src/android/test/TestSuiteProvider.java
@@ -21,6 +21,7 @@
/**
* Implementors will know how to get a test suite.
*/
+@Deprecated
public interface TestSuiteProvider {
TestSuite getTestSuite();
diff --git a/test-runner/src/android/test/TimedTest.java b/test-runner/src/android/test/TimedTest.java
index 95cc9bf..cb15ef9 100644
--- a/test-runner/src/android/test/TimedTest.java
+++ b/test-runner/src/android/test/TimedTest.java
@@ -30,6 +30,7 @@
*
* {@hide} Pending approval for public API.
*/
+@Deprecated
@Retention(RetentionPolicy.RUNTIME)
public @interface TimedTest {
boolean includeDetailedStats() default false;
diff --git a/test-runner/src/android/test/TouchUtils.java b/test-runner/src/android/test/TouchUtils.java
index 1b854b0..28dc7b2 100644
--- a/test-runner/src/android/test/TouchUtils.java
+++ b/test-runner/src/android/test/TouchUtils.java
@@ -31,9 +31,15 @@
* Reusable methods for generating touch events. These methods can be used with
* InstrumentationTestCase or ActivityInstrumentationTestCase2 to simulate user interaction with
* the application through a touch screen.
+ *
+ * @deprecated Use
+ * <a href="{@docRoot}training/testing/ui-testing/espresso-testing.html">Espresso UI testing
+ * framework</a> instead. New tests should be written using the
+ * <a href="{@docRoot}tools/testing-support-library/index.html">Android Testing Support Library</a>.
*/
+@Deprecated
public class TouchUtils {
-
+
/**
* Simulate touching in the center of the screen and dragging one quarter of the way down
* @param test The test case that is being run
@@ -46,7 +52,7 @@
public static void dragQuarterScreenDown(ActivityInstrumentationTestCase test) {
dragQuarterScreenDown(test, test.getActivity());
}
-
+
/**
* Simulate touching in the center of the screen and dragging one quarter of the way down
* @param test The test case that is being run
@@ -56,14 +62,14 @@
Display display = activity.getWindowManager().getDefaultDisplay();
final Point size = new Point();
display.getSize(size);
-
+
final float x = size.x / 2.0f;
final float fromY = size.y * 0.5f;
final float toY = size.y * 0.75f;
-
+
drag(test, x, x, fromY, toY, 4);
}
-
+
/**
* Simulate touching in the center of the screen and dragging one quarter of the way up
* @param test The test case that is being run
@@ -76,7 +82,7 @@
public static void dragQuarterScreenUp(ActivityInstrumentationTestCase test) {
dragQuarterScreenUp(test, test.getActivity());
}
-
+
/**
* Simulate touching in the center of the screen and dragging one quarter of the way up
* @param test The test case that is being run
@@ -86,18 +92,18 @@
Display display = activity.getWindowManager().getDefaultDisplay();
final Point size = new Point();
display.getSize(size);
-
+
final float x = size.x / 2.0f;
final float fromY = size.y * 0.5f;
final float toY = size.y * 0.25f;
-
+
drag(test, x, x, fromY, toY, 4);
}
-
+
/**
* Scroll a ViewGroup to the bottom by repeatedly calling
* {@link #dragQuarterScreenUp(InstrumentationTestCase, Activity)}
- *
+ *
* @param test The test case that is being run
* @param v The ViewGroup that should be dragged
*
@@ -109,11 +115,11 @@
public static void scrollToBottom(ActivityInstrumentationTestCase test, ViewGroup v) {
scrollToBottom(test, test.getActivity(), v);
}
-
+
/**
* Scroll a ViewGroup to the bottom by repeatedly calling
* {@link #dragQuarterScreenUp(InstrumentationTestCase, Activity)}
- *
+ *
* @param test The test case that is being run
* @param activity The activity that is in the foreground of the test case
* @param v The ViewGroup that should be dragged
@@ -132,7 +138,7 @@
/**
* Scroll a ViewGroup to the top by repeatedly calling
* {@link #dragQuarterScreenDown(InstrumentationTestCase, Activity)}
- *
+ *
* @param test The test case that is being run
* @param v The ViewGroup that should be dragged
*
@@ -144,11 +150,11 @@
public static void scrollToTop(ActivityInstrumentationTestCase test, ViewGroup v) {
scrollToTop(test, test.getActivity(), v);
}
-
+
/**
* Scroll a ViewGroup to the top by repeatedly calling
* {@link #dragQuarterScreenDown(InstrumentationTestCase, Activity)}
- *
+ *
* @param test The test case that is being run
* @param activity The activity that is in the foreground of the test case
* @param v The ViewGroup that should be dragged
@@ -162,10 +168,10 @@
next = new ViewStateSnapshot(v);
} while (!prev.equals(next));
}
-
+
/**
* Simulate touching the center of a view and dragging to the bottom of the screen.
- *
+ *
* @param test The test case that is being run
* @param v The view that should be dragged
*
@@ -177,10 +183,10 @@
public static void dragViewToBottom(ActivityInstrumentationTestCase test, View v) {
dragViewToBottom(test, test.getActivity(), v, 4);
}
-
+
/**
* Simulate touching the center of a view and dragging to the bottom of the screen.
- *
+ *
* @param test The test case that is being run
* @param activity The activity that is in the foreground of the test case
* @param v The view that should be dragged
@@ -188,10 +194,10 @@
public static void dragViewToBottom(InstrumentationTestCase test, Activity activity, View v) {
dragViewToBottom(test, activity, v, 4);
}
-
+
/**
* Simulate touching the center of a view and dragging to the bottom of the screen.
- *
+ *
* @param test The test case that is being run
* @param v The view that should be dragged
* @param stepCount How many move steps to include in the drag
@@ -205,10 +211,10 @@
int stepCount) {
dragViewToBottom(test, test.getActivity(), v, stepCount);
}
-
+
/**
* Simulate touching the center of a view and dragging to the bottom of the screen.
- *
+ *
* @param test The test case that is being run
* @param activity The activity that is in the foreground of the test case
* @param v The view that should be dragged
@@ -220,38 +226,38 @@
int[] xy = new int[2];
v.getLocationOnScreen(xy);
-
+
final int viewWidth = v.getWidth();
final int viewHeight = v.getHeight();
-
+
final float x = xy[0] + (viewWidth / 2.0f);
float fromY = xy[1] + (viewHeight / 2.0f);
float toY = screenHeight - 1;
-
+
drag(test, x, x, fromY, toY, stepCount);
}
/**
* Simulate touching the center of a view and releasing quickly (before the tap timeout).
- *
+ *
* @param test The test case that is being run
* @param v The view that should be clicked
*/
public static void tapView(InstrumentationTestCase test, View v) {
int[] xy = new int[2];
v.getLocationOnScreen(xy);
-
+
final int viewWidth = v.getWidth();
final int viewHeight = v.getHeight();
-
+
final float x = xy[0] + (viewWidth / 2.0f);
float y = xy[1] + (viewHeight / 2.0f);
-
+
Instrumentation inst = test.getInstrumentation();
long downTime = SystemClock.uptimeMillis();
long eventTime = SystemClock.uptimeMillis();
-
+
MotionEvent event = MotionEvent.obtain(downTime, eventTime,
MotionEvent.ACTION_DOWN, x, y, 0);
inst.sendPointerSync(event);
@@ -308,30 +314,30 @@
/**
* Simulate touching the center of a view and releasing.
- *
+ *
* @param test The test case that is being run
* @param v The view that should be clicked
*/
public static void clickView(InstrumentationTestCase test, View v) {
int[] xy = new int[2];
v.getLocationOnScreen(xy);
-
+
final int viewWidth = v.getWidth();
final int viewHeight = v.getHeight();
-
+
final float x = xy[0] + (viewWidth / 2.0f);
float y = xy[1] + (viewHeight / 2.0f);
-
+
Instrumentation inst = test.getInstrumentation();
long downTime = SystemClock.uptimeMillis();
long eventTime = SystemClock.uptimeMillis();
-
+
MotionEvent event = MotionEvent.obtain(downTime, eventTime,
MotionEvent.ACTION_DOWN, x, y, 0);
inst.sendPointerSync(event);
inst.waitForIdleSync();
-
+
eventTime = SystemClock.uptimeMillis();
final int touchSlop = ViewConfiguration.get(v.getContext()).getScaledTouchSlop();
@@ -344,7 +350,7 @@
event = MotionEvent.obtain(downTime, eventTime, MotionEvent.ACTION_UP, x, y, 0);
inst.sendPointerSync(event);
inst.waitForIdleSync();
-
+
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
@@ -354,7 +360,7 @@
/**
* Simulate touching the center of a view, holding until it is a long press, and then releasing.
- *
+ *
* @param test The test case that is being run
* @param v The view that should be clicked
*
@@ -369,20 +375,20 @@
/**
* Simulate touching the center of a view, holding until it is a long press, and then releasing.
- *
+ *
* @param test The test case that is being run
* @param v The view that should be clicked
*/
public static void longClickView(InstrumentationTestCase test, View v) {
int[] xy = new int[2];
v.getLocationOnScreen(xy);
-
+
final int viewWidth = v.getWidth();
final int viewHeight = v.getHeight();
-
+
final float x = xy[0] + (viewWidth / 2.0f);
float y = xy[1] + (viewHeight / 2.0f);
-
+
Instrumentation inst = test.getInstrumentation();
long downTime = SystemClock.uptimeMillis();
@@ -399,7 +405,7 @@
x + touchSlop / 2, y + touchSlop / 2, 0);
inst.sendPointerSync(event);
inst.waitForIdleSync();
-
+
try {
Thread.sleep((long)(ViewConfiguration.getLongPressTimeout() * 1.5f));
} catch (InterruptedException e) {
@@ -414,7 +420,7 @@
/**
* Simulate touching the center of a view and dragging to the top of the screen.
- *
+ *
* @param test The test case that is being run
* @param v The view that should be dragged
*
@@ -426,10 +432,10 @@
public static void dragViewToTop(ActivityInstrumentationTestCase test, View v) {
dragViewToTop((InstrumentationTestCase) test, v, 4);
}
-
+
/**
* Simulate touching the center of a view and dragging to the top of the screen.
- *
+ *
* @param test The test case that is being run
* @param v The view that should be dragged
* @param stepCount How many move steps to include in the drag
@@ -442,20 +448,20 @@
public static void dragViewToTop(ActivityInstrumentationTestCase test, View v, int stepCount) {
dragViewToTop((InstrumentationTestCase) test, v, stepCount);
}
-
+
/**
* Simulate touching the center of a view and dragging to the top of the screen.
- *
+ *
* @param test The test case that is being run
* @param v The view that should be dragged
*/
public static void dragViewToTop(InstrumentationTestCase test, View v) {
dragViewToTop(test, v, 4);
}
-
+
/**
* Simulate touching the center of a view and dragging to the top of the screen.
- *
+ *
* @param test The test case that is being run
* @param v The view that should be dragged
* @param stepCount How many move steps to include in the drag
@@ -463,21 +469,21 @@
public static void dragViewToTop(InstrumentationTestCase test, View v, int stepCount) {
int[] xy = new int[2];
v.getLocationOnScreen(xy);
-
+
final int viewWidth = v.getWidth();
final int viewHeight = v.getHeight();
-
+
final float x = xy[0] + (viewWidth / 2.0f);
float fromY = xy[1] + (viewHeight / 2.0f);
float toY = 0;
-
+
drag(test, x, x, fromY, toY, stepCount);
}
-
+
/**
* Get the location of a view. Use the gravity param to specify which part of the view to
* return.
- *
+ *
* @param v View to find
* @param gravity A combination of (TOP, CENTER_VERTICAL, BOTTOM) and (LEFT, CENTER_HORIZONTAL,
* RIGHT)
@@ -488,7 +494,7 @@
final int viewWidth = v.getWidth();
final int viewHeight = v.getHeight();
-
+
switch (gravity & Gravity.VERTICAL_GRAVITY_MASK) {
case Gravity.TOP:
break;
@@ -501,7 +507,7 @@
default:
// Same as top -- do nothing
}
-
+
switch (gravity & Gravity.HORIZONTAL_GRAVITY_MASK) {
case Gravity.LEFT:
break;
@@ -518,14 +524,14 @@
/**
* Simulate touching a view and dragging it by the specified amount.
- *
+ *
* @param test The test case that is being run
* @param v The view that should be dragged
* @param gravity Which part of the view to use for the initial down event. A combination of
* (TOP, CENTER_VERTICAL, BOTTOM) and (LEFT, CENTER_HORIZONTAL, RIGHT)
* @param deltaX Amount to drag horizontally in pixels
* @param deltaY Amount to drag vertically in pixels
- *
+ *
* @return distance in pixels covered by the drag
*
* @deprecated {@link android.test.ActivityInstrumentationTestCase} is deprecated in favor of
@@ -537,17 +543,17 @@
int deltaX, int deltaY) {
return dragViewBy((InstrumentationTestCase) test, v, gravity, deltaX, deltaY);
}
-
+
/**
* Simulate touching a view and dragging it by the specified amount.
- *
+ *
* @param test The test case that is being run
* @param v The view that should be dragged
* @param gravity Which part of the view to use for the initial down event. A combination of
* (TOP, CENTER_VERTICAL, BOTTOM) and (LEFT, CENTER_HORIZONTAL, RIGHT)
* @param deltaX Amount to drag horizontally in pixels
* @param deltaY Amount to drag vertically in pixels
- *
+ *
* @return distance in pixels covered by the drag
*
* @deprecated {@link android.test.ActivityInstrumentationTestCase} is deprecated in favor of
@@ -558,29 +564,29 @@
public static int dragViewBy(InstrumentationTestCase test, View v, int gravity, int deltaX,
int deltaY) {
int[] xy = new int[2];
-
+
getStartLocation(v, gravity, xy);
final int fromX = xy[0];
final int fromY = xy[1];
-
+
int distance = (int) Math.hypot(deltaX, deltaY);
drag(test, fromX, fromX + deltaX, fromY, fromY + deltaY, distance);
return distance;
}
-
+
/**
* Simulate touching a view and dragging it to a specified location.
- *
+ *
* @param test The test case that is being run
* @param v The view that should be dragged
* @param gravity Which part of the view to use for the initial down event. A combination of
* (TOP, CENTER_VERTICAL, BOTTOM) and (LEFT, CENTER_HORIZONTAL, RIGHT)
* @param toX Final location of the view after dragging
* @param toY Final location of the view after dragging
- *
+ *
* @return distance in pixels covered by the drag
*
* @deprecated {@link android.test.ActivityInstrumentationTestCase} is deprecated in favor of
@@ -595,14 +601,14 @@
/**
* Simulate touching a view and dragging it to a specified location.
- *
+ *
* @param test The test case that is being run
* @param v The view that should be dragged
* @param gravity Which part of the view to use for the initial down event. A combination of
* (TOP, CENTER_VERTICAL, BOTTOM) and (LEFT, CENTER_HORIZONTAL, RIGHT)
* @param toX Final location of the view after dragging
* @param toY Final location of the view after dragging
- *
+ *
* @return distance in pixels covered by the drag
*/
public static int dragViewTo(InstrumentationTestCase test, View v, int gravity, int toX,
@@ -610,28 +616,28 @@
int[] xy = new int[2];
getStartLocation(v, gravity, xy);
-
+
final int fromX = xy[0];
final int fromY = xy[1];
-
+
int deltaX = fromX - toX;
int deltaY = fromY - toY;
-
+
int distance = (int)Math.hypot(deltaX, deltaY);
drag(test, fromX, toX, fromY, toY, distance);
-
+
return distance;
}
/**
* Simulate touching a view and dragging it to a specified location. Only moves horizontally.
- *
+ *
* @param test The test case that is being run
* @param v The view that should be dragged
* @param gravity Which part of the view to use for the initial down event. A combination of
* (TOP, CENTER_VERTICAL, BOTTOM) and (LEFT, CENTER_HORIZONTAL, RIGHT)
* @param toX Final location of the view after dragging
- *
+ *
* @return distance in pixels covered by the drag
*
* @deprecated {@link android.test.ActivityInstrumentationTestCase} is deprecated in favor of
@@ -646,39 +652,39 @@
/**
* Simulate touching a view and dragging it to a specified location. Only moves horizontally.
- *
+ *
* @param test The test case that is being run
* @param v The view that should be dragged
* @param gravity Which part of the view to use for the initial down event. A combination of
* (TOP, CENTER_VERTICAL, BOTTOM) and (LEFT, CENTER_HORIZONTAL, RIGHT)
* @param toX Final location of the view after dragging
- *
+ *
* @return distance in pixels covered by the drag
*/
public static int dragViewToX(InstrumentationTestCase test, View v, int gravity, int toX) {
int[] xy = new int[2];
getStartLocation(v, gravity, xy);
-
+
final int fromX = xy[0];
final int fromY = xy[1];
-
+
int deltaX = fromX - toX;
drag(test, fromX, toX, fromY, fromY, deltaX);
-
+
return deltaX;
}
-
+
/**
* Simulate touching a view and dragging it to a specified location. Only moves vertically.
- *
+ *
* @param test The test case that is being run
* @param v The view that should be dragged
* @param gravity Which part of the view to use for the initial down event. A combination of
* (TOP, CENTER_VERTICAL, BOTTOM) and (LEFT, CENTER_HORIZONTAL, RIGHT)
* @param toY Final location of the view after dragging
- *
+ *
* @return distance in pixels covered by the drag
*
* @deprecated {@link android.test.ActivityInstrumentationTestCase} is deprecated in favor of
@@ -690,37 +696,37 @@
int toY) {
return dragViewToY((InstrumentationTestCase) test, v, gravity, toY);
}
-
+
/**
* Simulate touching a view and dragging it to a specified location. Only moves vertically.
- *
+ *
* @param test The test case that is being run
* @param v The view that should be dragged
* @param gravity Which part of the view to use for the initial down event. A combination of
* (TOP, CENTER_VERTICAL, BOTTOM) and (LEFT, CENTER_HORIZONTAL, RIGHT)
* @param toY Final location of the view after dragging
- *
+ *
* @return distance in pixels covered by the drag
*/
public static int dragViewToY(InstrumentationTestCase test, View v, int gravity, int toY) {
int[] xy = new int[2];
getStartLocation(v, gravity, xy);
-
+
final int fromX = xy[0];
final int fromY = xy[1];
-
+
int deltaY = fromY - toY;
drag(test, fromX, fromX, fromY, toY, deltaY);
-
+
return deltaY;
}
-
+
/**
* Simulate touching a specific location and dragging to a new location.
- *
+ *
* @param test The test case that is being run
* @param fromX X coordinate of the initial touch, in screen coordinates
* @param toX Xcoordinate of the drag destination, in screen coordinates
@@ -737,10 +743,10 @@
float fromY, float toY, int stepCount) {
drag((InstrumentationTestCase) test, fromX, toX, fromY, toY, stepCount);
}
-
+
/**
* Simulate touching a specific location and dragging to a new location.
- *
+ *
* @param test The test case that is being run
* @param fromX X coordinate of the initial touch, in screen coordinates
* @param toX Xcoordinate of the drag destination, in screen coordinates
@@ -757,7 +763,7 @@
float y = fromY;
float x = fromX;
-
+
float yStep = (toY - fromY) / stepCount;
float xStep = (toX - fromX) / stepCount;
diff --git a/test-runner/src/android/test/ViewAsserts.java b/test-runner/src/android/test/ViewAsserts.java
index c575fc5..00ab443 100644
--- a/test-runner/src/android/test/ViewAsserts.java
+++ b/test-runner/src/android/test/ViewAsserts.java
@@ -23,7 +23,15 @@
/**
* Some useful assertions about views.
+ *
+ * @deprecated Use
+ * <a href="{@docRoot}reference/android/support/test/espresso/matcher/ViewMatchers.html">Espresso
+ * View Matchers</a> instead. New test should be written using the
+ * <a href="{@docRoot}tools/testing-support-library/index.html">Android Testing Support Library</a>.
+ * For more information about UI testing, take the
+ * <a href="{@docRoot}tools/testing-support-library/index.html">Espresso UI testing</a> training.
*/
+@Deprecated
public class ViewAsserts {
private ViewAsserts() {}
diff --git a/test-runner/src/android/test/mock/MockApplication.java b/test-runner/src/android/test/mock/MockApplication.java
index 572dfbf..3257ecf 100644
--- a/test-runner/src/android/test/mock/MockApplication.java
+++ b/test-runner/src/android/test/mock/MockApplication.java
@@ -20,12 +20,17 @@
import android.content.res.Configuration;
/**
- * A mock {@link android.app.Application} class. All methods are non-functional and throw
- * {@link java.lang.UnsupportedOperationException}. Override it as necessary to provide the
+ * A mock {@link android.app.Application} class. All methods are non-functional and throw
+ * {@link java.lang.UnsupportedOperationException}. Override it as necessary to provide the
* operations that you need.
+ *
+ * @deprecated Use a mocking framework like <a href="https://github.com/mockito/mockito">Mockito</a>.
+ * New tests should be written using the
+ * <a href="{@docRoot}tools/testing-support-library/index.html">Android Testing Support Library</a>.
*/
+@Deprecated
public class MockApplication extends Application {
-
+
public MockApplication() {
}
@@ -38,7 +43,7 @@
public void onTerminate() {
throw new UnsupportedOperationException();
}
-
+
@Override
public void onConfigurationChanged(Configuration newConfig) {
throw new UnsupportedOperationException();
diff --git a/test-runner/src/android/test/mock/MockContentProvider.java b/test-runner/src/android/test/mock/MockContentProvider.java
index 5ef71df..3743fb0 100644
--- a/test-runner/src/android/test/mock/MockContentProvider.java
+++ b/test-runner/src/android/test/mock/MockContentProvider.java
@@ -41,7 +41,12 @@
* Mock implementation of ContentProvider. All methods are non-functional and throw
* {@link java.lang.UnsupportedOperationException}. Tests can extend this class to
* implement behavior needed for tests.
+ *
+ * @deprecated Use a mocking framework like <a href="https://github.com/mockito/mockito">Mockito</a>.
+ * New tests should be written using the
+ * <a href="{@docRoot}tools/testing-support-library/index.html">Android Testing Support Library</a>.
*/
+@Deprecated
public class MockContentProvider extends ContentProvider {
/*
* Note: if you add methods to ContentProvider, you must add similar methods to
diff --git a/test-runner/src/android/test/mock/MockContentResolver.java b/test-runner/src/android/test/mock/MockContentResolver.java
index aec6c77..75c8335 100644
--- a/test-runner/src/android/test/mock/MockContentResolver.java
+++ b/test-runner/src/android/test/mock/MockContentResolver.java
@@ -49,8 +49,12 @@
* <p>For more information about application testing, read the
* <a href="{@docRoot}guide/topics/testing/index.html">Testing</a> developer guide.</p>
* </div>
+ *
+ * @deprecated Use a mocking framework like <a href="https://github.com/mockito/mockito">Mockito</a>.
+ * New tests should be written using the
+ * <a href="{@docRoot}tools/testing-support-library/index.html">Android Testing Support Library</a>.
*/
-
+@Deprecated
public class MockContentResolver extends ContentResolver {
Map<String, ContentProvider> mProviders;
diff --git a/test-runner/src/android/test/mock/MockContext.java b/test-runner/src/android/test/mock/MockContext.java
index 64d2978..9b93bda 100644
--- a/test-runner/src/android/test/mock/MockContext.java
+++ b/test-runner/src/android/test/mock/MockContext.java
@@ -52,10 +52,15 @@
import java.io.InputStream;
/**
- * A mock {@link android.content.Context} class. All methods are non-functional and throw
+ * A mock {@link android.content.Context} class. All methods are non-functional and throw
* {@link java.lang.UnsupportedOperationException}. You can use this to inject other dependencies,
* mocks, or monitors into the classes you are testing.
+ *
+ * @deprecated Use a mocking framework like <a href="https://github.com/mockito/mockito">Mockito</a>.
+ * New tests should be written using the
+ * <a href="{@docRoot}tools/testing-support-library/index.html">Android Testing Support Library</a>.
*/
+@Deprecated
public class MockContext extends Context {
@Override
@@ -82,12 +87,12 @@
public Looper getMainLooper() {
throw new UnsupportedOperationException();
}
-
+
@Override
public Context getApplicationContext() {
throw new UnsupportedOperationException();
}
-
+
@Override
public void setTheme(int resid) {
throw new UnsupportedOperationException();
@@ -124,7 +129,7 @@
public ApplicationInfo getApplicationInfo() {
throw new UnsupportedOperationException();
}
-
+
@Override
public String getPackageResourcePath() {
throw new UnsupportedOperationException();
@@ -194,7 +199,7 @@
public File getObbDir() {
throw new UnsupportedOperationException();
}
-
+
@Override
public File getCacheDir() {
throw new UnsupportedOperationException();
@@ -216,7 +221,7 @@
}
@Override
- public SQLiteDatabase openOrCreateDatabase(String file, int mode,
+ public SQLiteDatabase openOrCreateDatabase(String file, int mode,
SQLiteDatabase.CursorFactory factory) {
throw new UnsupportedOperationException();
}
@@ -310,7 +315,7 @@
Bundle options) throws IntentSender.SendIntentException {
startIntentSender(intent, fillInIntent, flagsMask, flagsValues, extraFlags);
}
-
+
@Override
public void sendBroadcast(Intent intent) {
throw new UnsupportedOperationException();
diff --git a/test-runner/src/android/test/mock/MockCursor.java b/test-runner/src/android/test/mock/MockCursor.java
index 28fa0f8..576f24a 100644
--- a/test-runner/src/android/test/mock/MockCursor.java
+++ b/test-runner/src/android/test/mock/MockCursor.java
@@ -25,15 +25,18 @@
import android.os.Bundle;
/**
- * <P>
* A mock {@link android.database.Cursor} class that isolates the test code from real
* Cursor implementation.
- * </P>
- * <P>
+ *
+ * <p>
* All methods including ones related to querying the state of the cursor are
* are non-functional and throw {@link java.lang.UnsupportedOperationException}.
- * </P>
+ *
+ * @deprecated Use a mocking framework like <a href="https://github.com/mockito/mockito">Mockito</a>.
+ * New tests should be written using the
+ * <a href="{@docRoot}tools/testing-support-library/index.html">Android Testing Support Library</a>.
*/
+@Deprecated
public class MockCursor implements Cursor {
@Override
public int getColumnCount() {
diff --git a/test-runner/src/android/test/mock/MockDialogInterface.java b/test-runner/src/android/test/mock/MockDialogInterface.java
index e4dd0ba..d0a5a09 100644
--- a/test-runner/src/android/test/mock/MockDialogInterface.java
+++ b/test-runner/src/android/test/mock/MockDialogInterface.java
@@ -1,14 +1,33 @@
-// Copyright 2008 The Android Open Source Project
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package android.test.mock;
import android.content.DialogInterface;
/**
- * A mock {@link android.content.DialogInterface} class. All methods are non-functional and throw
- * {@link java.lang.UnsupportedOperationException}. Override it to provide the operations that you
+ * A mock {@link android.content.DialogInterface} class. All methods are non-functional and throw
+ * {@link java.lang.UnsupportedOperationException}. Override it to provide the operations that you
* need.
+ *
+ * @deprecated Use a mocking framework like <a href="https://github.com/mockito/mockito">Mockito</a>.
+ * New tests should be written using the
+ * <a href="{@docRoot}tools/testing-support-library/index.html">Android Testing Support Library</a>.
*/
+@Deprecated
public class MockDialogInterface implements DialogInterface {
public void cancel() {
throw new UnsupportedOperationException("not implemented yet");
diff --git a/test-runner/src/android/test/mock/MockPackageManager.java b/test-runner/src/android/test/mock/MockPackageManager.java
index 5296d4d..ffb73f6 100644
--- a/test-runner/src/android/test/mock/MockPackageManager.java
+++ b/test-runner/src/android/test/mock/MockPackageManager.java
@@ -60,7 +60,12 @@
* A mock {@link android.content.pm.PackageManager} class. All methods are non-functional and throw
* {@link java.lang.UnsupportedOperationException}. Override it to provide the operations that you
* need.
+ *
+ * @deprecated Use a mocking framework like <a href="https://github.com/mockito/mockito">Mockito</a>.
+ * New tests should be written using the
+ * <a href="{@docRoot}tools/testing-support-library/index.html">Android Testing Support Library</a>.
*/
+@Deprecated
public class MockPackageManager extends PackageManager {
@Override
diff --git a/test-runner/src/android/test/mock/MockResources.java b/test-runner/src/android/test/mock/MockResources.java
index 18752ce..880343e 100644
--- a/test-runner/src/android/test/mock/MockResources.java
+++ b/test-runner/src/android/test/mock/MockResources.java
@@ -32,10 +32,15 @@
import java.io.InputStream;
/**
- * A mock {@link android.content.res.Resources} class. All methods are non-functional and throw
- * {@link java.lang.UnsupportedOperationException}. Override it to provide the operations that you
+ * A mock {@link android.content.res.Resources} class. All methods are non-functional and throw
+ * {@link java.lang.UnsupportedOperationException}. Override it to provide the operations that you
* need.
+ *
+ * @deprecated Use a mocking framework like <a href="https://github.com/mockito/mockito">Mockito</a>.
+ * New tests should be written using the
+ * <a href="{@docRoot}tools/testing-support-library/index.html">Android Testing Support Library</a>.
*/
+@Deprecated
public class MockResources extends Resources {
public MockResources() {