Czy Robolectric obsługuje poziom API?

Mam test, który chciałbym uruchomić z Robolectric, używam 2.3-SNAPSHOT, ponieważ moja aplikacja używa ActionbarCompat potrzebnego do użycia wersji 2.3-SNAPSHOT, ponieważ Robolectric nie mógł wcześniej znaleźć motywów AppCompat. Więc ustawiam ścieżkę Classpath w Eclipse i kończę na tym:

java.lang.UnsupportedOperationException: Robolectric does not support API level 9, sorry!
at org.robolectric.SdkConfig.<init>(SdkConfig.java:24)
at org.robolectric.RobolectricTestRunner.pickSdkVersion(RobolectricTestRunner.java:288)
at org.robolectric.RobolectricTestRunner.getEnvironment(RobolectricTestRunner.java:264)
at org.robolectric.RobolectricTestRunner.access$100(RobolectricTestRunner.java:57)
at org.robolectric.RobolectricTestRunner$2.evaluate(RobolectricTestRunner.java:186)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.robolectric.RobolectricTestRunner$1.evaluate(RobolectricTestRunner.java:172)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

Manifest mojego projektu testowego wygląda następująco:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.vendor.test" 
      android:versionCode="1"
      android:versionName="1.0">
      <application>
           <uses-library android:name="android.test.runner" />
      </application>
      <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="19" />
      <instrumentation android:name="android.test.InstrumentationTestRunner"
       android:targetPackage="com.vendor" />
</manifest>

Zawsze narzekam na poziom API, bez względu na to, z czego korzystam.

Czy ktoś to działa?

questionAnswers(3)

yourAnswerToTheQuestion