On Thursday, September 11, 2014 11:46:49 AM UTC+2, VaraKalyan Maddi wrote:
>
>
> Hi All,
>
> I couldn't get much documentation about unit testing for activities and 
> places.
> Can any one point me an example or an doc for this.
>

Well, there's not much to say.

PlaceTokenizers and ActivityMappers can quite easily be unit-tested.
Activities are a bit different, but you should be able to "simulate" their 
lifecycle from your test (call start()→mayStop()→onStop(), and/or 
start()→onCancel()). You can use a mock/stub/fake/dummy AcceptsOneWidget 
and a real event bus on which you'll listen to events (you might want to 
use a CountingEventBus).
And to test "navigation", you can use mock/stub/fake/dummy 
PlaceController.Delegate and/or PlaceHistoryHandler.Historian.

It all depends on what your activities are doing though, and possibly 
whether you're using MVP in your activities, and in which form (abstracting 
the view behind an interface –you can then mock/stub the view– vs. using 
UiBinder –you can then use GWTMockito from Google). The hardest is to 
mock/stub your data access, so you'd probably better abstract them behind 
interfaces you can easily mock/stub.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Reply via email to