This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
It's no secret that my primary interest in any software package, framework or platform has to do with designing for testability. Do you have an opinion as to how well SWT/JFace mesh with, say, a test-driven development approach? In particular, is it any easier to test SWT/JFace-based UIs in isolation from the rest of the application than, say, Swing/AWT? If so, can you give an example?
Author of <a href="http://www.amazon.com/exec/obidos/ASIN/1932394230/ref=jranch-20" target="_blank" rel="nofollow">JUnit Recipes: Practical Methods for Programmer Testing</a>
Steve can probably answer this better, but I'll give it a shot. I've used JUnit and JFCUnit, but I haven't explored SWT testability.
Eclipse provides a plug-in called org.eclipse.swt.tests that you can download from their CVS site. This contains many, many JUnit tests for SWT widgets and you can customize them for your use. There's a similar package for org.eclipse.jface.tests.
Also, the Eclipse Test & Performance Tools project is shaping up to test everything Eclipse-related and more. I don't know if it's ready for prime time, but it's worth investigating.
I'll keep looking though, and I'll keep you posted if I find anything.
Co-author of <a href="http://www.amazon.com/exec/obidos/ASIN/1932394273/ref=jranch-20" target="_blank" rel="nofollow">SWT/JFace in Action</a>
I actually don't have a whole lot to add, Matt's recommendations are probably the best place to look in terms of getting ideas.
As for a comparison with Swing, to be honest I've never really come up with a good strategy for unit testing UI components, whether Swing/SWT/Web based/whatever. Maybe I should check out your book . I'd guess that you'll have approximately the same issues in running tests against SWT components as you would against Swing. Using JFace and the Viewer framework does make testing some things fairly straightforward, because you can test LabelProviders, Sorters, Filters, ContentProviders etc. on their own, but there still isn't any good way that I know of to test the actual widgets that eventually get displayed to the user.
Stephen Holder<br />Co-author of <a href="http://www.amazon.com/exec/obidos/ASIN/1932394273/ref=jranch-20" target="_blank" rel="nofollow"><i>SWT/JFace in Action</i></a>