Robolectric

Robolectric provides an implementation for the Android SDK for your local JVM installation. So instead of packaging up a testing *.apk and deploying it to the device just to run the unit tests, you can instead execute the code on your development machine. This huge timesaver and popular tool is also available for Scala on Android users. You can even take this one step further and leverage the advanced features of ScalaTest instead of plain old junit.

Usage

Place your unit tests in the ./src/test/scala directory. All test classes may be equipped with an @Config annotation for Robolectric. The annotation allows you to manually specify the AndroidManifest.xml file location or Android SDK version to use for text execution.

Below is a fully functional test case taken from the Hello Scala! repository.