SimpleTestCursor robolectric 3.0-- compilation issue
Asked Answered
N

1

1

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 missing some dependency? I have looked internet but no support. Please help.

I am trying to use:this API and following is the import

import org.robolectric.tester.android.database.SimpleTestCursor;

These are my dependencies:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile "org.robolectric:robolectric:3.0"

    testCompile "org.robolectric:shadows-support-v4:3.0"
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:22.2.0'
    compile 'com.google.code.gson:gson:2.3'
    compile 'com.android.support:support-v4:22.1.0'
    compile 'com.google.android.gms:play-services:7.5.0'
}
Nares answered 10/9, 2015 at 10:42 Comment(3)
Why do you need that specific class?Klement
@Eugen I have test cases with robolectric 2.4 , which I want to port to 3.0. But its tedious, provided no reference to depricated APIsNares
@EugenMartynov-- One more robolectric question, Please have a look:-- #32688859Nares
P
2

SimpleTestCursor has been replaced by RoboCursor in version 3 of Robolectric.

Have a look at robolectric/robolectric-shadows/shadows-core/src/main/java/org/robolectric/fakes/RoboCursor.java and robolectric/robolectric/src/test/java/org/robolectric/fakes/RoboCursorTest.java.

Prudery answered 10/9, 2015 at 20:55 Comment(2)
ThankYou Steve, that was what I was looking for.Nares
Do you have any ides to test Vibrator Service android. Please have a look on my question:-- #32688859Nares

© 2022 - 2024 — McMap. All rights reserved.