我一直在尝试在robotium中实现数据库,以便我可以参数化并使其面向数据,但我完全迷失了请指导我。下面提到了我的robotium代码,请指导我如何打开与sqlite的数据库连接。
package com.dialog.test;
import android.test.ActivityInstrumentationTestCase2;
import com.jayway.android.robotium.solo.Solo;
public class TestNew extends ActivityInstrumentationTestCase2 {
private Solo solo;
//private Activity Main;
private static Class class1;
static
{
try {
class1=Class.forName("com.botskool.DialogBox.DialogBox");
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
public TestNew() {
super("com.botskool.DialogBox", class1);
}
@Override
protected void setUp() throws Exception {
super.setUp();
this.solo = new Solo(getInstrumentation(), getActivity());
}
@Override
protected void tearDown() throws Exception{
try {
this.solo.finalize();
} catch (Throwable e) {
e.printStackTrace();
}
getActivity().finish();
super.tearDown();
}
public void testDisplay(){
solo.clickOnButton(0);
solo.clickOnButton("Ok");
solo.clickOnButton(2);
}
}
即使是最小的指导也会有很大的帮助谢谢