現在、Android アプリケーションの単体テストを作成していて、次の問題に遭遇しました。
を使用して、次のようServiceTestCase
にテストします。IntentService
@Override
public void setUp() throws Exception {
super.setUp();
}
public void testService()
{
Intent intent = new Intent(getSystemContext(), MyIntentService.class);
super.startService(intent);
assertNotNull(getService());
}
ただし、自分IntentService
が作成されていることに気付きました(onCreate
呼び出されたことを意味します)が、への呼び出しを受け取ることはありませんonHandleIntent(Intent intent)
クラスですでにテストした人IntentService
はいますか?ServiceTestCase
ありがとう!