我正在尝试使用Roboelectric在Maven / Eclipse中为我的Android应用程序创建一些测试。
我在Robolectric类的方法buildActivity()中有一个错误:
The method buildActivity(Class<MyActivity>) is undefined for the type Robolectric
这就是我所说的:
@Before
public void setup() {
activity = Robolectric.buildActivity(StartActivity.class).create()
.get();
}
这是我对POM.xml的依赖:
<dependency>
<groupId>org.robolectric</groupId>
<artifactId>robolectric</artifactId>
<version>2.0-alpha-2</version>
<scope>test</scope>
</dependency>
欢迎提出任何建议。 谢谢你的时间。