This repository has been archived by the owner on Mar 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TemporaryFolder: Migrate to JUnit 5 TempDir API
We use JUnit 4's TemporaryFolder rule to initialise a temporary folder. Rules are no longer supported by JUnit 5 test runners. In addition, JUnit 5.4.0 introduces the TempDir extension that supersedes the TemporaryFolder rule. Let's migrate our usage of TemporaryFolder rules to TempDir. As TempDirs in JUnit 5 are Paths, it is no longer necessary to invoke methods like getRoot().toPath() on the TempDir. Additionally, the way to get a URL resource from the TempDir is also different from TemporaryFolder. The relevant methods have been updated. In LogicManagerTest and MainWindowCloseTest, the newFile() API is not supported by JUnit 5's TempDir. However, as the random file name provided by newFile() is not necessary (we have full control over the contents of the temporary directory), instead of re-implementing newFile() to match the behavior of existing tests, we explicitly give the file names and use Path.resolve() instead.
- Loading branch information
Showing
7 changed files
with
52 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters