Hello,
I've posted a bit of a spike experimenting with an SWT driver, it can
be found at
http://groups.google.com/group/windowlicker-users/web/window-licker-swt-spike.patch
I'm not proposing it go into the source or anything but would be
really interested in peoples thoughts. Most of it is a blatant cut and
paste from the Swing part but with minor adaptations for SWT. In
particular, have a look at the following classes
SwtCalculator and SwtBasicArithmeticTests (both unfinished but
demonstrate the idea)
TextDriverTest
UIThread (tries to make more explicit the creation of the UI thread)
The jist of it all is that we have to create a UI thread to run the
SWT stuff from within the test without blocking the actual tests. The
solution I came up with means that any application that wants to use
the framework would need to change slightly but I can't see a way to
avoid this.
The change is kind of minor and when I think about it, actually makes
good sense for SWT apps. It means that rather than like most SWT apps
that start the event dispatching loop from within the main thread, you
should code your app to *optionally* start the event loop (which is
how JFace do it with the ApplicationWindow class). The UIThread class
tries to help here and test code is free to use it to make more
explicit the creation of the UI thread. The tests will then run in the
main thread. Anyway, hopefully the code explains it better than I do!
oh, the other thing is that the patch doesn't include the SWT/JFace
jars that you'll need to actually run it. You can download these from;
http://code.google.com/p/gibble/source/browse/trunk/gibble/lib/jface
http://code.google.com/p/gibble/source/browse/trunk/gibble/lib/swt
All the best,