Closed GoogleCodeExporter closed 8 years ago
Please try using mockito-1.9.5 and the new dexmaker-1.0 jar files.
Original comment by limpbizkit
on 19 Oct 2012 at 9:28
Hi, I am also experiencing this issue. I have followed the set-up instructions
against Jesse Wilson's post,
http://corner.squareup.com/2012/10/mockito-android.html.
Notably, Jesse indicates that there are 3 jars required;
1. dexmaker-1.0.jar
2. dexmaker-mockito-1.0.jar
3. mockito-all-1.9.5.jar
Does this go any distance to explaining the before mentioned stacktrace?
Original comment by oceanlif...@gmail.com
on 24 Oct 2012 at 8:00
Hi again.
Since I build/manage my Android applications with maven and I don't want to
resort to include jars or setup my own repository with "special jars", I'm
really looking forward to when the Dexmaker 1.0 with dependency to Mockito
1.9.5 hits the public repositories.
Maven central haven't received them yet but I guess they will be up soon.
My wish is that if the maven artifact and the dependencies work then I should
only have to include one dependency and then it should just work ;)
On a side note it does work via maven (as stated before) IF I setup a local
repo and add the "special jars" - both via maven builds and in Intellij 11. I
guess it would work with Eclipse to.
Oh, I think the stacktrace is simply because that setup won't work - dexmaker
isn't "kicking in", since there are cglib references in the stacktrace.
Regards
Niclas
Original comment by nirr...@gmail.com
on 24 Oct 2012 at 8:30
Hi Niclas,
Thank you for your comment. I've posted something on SO
(http://stackoverflow.com/questions/13048985/verifyerror-using-mockito-1-9-5-and
-dexmaker-mockito-1-0) to share the problem and post a solution as and when one
appears! If I had a penny for everytime I started TDD on Android and failed! :S
Regards,
David
Original comment by oceanlif...@gmail.com
on 24 Oct 2012 at 1:04
Answered my own question on SO if you were interested Niclas. Obviously I
didn't understand that the emulator was not good enough for this
android-mockito implementation. Still missing something but glad I have a
mocking framework in Android!
Original comment by oceanlif...@gmail.com
on 25 Oct 2012 at 10:23
Maybe I have misunderstood something but ...
I have Dexmaker and Mockito working with the help of maven BUT via the "special
jars" installed locally in my local maven repo from
http://www.paulbutcher.com/2012/05/mockito-on-android-step-by-step/, running on
an android 2.3 emulator (!).
Since I'm using "old" versions of both dexmaker and mockito I have the
following in my tests setup method:
getInstrumentation().getTargetContext().getCacheDir(); (This statement should
not be needed in the dexmaker 0.9+ release though ...)
After that statement I have mock(SomeClass.class, RETURNS_DEEP_STUBS) and
mock(SomeOtherClass.class) and they work in IntelliJ 11 and if I run them via
maven.
But as I mentioned in the previous post, I really don't want to do all theses
special things. I don't want to introduce any special environment setups. It
should just work with one or two maven dependencies ;)
/niclas
Original comment by nirr...@gmail.com
on 25 Oct 2012 at 2:55
Original issue reported on code.google.com by
nirr...@gmail.com
on 15 Oct 2012 at 6:40