Un-shadowed Method Warnings!
In response to yesterday’s question about Un-shadowed Method Warnings, Pivot Tyler points out that you can turn these on by calling
On two workstations every unit test was failing with the following error:
// …many levels of stack trace, finally:
Caused by: com.xtremelabs.robolectric.bytecode.IgnorableClassNotFoundException: msg because of javassist.NotFoundException: android.content.DialogInterface$OnShowListener
Cause: there was an old
tmp/cached-robolectric-classes.jar that was causing these errors and our tests ran successfully after deleting it. That’s two answers from Pivot Tyler!
Don’t DDOS Yourself With Your Own App
The Bump Android team wrote an article about a good idea gone wrong. Moral of the story: not all devices behave the same, and this might cripple your servers rather than the devices.
Robolectric Google Group
Join it, contribute, and learn about unit testing your Android apps.
We’re trying an experiment: since we currently have several Android projects at Pivotal Labs, and Android development and testing is hard, we are going to post to the blog the tips, tricks, gotchas, and conundrums we find.
Emulator and Orientation
Android will destroy and recreate activities upon screen orientation change. One way to prevent this is to set
android:configChanges="orientation" in your
AndroidManifest.xml (article here):
This prevents android from calling
onCreate() on a device, but not within the emulator; annoyingly, the Activity is still recreated within the emulator.
Un-shadowed Method Warnings?
Once again we spent about 15 minutes debugging a failing unit test only to find that there was no Robolectric implementation/shadow for one of the Android methods under test (
ArrayAdapter#insert in our case). I would be nice to have a “warning mode” where Robolectric would log warning for all un-shadowed methods. I wish we knew the guys who wrote Robolectric…
There is meeting tonight at 7pm in San Francisco about using MongoDB for mobile backend servers. Will Shulman from MongoLab will be giving the talk. They will also be offering food and prizes to attendees.
More details can be found at: