I have some kind of test that I would like to run with Robolectric, I use 2.3-SNAPSHOT since my APP uses ActionbarCompat, which I need to use version 2.3-SNAPSHOT, since Robolectric could not find AppCompat themes before. So I set up Classpath in Eclipse, and I end up with the following:
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)
The manifest of my test project is as follows:
<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>
I always complain about the API level, no matter what I use.
Has anyone got this job?
android robolectric
Kitesurfer Dec 12 '13 at 10:59 2013-12-12 10:59
source share