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'
}
indi mars
  • 133
  • 3
  • 8

1 Answers1

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.

Steve C
  • 1,034
  • 10
  • 12
  • ThankYou Steve, that was what I was looking for. – indi mars Sep 11 '15 at 02:36
  • Do you have any ides to test Vibrator Service android. Please have a look on my question:-- http://stackoverflow.com/questions/32688359/robolectric-3-0-testing-vibrator-service – indi mars Sep 21 '15 at 06:08