robolectric-gradle-plugin Questions
6
Solved
I'm trying to use Robolectric to run unit tests but the Android Studio is not recognizing the class on:
@RunWith(RobolectricTestRunner.class)
Details:
classpath 'com.android.tools.build:gradle:...
Grossularite asked 14/11, 2017 at 11:24
6
I am using Robolectric library and the latest version of it v4.3.1 requires Java 9 to run. I am trying to point JRE on edit configurations but I am not finding Java 9 in the drop-down, even though ...
Cicelycicenia asked 23/10, 2019 at 6:27
2
I am trying to run a unit test like that:
@org.junit.jupiter.api.Test
void junit5codeCoverage() {
final int result = new Foo().junit5();
Assert.assertEquals(Looper.getMainLooper().getThread()...
Prone asked 27/10, 2017 at 8:50
4
Solved
I have a problem with configuring Robolectric in my project. I am also using Kotlin, if it matters.
Here is my build.gradle
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
appl...
Pincers asked 16/10, 2017 at 7:34
4
Solved
I have tried to test my code with robolectric. Problem is that it has duplicated References. e.g.
java.lang.RuntimeException: java.lang.RuntimeException: Duplicate class org.apache.maven.artifact....
Lurk asked 21/8, 2019 at 14:45
1
Updated to Android Studio 3.1 and its corresponding gradle. I'm getting a message when trying to sync "The SourceSet 'robolectric' is not recognized by the Android Gradle Plugin. Perhaps you misspe...
Bignoniaceous asked 10/4, 2018 at 12:25
3
Solved
When updating to gradle plugin 1.1.0 I kept getting the following error
Cannot add a configuration with name 'testCompile' as a configuration with that name already exists
I am also using the Ro...
Zoilazoilla asked 25/2, 2015 at 21:6
1
java.lang.AssertionError: Error(s) present: [java.lang.IllegalStateException: Illegal connection pointer 1. Current pointers for thread Thread[RxCachedThreadScheduler-8,5,main] []] (latch = 0, valu...
Mercantilism asked 5/11, 2017 at 11:47
2
I've just set up Roboelectric 3.2.2 with a new app and I have written my first simple test:
@RunWith(RobolectricTestRunner.class)
@Config(manifest="src/main/AndroidManifest.xml",
packageName="my....
Dedradedric asked 16/2, 2017 at 18:34
1
Solved
I just want to test that getting a String resource equals what I think it should equal. My issue seems to be that I have Realm in my project. I know that Robolectric doesn't support Realm (it state...
Selfinduced asked 20/7, 2017 at 22:54
2
I have a android project that has multiple library modules and I am trying to test a specific package that contains all modules.
I tried this command:
./gradlew -Dtest.single=com.moduleone* testP...
Ullage asked 20/10, 2016 at 14:56
1
Solved
So I recently merged my robolectric 3.0 upgrade with our mainline, which had added multidex support to our application. Unfortunately, this had the unfortunate side effect of causing our tests to f...
Vaporing asked 7/7, 2015 at 22:53
1
Solved
I am trying to ShadowClass Crashlytics/Fabric so that Robotlectric 3 tests do not fail. What I have so far is this:
The custom test runner that adds the Shadow class for Fabric:
public class Test...
Okie asked 1/5, 2016 at 17:27
3
I'm using the robolectric-gradle-plugin for robolectric unit tests. I don't want to fail a build on failed tests. Is there a way in DSL or a property not to fail a test on the build similar to -Dte...
Walkthrough asked 7/7, 2014 at 15:49
6
Solved
I am trying to get Robolectric tests up and working in our current project, and not having a lot of luck. My preference would be to get these to run within Android Studio 1.1.0+. This is my project...
Marchpane asked 24/2, 2015 at 15:55
1
Solved
I am trying to test the cursor in my app.
But for the following import I get the error message-- cannot resolve symbol
tester. I am using Robolectric 3.0. Why the import is not resolving, am I mi...
Nares asked 10/9, 2015 at 10:42
2
Solved
I am studying Robolectric.
My project dir is,
My unit test codes MainActivityTest are as follows,
package com.example.activity;
import android.app.Activity;
import com.example.BuildConfig;
i...
Mitzvah asked 7/5, 2015 at 4:13
2
I'm on Android Studio 1.2, Robolectric 3.0-rc2.
I have two test classes, one called MotdTest with one test method that tests for POJO json serialization & deserialization. The other is called ...
Solutrean asked 5/5, 2015 at 19:25
5
Solved
I downloaded Robolectric deckard-gradle project from https://github.com/robolectric/deckard-gradle and imported to Android Studio.
On my first run i got
!!! JUnit version 3.8 or later expected:...
Genotype asked 18/7, 2014 at 13:31
1
Solved
I have trouble loading resources when running unit tests from command line. It works fine in IntelliJ.
I'm using:
com.android.tools.build:gradle:1.1.3
org.robolectric:robolectric-gradle-plugin:1...
Facient asked 9/4, 2015 at 8:2
3
Solved
I am working on upgrading my codebase to Gradle 2.2 and Android Studio 1.0. I am currently trying to get Robolectric 2.4 working, but I am experiencing a strange issue when I try and run Unit Tests...
Bukavu asked 19/12, 2014 at 21:32
2
Solved
My current Gradle configuration has multiple (Merged) res folders:
sourceSets {
androidTest {
setRoot('src/test')
}
main {
res.srcDirs =
[
'src/main/res/features/registration',
'src/main/r...
Earl asked 23/12, 2014 at 10:39
1
Solved
I simply want to test with robolectric if a certain view is visible in a fragment.
My unit test looks like this:
ActivityController controller = Robolectric.buildActivity(FragmentActivity.class);
...
Oriente asked 20/3, 2015 at 18:6
1
© 2022 - 2024 — McMap. All rights reserved.