[JIRA] (GLAZEDLISTS-594) Fix broken GUI-related tests after move to JUnit 4

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[JIRA] (GLAZEDLISTS-594) Fix broken GUI-related tests after move to JUnit 4

JIRA jira-no-reply@java.net

    [ https://java.net/jira/browse/GLAZEDLISTS-594?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=393397#comment-393397 ]

brands commented on GLAZEDLISTS-594:

On Mac, I noticed, that AutoCompleteSupportTest hangs.
Setting system property "java.awt.headless" to true solved the problem.

With this setting TableComparatorChooserTest crashed the JVM on Windows with Java 7u60 und Java 7u80.
Therefore I disabled it when "java.awt.headless" is true.

> Fix broken GUI-related tests after move to JUnit 4
> --------------------------------------------------
>                 Key: GLAZEDLISTS-594
>                 URL: https://java.net/jira/browse/GLAZEDLISTS-594
>             Project: glazedlists
>          Issue Type: Bug
>          Components: swt
>    Affects Versions: 1.9.1
>            Reporter: brands
>            Assignee: brands
>             Fix For: 1.10.0
> 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
> - rename @ExecuteOnMainThread to something like @ExecuteOnNonUIThread
> - run  SWT @ExecuteOnNonUIThread tests on a thread different to the main thread (= SWT display thread)
> - 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