Skip to content
New issue

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

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

Already on GitHub? # to your account

test: Migrated existing tests to JUnit5 API - removed JUnit4 (2/2) #479

Merged
merged 12 commits into from
Feb 7, 2022

Conversation

Oliver-Loeffler
Copy link
Collaborator

@Oliver-Loeffler Oliver-Loeffler commented Jan 21, 2022

Contributes to effort to modernize test infrastructure.
All existing tests migrated to JUnit5 API.

This is the follow up to PR #478

Issue

Fixes #449

Progress

@Oliver-Loeffler Oliver-Loeffler changed the title Introduced JUnit Jupiter and JUnit vintage for testing (2/2) Migrated existing tests from JUnit4 to JUnit5 API (2/2) Jan 21, 2022
Copy link
Collaborator

@AlmasB AlmasB left a comment

Choose a reason for hiding this comment

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

Thanks for this, left some comments for discussion.

@Oliver-Loeffler Oliver-Loeffler changed the title Migrated existing tests from JUnit4 to JUnit5 API (2/2) Migrated existing tests to JUnit5 API - removed JUnit4 (2/2) Jan 22, 2022
@AlmasB AlmasB changed the title Migrated existing tests to JUnit5 API - removed JUnit4 (2/2) test: Migrated existing tests to JUnit5 API - removed JUnit4 (2/2) Feb 3, 2022
Copy link
Collaborator

@AlmasB AlmasB left a comment

Choose a reason for hiding this comment

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

Looks good. I assume all tests (after this PR) are JUnit 5 only?

Also please check the comments.


String generatedFxml = classUnderTest.getFxmlText(false);
assertTrue(generatedFxml.contains("useSystemMenuBar=\"true\""));
}

@Test
public void that_useSystemMenuBarProperty_not_modified_on_Linux_and_Windows() throws Exception {
assumeTrue("Windows or Linux", Set.of(OS.LINUX, OS.WINDOWS).contains(OS.get()));
assumeTrue(Set.of(OS.LINUX, OS.WINDOWS).contains(OS.get()), "Windows or Linux");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Perhaps adding disabled on os or enabled on os would be clearer?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, very good idea. Much better than this.


String generatedFxml = classUnderTest.getFxmlText(false);
assertTrue(generatedFxml.contains("useSystemMenuBar=\"true\""));
}

@Test
public void that_useSystemMenuBarProperty_is_disabled_on_MacOS() throws Exception {
assumeTrue("MacOS", OS.get() == OS.MAC);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Perhaps adding disabled on os or enabled on os would be clearer?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agree.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

JUnit4 will no longer work.

@AlmasB AlmasB merged commit 9faf4d7 into gluonhq:master Feb 7, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate from JUnit 4 to most recent JUnit 5.8+
2 participants