I've been able to test Widgets with JUnit in a project I'm working on.
I'm able to make widgets, see that they respond to external events
(notifications about state they observe, or event types they're
subscribed to via an EventBus, that sort of thing), and even send UI
events to them:
final MyWidget myWidget = new MyWidget(...);
myWidget.someButton.fireEvent(new ClickEvent() { });
//assert that the right things happened
The anonymous subclass of ClickEvent feels a little hacky, but it works
for us because our widgets (for the most part) just care that they got
clicked, they don't care about x and y coords, etc etc.
Writing the tests was relatively straightforward, but getting them to
run as part of a Maven build took some doing. A pom with all the
necessary incantations is here:
https://open.med.harvard.edu/svn/shrine/trunk/code/webclient/pom.xml
I don't know if that's minimal or not; I started with what was generated
by the gwt-maven-plugin, and tweaked the pom until it did what I wanted.
:/ We use a TestSuite (ugh) and follow the naming conventions for test
classes and suites recommended by the gwt-maven-plugin docs.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
iEYEARECAAYFAk+XRSEACgkQ0GFaTS4nYxviVACeMqLdXljCkWI3lrS9tCDBulvF
pqkAn24TZuVGsdOccZTBDCWlGsGjpMi/
=G4pS
-----END PGP SIGNATURE-----