SimpleTestCursor robolectric 3.0— compilation issue

瘦欲@ 提交于 2019-12-31 04:30:10

问题


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'
}

回答1:


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.



来源:https://stackoverflow.com/questions/32499667/simpletestcursor-robolectric-3-0-compilation-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!