Skip to end of metadata
Go to start of metadata

Please follow these tips to make sure that your GUI tests respect Swing's threading rules:

  1. Read about Swing's threading rules. In short, the cardinal rule is: creation and access of Swing components should be done in the Event Dispatch Thread (EDT.)
  2. Creation and any direct access to Swing components should be done via GuiActionRunner using a GuiQuery or GuiTask, because JUnit and TestNG tests do not run on the EDT. More details can be found here.
  3. Access of Swing components through FEST APIs is already EDT-safe.
  4. It is strongly recommended to use FailOnThreadViolationRepaintManager to catch EDT-access violations. More details can be found here.

Many thanks to Eric Kolotyluk, for pointing out the need to document this important information.

Update: A detailed list of tips on how to write EDT-safe GUI tests can be found here.

  • No labels