After the move to JUnit 4 GUI-related testing support for Swing and SWT was refactored to use JUnit rules.
Those rules ensure that all test methods of a GUI test class are run on the GUI thread of the corresponding toolkit (Swing or SWT).
For the SWT case, a dedicated, separate thread was picked in the SWT rules as GUI thread. This turned out to be a problem on other platforms such as MacOs. At least on Mac it' seems to be a requirement for the GUI thread to be the main thread. Also, VM argument "-XstartOnFirstThread" seems to be required on Mac.
So this fix will include the following:
- create the SWT stuff (display, shell) on the main thread for Mac
- rename @ExecuteOnMainThread to something like @ExecuteOnNonUIThread
- run SWT @ExecuteOnNonUIThread tests on a thread different to the main thread (= SWT display thread) on Mac
- ignore SWT tests on Mac that create a custom display on a different thread
- in the ANT build add the -XstartOnFirstThread flag when executing unit tests on Mac
This message was sent by Atlassian JIRA