How do I enable debug mode in Eclipse for SWT?
- Create a .options file in the same directory as your eclipse executable.
- Place the following lines in the .options file:
org.eclipse.ui/debug=true
org.eclipse.ui/debug/swtdebugglobal=true - Start up eclipse from the command line with the debug flag: ./eclipse -debug
All messages from SWT will be printed to the console window.
Q: How can I implement user interaction tests?
org.eclipse.swt.widgets.Display.post(Event)
can be used to post mouse and keyboard events into the OS, which emulates the user performing the specified action. This is the typical approach that is used for implementing JUnit test cases.
There are also stand-alone applications available for automating SWT user interaction tests:
- SWTBot (open source)
- Abbot for SWT (open source)
- Instantiations Window Tester (commercial)