title: Robolectric InstrumentationTestCase IllegalStateException No instrumentation registered
body: <p>I'm trying to write a very simple instrumentation test case with code to run on UI thread. Here is the test class:</p>
  
  <pre><code>@RunWith(RobolectricTestRunner.class)
  @Config(manifest = "src/main/AndroidManifest.xml", sdk = 18)
  public class GetTimeFromServerTest extends InstrumentationTestCase {
      Context context = RuntimeEnvironment.application;
      private MainActivity activity;
      private Instrumentation instr;
  
      @Before
      public void setUp() throws Exception {
          activity = Robolectric.buildActivity(MainActivity.class).create().get();
      super.setUp();
          injectInstrumentation(InstrumentationRegistry.getInstrumentation());
          instr = getInstrumentation();
      }
  
      @Test
      public void someTest() throws Throwable {
  
              runTestOnUiThread(new Runnable() {
                  @Override
                  public void run() {
                      doSomething();
                  }
              });
  
          }
  }
  </code></pre>
  
  <p>But when I try to invoke <code>injectInstrumentation(InstrumentationRegistry.getInstrumentation())</code> I get</p>
  
  <pre><code>java.lang.IllegalStateException: No instrumentation registered! Must run under a registering instrumentation.
  at android.support.test.InstrumentationRegistry.getInstrumentation(InstrumentationRegistry.java:45)
  at com.m1_mm.tools.GetTimeFromServerTest.setUp(GetTimeFromServerTest.java:53)
  at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
  at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
  at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
  at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
  at org.robolectric.RobolectricTestRunner$2.evaluate(RobolectricTestRunner.java:251)
  </code></pre>
  
  <p>How can this test be runned?</p>