Top "Robolectric" questions

Robolectric is a unit testing framework that allows Android applications to be tested on the JVM in seconds without using an emulator or device.

Robolectric can't find resource or manifest file

I've created a new TestProject and added following line to my testMethod: Robolectric.getShadowApplication().getString(R.string.mystring); My test …

android android-manifest robolectric
The meta-data tag in your app's AndroidManifest.xml does not have the right value

I am running into the issue where Robolectric is having trouble with my AndroidManifest.xml. My app runs fine, but …

android gradle robolectric
Is there a JVM command-line option to change directory?

In short, I want to know, is there a JVM command-line option to change the starting working directory? If it's …

java android jvm robolectric infinitest
Where is log output written to when using Robolectric + Roboguice?

I'm using Robolectric to test Android. I'm running my tests via maven, e.g. mvn -Dtest=LogTest test If I …

java android maven-2 roboguice robolectric
How do you import a Maven dependency from Sonatype.org?

I'm trying to import Robolectric into my Maven project, with: <dependency> <groupId>com.pivotallabs</groupId&…

maven robolectric sonatype
AndroidHttpClient not found (when running Robolectric)

I've set up a very simple project to test the integration of Robolectric + Data Binding + Retrolambda. When I run the …

android data-binding robolectric retrolambda
Robolectric: Resources$NotFoundException: String resource ID with Android Gradle Plugin 3

Android Studio 3.0 Beta2 classpath 'com.android.tools.build:gradle:3.0.0-beta3' testCompile 'org.robolectric:robolectric:3.4.2' Test class that I …

android unit-testing testing android-testing robolectric
How get the context in Robolectric 3

I was able to access to the application context in Robolectric 2.x in this way but don't know how to …

java robolectric
How to use robolectric to test started intent with extra data

In an activity, I started a new Intent with some random extra data: Intent newIntent = new Intent(this, UserActivity.class); …

android testing android-intent robolectric
Robolectric and Android SDK 29

When will Robolectric be compatible with Android SDK 29? Did I upgraded too early by changing targetSdkVersion and compileSdkVersion to 29? When …

android robolectric android-10.0