android - Eclipse 中的 Robolectric 初始化错误

标签 android unit-testing robolectric

我目前正在关注 this tutorial关于使用 Robolectric for Eclipse。而且我似乎无法让它发挥作用。它不断抛出 initializationError 并且在 Failure Trace 中它有一个 java.lang.noClassDefFoundError

enter image description here

教程似乎还不够。或更新。

最佳答案

我找到了解决方案。我下载了错误的 Robolectric jar 文件。您必须使用找到的 jar-with-dependencies.jar here .然后一切顺利。

关于android - Eclipse 中的 Robolectric 初始化错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23507562/

相关文章:

android - 在 SQLite 数据库查询中设置多个选择参数

android - 删除和添加 View NPE、蜂窝、android

android - 如何将 recyclerview 重置为原始状态(EMPTY)?

javascript - 在对显示模块进行单元测试时如何 stub 私有(private)函数

android - JaCoCo 不适用于 Robolectric 测试

android - Robolectric:如何设置希望 Calendar 类返回的时间?

java - Android 测试 - Robolectric + Mockito + Retrofit 出现 Wanted 但未调用错误

android - 在 RxJava 中将 Singles 链接在一起

android - RxAndroid, Retrofit 2 单元测试 Schedulers.io

c# - 单元测试 - 相同的方法但用于不同的测试数据