Testing RPC in GWT

There is very little information about sticking with GWTTestCase (instead of TestCase) and using fake server-side service implementation.
Problem:
You do not want to make any database-calls when your client-side tests run (when client-side tests make RPC calls to the service impl). You already have to live with crappy test speeds due to GWT test framework starting up an invisible hosted-mode browser to be able to execute JavaScript (that many widgets natively use) and you am too lazy to refactor your code to follow the GWT using MVC model example (to be able to stop using GWTTestCase).
Solution:
Define a separate fake service implementation (TestServiceImpl) and a module for testing (TestModule.gwt.xml). Simply make a copy of the production module, and change the contents of the
Voila! Tests run, they return expected values (either baked into TestServiceImpl or if you get fancy, your TestServiceImpl can implement a nice in-memory data store).
You can now be confident that your asynchronous RPC mechanism works as intended and you can test the production ServiceImpl separately (using JUnit).
Reader Comments (1)
Try the SyncProxy (support both sync & async mode) to test GWT RPC services in JRE
See the post at http://www.gdevelop.com/w/blog/2010/01/10/testing-gwt-rpc-services/ for details