If you can structure your project so that the POJOs live in a separate
Java module, then this should already work. See this example:
https://android.googlesource.com/platform/tools/base/+/master/build-system/tests/multiproject/util/build.gradle
You can add Junit tests to the src/test/java folder, and the Gradle
Java plugin and Android Studio can run those.

If your classes are inside an Android module (app/library), then
you'll have to run them on the device.

On Tue, Feb 25, 2014 at 11:52 AM, Kaushik Gopal <[email protected]> wrote:
> Thanks Xavier :).
>
> Just to clarify my POJO testing point:
>
> I would like to run it from Android Studio itself, parallel to my existing
> Android project environment (since the POJOs i'm testing are part of my
> Android project). I can run AndroidTestCase, TestCase &
> ActivityInstrumentationTestCase2 flawlessly from AS and it's perfect for a
> quick workflow. Achieving something similar for POJO tests (without going
> through the Android stack, so it's lightening quick) would be awesome.
>
> If this is already possible, please let me know if i'm missing something
> blatantly obvious.
>
>
> On Tuesday, February 25, 2014 11:33:20 AM UTC-8, 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
>>>
>>> is this on the roadmap at all
>>> 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/groups/opt_out.

-- 
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.

Reply via email to