極品收藏

時間 2021-05-30 10:53:38

1樓:金陽光

你說這個問題困擾2周。我覺得第一你應該去官網查問題,因為這個問題特別常見。官網有這樣一段話:

You will encounter a process crash error when you run your test, to resolve this, override the tearDown() method in your test class which extends form TmtsTestCase, just make it to be an empty method and run test methods one by one. override後無法自動關閉activity了,為神馬呢?

說白了就是你要在指令碼執行完畢複寫tearDown,你肯定沒按照junit指令碼規範些case。你肯定在同乙個執行緒做了finish()方法,所以讓執行緒沒法自己殺自己的執行緒。

說到這裡你應該知道應該怎麼辦了吧。

正好金Sunny單元測試零基礎正好是詳細講解junit4,你有空去學習下。

url:[GS]金Sunny自測試