0

I have issue with Roboguice 2.0 and testing. All injections in my app works fine, but in my LoaderTestCases I got an error

java.lang.IllegalArgumentException: android.app.ContextImpl@42678aa0 does not appear to be a RoboGuice context (instanceof RoboContext)
at roboguice.inject.ContextScope.getScopedObjectMap(ContextScope.java:147)
at roboguice.inject.ContextScope.enter(ContextScope.java:79)........

I trying to search way to fix it. Can you help me? Thank you in advance!

Taras Sheremeta
  • 117
  • 1
  • 1
  • 8
  • Could you share the source code for LoaderTestCases? – dragi Oct 17 '14 at 08:33
  • public class LoadersTest extends LoaderTestCase{... where LoaderTestCase is http://developer.android.com/reference/android/test/LoaderTestCase.html – Taras Sheremeta Oct 17 '14 at 08:37
  • I haven't used it, but if you share the code of your class that gives you the error, then maybe I can be more helpful. – dragi Oct 17 '14 at 11:21
  • There are any special cases. I have loader extends from RoboAsyncTaskLoader. And I have simple test for my loader. I use method getLoaderResultSynchronously(loader) for get loader result in my test. When my custom loader try to inject members I've got exception. – Taras Sheremeta Oct 17 '14 at 11:28

0 Answers0