Can I/Should I test my *ServiceImpl class? (GAE+GWT+MVP)

33 views
Skip to first unread message

Drew Spencer

unread,
Jul 14, 2011, 8:45:26 AM7/14/11
to google-we...@googlegroups.com
Hey coders,

I wonder if anyone can help me. I'm still learning GAE+GWT and trying to get into unit testing as I go along. I have finally managed to get my head around MVP and have written some basic tests to test my presenters, using mock objects for the view and server-side service. All good.

My question is this: How can I test whether my RPC calls are working? Should I even be trying to test them?

For example, in my ServiceImpl class I have a function fillDatastore() that populates it with some dummy data - I would like to be able to run this on the datastore stub, using LocalServiceTestHelper, a bit like this test, but using my server side code instead of putting the actual insert code into the test itself: http://code.google.com/appengine/docs/java/tools/localunittesting.html#Writing_Datastore_and_Memcache_Tests

As far as I understand it - I can't use GWT.create() to make a real rpc service in a TestCase (have to mock it), and I can't create a datastore stub inside a GwtTest. If anyone can point me in the right direction, tell me where I'm confused I would appreciate it greatly.

Cheers,

Drew
Reply all
Reply to author
Forward
0 new messages