Here is a quick reply of things to look at (not a tutorial):

* See samples/ApiDemos which has examples of different kinds of tests.
 *ALWAYS* start here;  If you can't get these working, there's no
point in trying to get your own tests working.

* To test standalone code (not Activities) you'll want to base your
test on TestCase (for pure unit tests) or AndroidTestCase (for unit
tests that require Context parameters).

* To test Activities, you actually have three choices:
** InstrumentationTestCase will launch your app, and you can manually
start activities and send events into them.  This is good for testing
UI state of your entire application, esp. if you want to track
transitions between Activities, but less helpful for testing single
Activities.
** ActivityInstrumentationTestCase will launch a specific activity,
you can either send events into them or make calls directly to the
object.  This is usually more useful for testing single Activities.
** Both of those actually "launch" your activity within the real
system (ActivityManager, etc).  ActivityUnitTestCase will create your
activity outside of the regular system, just as an isolated object,
which is lighter weight but not all methods work properly.

* There are also test case classes for other system classes, e.g.
ApplicationTestCase.



On Mon, Dec 22, 2008 at 1:54 AM, Manjunatha M (ಮಂಜುನಾಥ ಎಂ)
<man...@gmail.com> wrote:
> Hi All,
>
> I need your help how to test the Android application.
>
> I need to test each activity and  automate some test cases.
>
> Which class should be used to like "ActivityUnitTestCase" or any thing else?
>
> How do we run those test cases?
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to