I have studied the android test framework recently and have some questions about the differences between ActivityInstrumentationTestCase2 and SingleLaunchActivityTestCase test case classes. I know the difference in definition. ActivityInstrumentationTestCase2 class is used in functional testing and can let developer to mock intent. This is an important feature for activity which may deal with multiple intents. SingleLaunchActivityTestCase class is for testing an activity which does not change from test to test because it set up and tear down once and can test the activity handles multiple calls correctly. However, in my opinion, we also can organize multiple calls into one method and use ActivityInstrumentationTestCase2 class for this kind of test. Does anyone know about some scenarios which SingleLaunchActivityTestCase should adopt rather than ActivityInstrumentationTestCase2? By the way, in android Dev document, it said that “SingleLaunchActivityTestCase test case is useful for testing an activity that runs in a mode other than standard. “, which means we can use it in the other modes such as singleTop, singleTask, and singleInstance. Why is SingleLaunchActivityTestCase suitable for these three modes? Is it because SingleLaunchActivityTestCase class launches activity once so it can simulate these modes?
-- 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

