That will cause a class called com.myapp.Application to be loaded. However, if you create a class with the same name and package, but with "Test" prepended to the class name, Robolectric will load that instead.

package com.myapp;class TestApplication extends Application {}

The Application Lifecycle

Robolectric now automatically calls an application's onCreate() method before the test runs, and onTerminate() after the test runs. Note that this a change from earlier versions. If you want to prevent your application's onCreate() method from being called, you can override it in a test class and have it do nothing.

If your test application implements the TestLifecycleApplication interface, it will get called with a few more useful events:

These changes should make it possible for many people to avoid overriding RobolectricTestRunner altogether. Note that you can still change this by using your own subclass of RobolectricTestRunner, which provides a different TestLifecycle class.

1. Where to find Robolectric 2.0 alpha 3? It doesn't appear to be on maven.2. We're working on a relatively new project, is 2.0 alpha 3 stable enough for us to use, or will we constantly be running into weird issues that will be resolved prior to release?3. Is 2.0 compatible with junit 4.11? I assume it is but thought I'd ask (while I'm at it).