• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

SWT/JFace and testing

 
author
Posts: 87
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the authors!

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?

Thanks.
 
author
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
J.B.,

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.

Matt Scarpino
 
author
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi J.B.-

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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic