|
Re: Borachio: Mock Objects for Scala and Android
|
Posted: Jul 6, 2011 10:59 AM
|
|
I have a general, novice, non-Scala question about unit testing on Android. Like, how do you do it? :-)
For example, let's say I am using android.graphics.PointF. And write a Java JUNIT test:
public void testBah() {
PointF aPointF = new PointF(1.2f, 3.4f);
aPointF.offset(4.5f, 5.6f);
assertEquals(5.7f, aPointF.x);
assertEquals(9.0f, aPointF.y);
}
(More realistically, I'd be testing one of my own classes, but it uses PointF internally)
When I run it under Eclipse, you get the Stub runtime error:
java.lang.RuntimeException: Stub! at android.graphics.PointF.<init>(PointF.java:5)
Do you have to run the tests under the Android emulator, which is really really really slow? Or is there some basic workaround?
Thanks!
|
|