Book Image

Learning Android Application Testing

Book Image

Learning Android Application Testing

Overview of this book

Table of Contents (16 chapters)
Learning Android Application Testing
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

The ActivityTestCase class


This is mainly a class that holds common code for other test cases that access Instrumentation.

You can use this class if you are implementing a specific behavior for test cases and the existing alternatives don't fit your requirements. This means you are unlikely to use this class unless you want to implement a new base class for other tests to use. For example, consider a scenario where Google brings out a new component and you want to write tests around it (like SuperNewContentProvider).

If this is not the case, you might find the following options more suitable for your requirements:

  • ActivityInstrumentationTestCase2<T extends Activity>

  • ActivityUnitTestCase<T extends Activity>

The abstract class android.test.ActivityTestCase extends android.test.InstrumentationTestCase and serves as a base class for other different test cases, such as android.test.ActivityInstrumentationTestCase, android.test.ActivityInstrumentationTestCase2, and android.test.ActivityUnitTestCase...