This sample is the test application for the Activity Testing tutorial. It tests the Spinner example application.

The test application uses the ActivityInstrumentationTestCase2 test case class, which extends both Android instrumentation and the JUnit TestCase class. The test runner is InstrumentationTestRunner.

The application shows how to set up a test application project, how to create the AndroidManifest.xml file for a test application, and how to set up a test case class for a test fixture. The test case class, SpinnerActivityTest, contains tests that demonstrate the following Android test patterns:

The manifest declares an <instrumentation> element that links the test application with the application under test. Specifically, the element's android:name attribute specifies InstrumentationTestRunner as the instrumentation to use. The android:targetPackage attribute specifies com.android.example.spinner as the name of the Android package that contains the application under test.

The initial user interface for the Spinner sample application The JUnit view in Eclipse with ADT, showing a successful test run of SpinnerTest