JUnit4 is supported if you use the unit test support because it's just a POJO (or mocked dependencies). If you need instrumentation, the new AndroidJUnitRunner which is part of the Android Testing Support Library supports JUnit4.
Check out the samples: https://github.com/googlesamples/android-testing/tree/master/testrunner/AndroidJunitRunnerSample On Wednesday, 18 February 2015 17:06:32 UTC, Dan O'Neill wrote: > > Does the Unit Testing support described here, > http://tools.android.com/tech-docs/unit-testing-support, which uses > JUnit4 in screenshots imply direct support for JUnit4? The > InstrumentationTestRunner doc still does not state support for JUnit4. > > On Tuesday, February 25, 2014 at 10:33:20 AM UTC-9, Xavier Ducrohet wrote: >> >> We're working on JUnit4 support. >> >> For pure POJO testing, make a pure Java project, you'll be able to run >> tests there. >> >> >> On Tue, Feb 25, 2014 at 11:18 AM, Kaushik Gopal <[email protected]> wrote: >> >>> I'm looking for two things specifically: >>> >>> - running tests from the IDE (Android Studio) without needing to go >>> through the Android Stack (so pure POJO testing). >>> - Junit 4 support >>> >>> >>> There have been quite a few threads on the subject and my intention is >>> not to beleaguer the point. I'm just looking to see if >>> >>> 1. is this on the roadmap at all >>> 2. if yes, an approximate timeframe (months or year) >>> >>> >>> Knowing this information will greatly help me form a testing strategy >>> for my current projects (if i should look at external libraries/tools or >>> bite the bullet until elegant/native support comes in). >>> >>> Cheers and Rock on. >>> >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "adt-dev" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> For more options, visit https://groups.google.com/groups/opt_out. >>> >> >> >> >> -- >> Xavier Ducrohet >> Android SDK Tech Lead >> Google Inc. >> http://developer.android.com | http://tools.android.com >> >> Please do not send me questions directly. Thanks! >> > -- You received this message because you are subscribed to the Google Groups "adt-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
