Java Reference
In-Depth Information
GWTTestCase
tip
You use the
GWTTestCase
class to test the application logic of the web client, not
the user interface. Although seemingly an obstacle, this forces you to factor your
GWT application cleanly between code for user interaction and application logic.
This is a design best practice that you should follow.
Let's first look at how to create a
GWTTestCase
manually before we show how to use
junitCreator. The example we use in this section is adapted from the
GWT
Stock-
Watcher example
26
and extended with an
RPC
. Figure 13.5 shows what the application
looks like running in hosted mode.
Our example tests the StockWatcher remote procedure call (
RPC
) to get stock
price information for an array of stock symbols. We focus on
RPC
, because it's the
heart of
GWT
JU
nit testing.
Figure 13.5
Running StockWatcher in
hosted mode
26