Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix swing tests #365

Merged
merged 4 commits into from
Jan 3, 2021
Merged

Conversation

Gamebuster19901
Copy link
Contributor

@Gamebuster19901 Gamebuster19901 commented Dec 31, 2020

This pull request fixes a threading issue in the testing environment, which was discovered in #362.

It is unsafe to perform operations on swing components outside of the event dispatcher thread. Junit by default completes tests on a thread which is not the event dispatch thread.

I've created SwingTestSuite.class, which is a test suite that executes all tests in the event dispatcher thread.

Any class in the testing environment which performs operations on swing components should be annotated with @ExtendWith(SwingTestSuite.class) so the tests will be executed in the swing test suite.

@Gamebuster19901 Gamebuster19901 marked this pull request as draft December 31, 2020 05:47
@Gamebuster19901 Gamebuster19901 marked this pull request as ready for review December 31, 2020 06:16
@Gamebuster19901
Copy link
Contributor Author

Note: I had to update JUnit for Utiliti to get SwingTestSuite to work with it.

Copy link
Member

@nightm4re94 nightm4re94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for addressing the issue!

@nightm4re94 nightm4re94 merged commit a14506d into gurkenlabs:master Jan 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants