下面列出了怎么用android.test.AndroidTestCase的API类实例代码及写法,或者点击链接到github查看源代码。
@Override
protected void run(final TestCase test) {
if (test instanceof AndroidTestCase) {
((AndroidTestCase) test).setContext(instr.getTargetContext());
}
if (test instanceof InstrumentationTestCase) {
((InstrumentationTestCase) test).injectInstrumentation(instr);
}
super.run(test);
}