What are the differences in the varies Android test case classes? That are more than 10 classes in the android.test
package that end with "TestCase".
The difference between AcitivtyTestCase
and ServiceTestCase
is trivial. But what's the difference between ActivityTestCase
, ActivityInstrumentationTestCase
, and ActivityUnitTestCase
?
Typically you do not use the ActivityTestCase class its existence is mostly so that ActivityInstrumentationTestCase (do not use this, it is deprecated), ActivityInstrumentationTestCase2 and ActivityUnitTestCase can inherit useful common functionality from.
From there the difference is mostly down to what sort of testing you want to do. Functional/Integration testing is best done within ActivityInstrumentationTestCase2 while unit testing of an activity is from ActivityUnitTestCase. The difference is mostly down to the methods available in the classes and typically with android being open source any method you want from one that isn't in the other (I have never had this) you can just go and get and probably add yourself.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With