Android ServiceTestCase for IntentService -
Android ServiceTestCase for IntentService -
i'm writing unit tests android application , stumbled next issue:
i utilize servicetestcase test intentservice this:
@override public void setup() throws exception { super.setup(); } public void testservice() { intent intent = new intent(getsystemcontext(), myintentservice.class); super.startservice(intent); assertnotnull(getservice()); } however noticed intentservice created (means oncreate called) never receive phone call onhandleintent(intent intent)
has tested intentservice servicetestcase class?
thanks!
i got started testing own intentservice , it's proving bit of headache.
still trying work things out scenario seems not receive phone call method onhandleintent(), (i'm not technicalities behind junit forgive utilize of terminology) should because test framework, based on code, tears downwards or end test method 1 time phone call startservice returns. there insufficient time onhandleintent triggered.
i verified above theory adding infinite loop within test case - can see log statements in onhandleintent logged.
android servicetestcase
Comments
Post a Comment