O'Reilly logo

Android Application Development with Maven by Patroklos Papapetrou, Jonathan LALOU

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Running Android instrumentation tests

Android uses, like we already saw, JUnit 3. It is the underlying framework to support instrumentation testing execution. All the tests you will write need to extend one of the following classes that extend the basic class ActivityTestCase:

  • ActivityInstrumentationTestCase2: This class is used for running activity tests
  • ProviderTestCase2: This class is used for running tests of content providers and making sure that your tests always run against a clean dataset
  • ServiceTestCase: This class is used for validating the various states of your services

Tip

Keep in mind also that each of the previously mentioned base test classes provide specific methods and features that facilitate the testing of their target components. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required