[android-developers] Re: Test Starting A Service
Hi Kostya,
Thanks for the suggestion, I'll use that and get on to more important
things :-)
Ian
On Dec 18, 2:08 pm, Kostya Vasilyev <kmans...@gmail.com> wrote:
> Bind always returns true if the intent finds the service, but actual start
> is delayed (if necessary). The return value is not an indication of current
> state, as you've already discovered.
>
> One possibility is to make a static in the service for testing only, set it
> in onCreate and cleared in onDestroy.
>
> --
> Kostya Vasilyev --http://kmansoft.wordpress.com
> 18.12.2010 17:03 пользователь "Ian" <ian.fawcett.hun...@gmail.com> написал:> I have a scenario...
>
> > 1. User presses button.
> > 2. Dialog opens; user presses 'OK'
> > 3. Activity starts a service.
>
> > I wish to provide a JUnit test for (3).
>
> > Can anybody please advise me how to do this.
>
> > I've tried using ActivityInstrumentationTestCase2 for my MyActivity,
> > testing that the service is not running, using Robotium to drive GUI,
> > and then testing service is running.
>
> > The initial test that the service is NOT running (using bind()) always
> > passes true, even though I'm using 0 as last param. which I
> > *understand* will not do AUTO_CREATE.
>
> > Any ideas/info appreciated.
>
> > [I understand there is ServiceTestCase for testing the service, but I
> > only want to test that the Activity starts the service correctly].
>
> > Many Thanks
> > Ian Hunter
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscribe@googlegroups.com<android-developers%2Bunsubscribe@googlegroups.com>
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
>
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home