我认为tearDown()
应该在每次测试之后运行,但我从日志中看到的是它是在setUp()
方法之后启动的。你们能澄清一下吗?
public class LaunchManagerActivityTest extends ActivityInstrumentationTestCase2<LaunchManagerActivity> {
private Solo solo;
public LaunchManagerActivityTest() {
super(LaunchManagerActivity.class);
}
protected void setUp() throws Exception {
super.setUp();
Log.e("Dev", "setup");
solo = new Solo(getInstrumentation(), getActivity());
}
protected void tearDown() throws Exception {
super.tearDown();
Log.e("Dev", "tearDown ");
}
输出:
02-11 11:33:33.095: E/Dev(26779): setup
02-11 11:33:34.395: E/Dev(26779): tearDown