Have you tried using Robotium? It looks like the blog you're citing is using a unit/functional test case class to do higher-level functional testing of the content provider, and that's not what the Android test cases are designed for. Robotium can run through a sequence of steps to do a functional test, if what you want to do is test the Activity and its relationship to the content provider.
Keep in mind that I know nothing about your app, but *in general* I would test an app by unit testing its individual POJOs (Plain Ol' Java Obejcts), then its Android components (Activity, ContentProvider, and so forth) using the unit/functional tests, and then its end-to-end functionality using Robotium or similar. I call the test cases like ActivityInstrumentationTestCase2 unit/ functional tests because they're designed to do JUnit-style tests on a class (each test is one path through one method), but they require external non-injectable dependencies (they have to run in the Android system) that violate strict unit test standards. They also take longer to run, which is also a unit test no-no. On Jan 22, 11:52 pm, Ian <[email protected]> wrote: > I've got an Activity which uses the Contact DB, and I'm looking to > auto-test this. I see several solutions in the past, but one (http:// > dtmilano.blogspot.com/2009/12/android-testing-contentprovider.html) > provides a link to 'android-mock' which links to a commercial site, > and another (by Tenacious33) is out of date. > > Can anybody help me get android-mock, or is there an even better > alternative? > > Many Thanks > Ian Hunter -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

