Skip to content

Most visited

Recently visited

navigation
Added in API level 1

android.test

A framework for writing Android test cases and suites.

For more information, see the Testing developer guide.

Annotations

FlakyTest This @interface was deprecated in API level 24. Use FlakyTest instead. New tests should be written using the Android Testing Support Library.  
UiThreadTest This @interface was deprecated in API level 24. Use UiThreadTest instead. New tests should be written using the Android Testing Support Library.  

Interfaces

PerformanceTestCase More complex interface performance for test cases. 
PerformanceTestCase.Intermediates Callbacks for PerformanceTestCase
TestSuiteProvider Implementors will know how to get a test suite. 

Classes

ActivityInstrumentationTestCase<T extends Activity> This class was deprecated in API level 3. new tests should be written using ActivityInstrumentationTestCase2, which provides more options for configuring the Activity under test  
ActivityInstrumentationTestCase2<T extends Activity> This class was deprecated in API level 24. Use ActivityTestRule instead. New tests should be written using the Android Testing Support Library.  
ActivityTestCase This class was deprecated in API level 24. New tests should be written using the Android Testing Support Library.  
ActivityUnitTestCase<T extends Activity> This class was deprecated in API level 24. Write Local Unit Tests instead.  
AndroidTestCase This class was deprecated in API level 24. Use InstrumentationRegistry instead. New tests should be written using the Android Testing Support Library.  
AndroidTestRunner This class was deprecated in API level 24. Use AndroidJUnitRunner instead. New tests should be written using the Android Testing Support Library.  
ApplicationTestCase<T extends Application> This class was deprecated in API level 24. Use InstrumentationRegistry instead. New tests should be written using the Android Testing Support Library.  
InstrumentationTestCase This class was deprecated in API level 24. Use InstrumentationRegistry instead. New tests should be written using the Android Testing Support Library.  
InstrumentationTestRunner This class was deprecated in API level 24. Use AndroidJUnitRunner instead. New tests should be written using the Android Testing Support Library.  
InstrumentationTestSuite This class was deprecated in API level 24. Use InstrumentationRegistry instead. New tests should be written using the Android Testing Support Library.  
IsolatedContext This class was deprecated in API level 24. New tests should be written using the Android Testing Support Library.  
LoaderTestCase A convenience class for testing Loaders. 
MoreAsserts This class was deprecated in API level 24. Use Hamcrest matchers instead.  
ProviderTestCase<T extends ContentProvider> This class was deprecated in API level 3. this class extends InstrumentationTestCase but should extend AndroidTestCase. Use ProviderTestCase2, which corrects this problem, instead.  
ProviderTestCase2<T extends ContentProvider> This test case class provides a framework for testing a single ContentProvider and for testing your app code with an isolated content provider. 
RenamingDelegatingContext This class was deprecated in API level 24. New tests should be written using the Android Testing Support Library.  
ServiceTestCase<T extends Service> This class was deprecated in API level 24. Use ServiceTestRule instead. New tests should be written using the Android Testing Support Library.  
SingleLaunchActivityTestCase<T extends Activity> This class was deprecated in API level 24. Use ActivityTestRule instead. New tests should be written using the Android Testing Support Library.  
SyncBaseInstrumentation This class was deprecated in API level 24. Use InstrumentationRegistry instead. New tests should be written using the Android Testing Support Library.  
TouchUtils This class was deprecated in API level 24. Use Espresso UI testing framework instead. New tests should be written using the Android Testing Support Library.  
ViewAsserts This class was deprecated in API level 24. Use Espresso View Matchers instead. New test should be written using the Android Testing Support Library. For more information about UI testing, take the Espresso UI testing training.  

Errors

AssertionFailedError This class was deprecated in API level 16. use junit.framework.AssertionFailedError  
ComparisonFailure This class was deprecated in API level 16. use junit.framework.ComparisonFailure  
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.