我有几个简单的测试,如 assertNotNull(mActivity);
(我在读M.D.TorresAndroid应用程序测试指南)。被测活动运行正常。每一个测试运行没关系,以及。但是如果我在上一次的第二个测试运行多个测试 getActivity()
永不再来。在logcat中没有错误(最后一行启动意图......),什么都没有。调试时也无能为力,如果我踏进 getActivity()
它抱怨没有可用的源$ C $ C。结果另一个测试项目 - 从谷歌ActivityTesting没关系运行,即使多次试验,这样的Eclipse配置正确结果。有没有人遇到过这样的事情?
I have a couple of simple tests, like assertNotNull(mActivity);
(I'm reading M.D.Torres "Android Application Testing Guide"). The activity under test runs okay. Every single test runs okay as well. But if I run several tests at once on the second test getActivity()
never returns. No errors in logcat (last line "Starting Intent ..."), no nothing. Debugging doesn't help much either, if I step into getActivity()
it complains that there is no source code available.
Another test project - ActivityTesting from Google runs okay even with several tests, so Eclipse is configured right.
Did anybody ever encounter something like that?
我重新测试项目一次(如洁净室)和它的工作。然后,我比较两个项目,发现罪魁祸首。这是空的拆机:
I recreated test project once more (like "clean room") and it worked. Then I compared two projects and found the culprit. It was empty teardown:
protected void tearDown() throws Exception {
}
如果我删除它,所有的测试运行的绿色。如果我贴回去,第二次测试挂起。现在,我想读的解释,并准备将其标记为答案。
If I remove it, all tests run green. If I paste it back, second test hangs. Now I would like to read the explanation and ready to mark it as answer.
编辑:我应该叫 super.tearDown()
在拆机年底
方法。对不起,打扰大家。
I should be calling super.tearDown()
at the end of the tearDown
method.
Sorry for bothering everybody.
上一篇:你如何确定的Windows 32或64位架构使用Java?架构、Windows、Java
下一篇:尝试在 DataFrame.pivot 中使用多索引时出现 ValueError索引、DataFrame、pivot、ValueError