It's not possible. The whole ActivityUnitTestCase class is stubbed and does
nothing.

On Wed, Feb 25, 2015 at 5:43 AM, Yiğit Ünlü <[email protected]> wrote:

> Hey everyone!
>
> I'm wondering is it possible to use new unit test feature can be used with
> *ActivityUnitTestCase*. I tried many and farthest I have come is
> following stack trace.
>
> java.lang.RuntimeException: *Method runTest in
> android.test.InstrumentationTestCase not mocked*. See
> https://sites.google.com/a/android.com/tools/tech-docs/unit-testing-support
> for details.
> at
> android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java)
> at
> org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:86)
> at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
> at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67)
>
> and this is my setUp():
>
>  @Override
>     public void setUp() throws Exception {
>         Context context = getInstrumentation().getTargetContext(); //crash
>         intent = new Intent(context, ImageViewerActivity.class);
>     }
>
> 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.
>



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

Reply via email to