How to mix Android JUnit classes with plain JUnit classes in same project
Is it possible to have both Android JUnit classes (i.e. extends ActivityInstrumentationTestCase2<>
) with plain JUnit classes (i.e. extends TestCase
) in the same pro开发者_Python百科ject?
Some of the classes in my app are "generic" (i.e. do not require an activity or the emulator to be tested) and I would like to created test cases for them, but without having to create a separate test project.
Is this possible?
Yes, you can. There should be no problem in having different super classes in the same test project.
See this http://marakana.com/tutorials/android/junit-test-example.html
This is the best tutorial I have found on the subject.
精彩评论