-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Introduce a TemporaryFolder extension #1247
Comments
The internal extension can be found at https://github.com/junit-team/junit5/blob/master/platform-tests/src/test/java/org/junit/jupiter/extensions/TempDirectory.java |
It would really been nice to have this feature available in the next release as it is still a deal-breaker in the complete migration to junit Jupiter. |
This will be done in the half-official extensions project: junit-pioneer/junit-pioneer#39. |
Still waiting on the first junit-pioneer release... :( |
Only some more minutes... |
There it is! Thank you! 🙏 |
Having
1 and 2 are only annoying when figuring out what JUnit 5's equivalent of Could the decision to move a core, and very useful, piece of JUnit 4 into a half-official extensions project please be reconsidered? |
While such features are in experimental mode, having a dedicated dependency which only contains the extension would be helpful. This can then just be included additionally to the official Junit5 dependency. |
Hi @wilkinsona, I'll bring it up with the team for renewed discussion. |
Currently, JUnit 5.1.0 is used to write JUnit 5 styled tests. JUnit 5.1.0 does not support creating Temporary Folders natively, and relies on having to create a custom TemporaryFolder extension or relying on JUnit-Pioneer library [1]. Both of these solutions make it complicated to implement and understand. JUnit 5.4.0 is the first version of JUnit that supports native TemporaryFolder extension [2]. Hence, let's use JUnit 5.4.0 instead to reduce the complexity of implementing TemporaryFolder. [1] https://medium.com/@GalletVictor/migration-from-junit-4-to-junit-5-d8fe38644abe [2] junit-team/junit5#1247
Currently, JUnit 5.1.0 is used to write JUnit 5 styled tests. JUnit 5.1.0 does not support creating Temporary Folders natively, and relies on having to create a custom TemporaryFolder extension or relying on JUnit-Pioneer library [1]. Both of these solutions make it complicated to implement and understand. JUnit 5.4.0 is the first version of JUnit that supports native TemporaryFolder extension [2]. Hence, let's use JUnit 5.4.0 instead to reduce the complexity of implementing TemporaryFolder. [1] https://medium.com/@GalletVictor/migration-from-junit-4-to-junit-5-d8fe38644abe [2] junit-team/junit5#1247
Currently, JUnit 5.1.0 is used to write JUnit 5 styled tests. JUnit 5.1.0 does not support creating Temporary Folders natively, and relies on having to create a custom TemporaryFolder extension or relying on JUnit-Pioneer library [1]. Both of these solutions make it complicated to implement and understand. JUnit 5.4.0 is the first version of JUnit that supports native TemporaryFolder extension [2]. Hence, let's use JUnit 5.4.0 instead to reduce the complexity of implementing TemporaryFolder. [1] https://medium.com/@GalletVictor/migration-from-junit-4-to-junit-5-d8fe38644abe [2] junit-team/junit5#1247
Currently, JUnit 5.1.0 is used to write JUnit 5 styled tests. JUnit 5.1.0 does not support creating Temporary Folders natively, and relies on having to create a custom TemporaryFolder extension or relying on JUnit-Pioneer library [1]. Both of these solutions make it complicated to implement and understand. JUnit 5.4.0 is the first version of JUnit that supports native TemporaryFolder extension [2]. Hence, let's use JUnit 5.4.0 instead to reduce the complexity of implementing TemporaryFolder. [1] https://medium.com/@GalletVictor/migration-from-junit-4-to-junit-5-d8fe38644abe [2] junit-team/junit5#1247
Currently, JUnit 5.1.0 is used to write JUnit 5 styled tests. JUnit 5.1.0 does not support creating Temporary Folders natively, and relies on having to create a custom TemporaryFolder extension or relying on JUnit-Pioneer library [1]. Both of these solutions make it complicated to implement and understand. JUnit 5.4.0 is the first version of JUnit that supports native TemporaryFolder extension [2]. Hence, let's use JUnit 5.4.0 instead to reduce the complexity of implementing TemporaryFolder. [1] https://medium.com/@GalletVictor/migration-from-junit-4-to-junit-5-d8fe38644abe [2] junit-team/junit5#1247
Currently, JUnit 5.1.0 is used to write JUnit 5 styled tests. JUnit 5.1.0 does not support creating Temporary Folders natively, and relies on having to create a custom TemporaryFolder extension or relying on JUnit-Pioneer library [1]. Both of these solutions make it complicated to implement and understand. JUnit 5.4.0 is the first version of JUnit that supports native TemporaryFolder extension [2]. Hence, let's use JUnit 5.4.0 instead to reduce the complexity of implementing TemporaryFolder. [1] https://medium.com/@GalletVictor/migration-from-junit-4-to-junit-5-d8fe38644abe [2] junit-team/junit5#1247
Currently, JUnit 5.1.0 is used to write JUnit 5 styled tests. JUnit 5.1.0 does not support creating Temporary Folders natively, and relies on having to create a custom TemporaryFolder extension or relying on JUnit-Pioneer library [1]. Both of these solutions make it complicated to implement and understand. JUnit 5.4.0 is the first version of JUnit that supports native TemporaryFolder extension [2]. Hence, let's use JUnit 5.4.0 instead to reduce the complexity of implementing TemporaryFolder. [1] https://medium.com/@GalletVictor/migration-from-junit-4-to-junit-5-d8fe38644abe [2] junit-team/junit5#1247
We write our tests using the JUnit 5.1.0 API. The JUnit 5.1.0 API contains most features we require, such as assertTrue or assertThrows. We have unit tests such as StorageManagerTest#prefsReadSave that require writing to the filesystem. These tests need to make use of temporary directories. This is so that (1) we can begin with a clean, known state at the start of each test and (2) we can prevent our test output from polluting the user's file system. However, JUnit 5.1.0 does not support creating temporary directories natively, so developers need to create a custom TemporaryDirectory implementation or rely on JUnit-Pioneer library [1]. Both of these solutions make it complicated to implement and for future developers to understand. JUnit 5.4.0 is the first version of JUnit that has a native temporary directory API [2]. By upgrading to JUnit 5.4.0, we can directly use the org.junit.jupiter.api.io.TempDir API. This reduces the complexity of implementing a temporary directory. Let's upgrade to use JUnit 5.4.0. [1] https://medium.com/@GalletVictor/migration-from-junit-4-to-junit-5-d8fe38644abe [2] junit-team/junit5#1247
We write our tests using the JUnit 5.1.0 API. The JUnit 5.1.0 API contains most features we require, such as assertTrue or assertThrows. We have unit tests such as StorageManagerTest#prefsReadSave that require writing to the filesystem. These tests need to make use of temporary directories. This is so that (1) we can begin with a clean, known state at the start of each test and (2) we can prevent our test output from polluting the user's file system. However, JUnit 5.1.0 does not support creating temporary directories natively, so developers need to create a custom TemporaryDirectory implementation or rely on JUnit-Pioneer library [1]. Both of these solutions make it complicated to implement and for future developers to understand. JUnit 5.4.0 is the first version of JUnit that has a native temporary directory API [2]. By upgrading to JUnit 5.4.0, we can directly use the org.junit.jupiter.api.io.TempDir API. This reduces the complexity of implementing a temporary directory. Let's upgrade to use JUnit 5.4.0. [1] https://medium.com/@GalletVictor/migration-from-junit-4-to-junit-5-d8fe38644abe [2] junit-team/junit5#1247
We write our tests using the JUnit 5.1.0 API. The JUnit 5.1.0 API contains most features we require, such as assertTrue or assertThrows. We have unit tests such as StorageManagerTest#prefsReadSave that require writing to the filesystem. These tests need to make use of temporary directories. This is so that (1) we can begin with a clean, known state at the start of each test and (2) we can prevent our test output from polluting the user's file system. However, JUnit 5.1.0 does not support creating temporary directories natively, so developers need to create a custom TemporaryDirectory implementation or rely on JUnit-Pioneer library [1]. Both of these solutions make it complicated to implement and for future developers to understand. JUnit 5.4.0 is the first version of JUnit that has a native temporary directory API [2]. By upgrading to JUnit 5.4.0, we can directly use the org.junit.jupiter.api.io.TempDir API. This reduces the complexity of implementing a temporary directory. Let's upgrade to use JUnit 5.4.0. [1] https://medium.com/@GalletVictor/migration-from-junit-4-to-junit-5-d8fe38644abe [2] junit-team/junit5#1247
We write our tests using the JUnit 5.1.0 API. The JUnit 5.1.0 API contains most features we require, such as assertTrue or assertThrows. We have unit tests such as StorageManagerTest#prefsReadSave that require writing to the filesystem. These tests need to make use of temporary directories. This is so that (1) we can begin with a clean, known state at the start of each test and (2) we can prevent our test output from polluting the user's file system. However, JUnit 5.1.0 does not support creating temporary directories natively, so developers need to create a custom TemporaryDirectory implementation or rely on JUnit-Pioneer library [1]. Both of these solutions make it complicated to implement and for future developers to understand. JUnit 5.4.0 is the first version of JUnit that has a native temporary directory API [2]. By upgrading to JUnit 5.4.0, we can directly use the org.junit.jupiter.api.io.TempDir API. This reduces the complexity of implementing a temporary directory. Let's upgrade to use JUnit 5.4.0. [1] https://medium.com/@GalletVictor/migration-from-junit-4-to-junit-5-d8fe38644abe [2] junit-team/junit5#1247
We write our tests using the JUnit 5.1.0 API. The JUnit 5.1.0 API contains most features we require, such as assertTrue or assertThrows. We have unit tests such as StorageManagerTest#prefsReadSave that require writing to the filesystem. These tests need to make use of temporary directories. This is so that (1) we can begin with a clean, known state at the start of each test and (2) we can prevent our test output from polluting the user's file system. However, JUnit 5.1.0 does not support creating temporary directories natively, so developers need to create a custom TemporaryDirectory implementation or rely on JUnit-Pioneer library [1]. Both of these solutions make it complicated to implement and for future developers to understand. JUnit 5.4.0 is the first version of JUnit that has a native temporary directory API [2]. By upgrading to JUnit 5.4.0, we can directly use the org.junit.jupiter.api.io.TempDir API. This reduces the complexity of implementing a temporary directory. Let's upgrade to use JUnit 5.4.0. [1] https://medium.com/@GalletVictor/migration-from-junit-4-to-junit-5-d8fe38644abe [2] junit-team/junit5#1247
We write our tests using the JUnit 5.1.0 API. The JUnit 5.1.0 API contains most features we require, such as assertTrue or assertThrows. We have unit tests such as StorageManagerTest#prefsReadSave that require writing to the filesystem. These tests need to make use of temporary directories. This is so that (1) we can begin with a clean, known state at the start of each test and (2) we can prevent our test output from polluting the user's file system. However, JUnit 5.1.0 does not support creating temporary directories natively, so developers need to create a custom TemporaryDirectory implementation or rely on JUnit-Pioneer library [1]. Both of these solutions make it complicated to implement and for future developers to understand. JUnit 5.4.0 is the first version of JUnit that has a native temporary directory API [2]. By upgrading to JUnit 5.4.0, we can directly use the org.junit.jupiter.api.io.TempDir API. This reduces the complexity of implementing a temporary directory. Let's upgrade to use JUnit 5.4.0. [1] https://medium.com/@GalletVictor/migration-from-junit-4-to-junit-5-d8fe38644abe [2] junit-team/junit5#1247
We write our tests using the JUnit 5.1.0 API. The JUnit 5.1.0 API contains most features we require, such as assertTrue or assertThrows. We have unit tests such as StorageManagerTest#prefsReadSave that require writing to the filesystem. These tests need to make use of temporary directories. This is so that (1) we can begin with a clean, known state at the start of each test and (2) we can prevent our test output from polluting the user's file system. However, JUnit 5.1.0 does not support creating temporary directories natively, so developers need to create a custom TemporaryDirectory implementation or rely on JUnit-Pioneer library [1]. Both of these solutions make it complicated to implement and for future developers to understand. JUnit 5.4.0 is the first version of JUnit that has a native temporary directory API [2]. By upgrading to JUnit 5.4.0, we can directly use the org.junit.jupiter.api.io.TempDir API. This reduces the complexity of implementing a temporary directory. Let's upgrade to use JUnit 5.4.0. [1] https://medium.com/@GalletVictor/migration-from-junit-4-to-junit-5-d8fe38644abe [2] junit-team/junit5#1247
We write our tests using the JUnit 5.1.0 API. The JUnit 5.1.0 API contains most features we require, such as assertTrue or assertThrows. We have unit tests such as StorageManagerTest#prefsReadSave that require writing to the filesystem. These tests need to make use of temporary directories. This is so that (1) we can begin with a clean, known state at the start of each test and (2) we can prevent our test output from polluting the user's file system. However, JUnit 5.1.0 does not support creating temporary directories natively, so developers need to create a custom TemporaryDirectory implementation or rely on JUnit-Pioneer library [1]. Both of these solutions make it complicated to implement and for future developers to understand. JUnit 5.4.0 is the first version of JUnit that has a native temporary directory API [2]. By upgrading to JUnit 5.4.0, we can directly use the org.junit.jupiter.api.io.TempDir API. This reduces the complexity of implementing a temporary directory. Let's upgrade to use JUnit 5.4.0. [1] https://medium.com/@GalletVictor/migration-from-junit-4-to-junit-5-d8fe38644abe [2] junit-team/junit5#1247
We write our tests using the JUnit 5.1.0 API. The JUnit 5.1.0 API contains most features we require, such as assertTrue or assertThrows. We have unit tests such as StorageManagerTest#prefsReadSave that require writing to the filesystem. These tests need to make use of temporary directories. This is so that (1) we can begin with a clean, known state at the start of each test and (2) we can prevent our test output from polluting the user's file system. However, JUnit 5.1.0 does not support creating temporary directories natively, so developers need to create a custom TemporaryDirectory implementation or rely on JUnit-Pioneer library [1]. Both of these solutions make it complicated to implement and for future developers to understand. JUnit 5.4.0 is the first version of JUnit that has a native temporary directory API [2]. By upgrading to JUnit 5.4.0, we can directly use the org.junit.jupiter.api.io.TempDir API. This reduces the complexity of implementing a temporary directory. Let's upgrade to use JUnit 5.4.0. [1] https://medium.com/@GalletVictor/migration-from-junit-4-to-junit-5-d8fe38644abe [2] junit-team/junit5#1247
We write our tests using the JUnit 5.1.0 API. The JUnit 5.1.0 API contains most features we require, such as assertTrue or assertThrows. We have unit tests such as StorageManagerTest#prefsReadSave that require writing to the filesystem. These tests need to make use of temporary directories. This is so that (1) we can begin with a clean, known state at the start of each test and (2) we can prevent our test output from polluting the user's file system. However, JUnit 5.1.0 does not support creating temporary directories natively, so developers need to create a custom TemporaryDirectory implementation or rely on JUnit-Pioneer library [1]. Both of these solutions make it complicated to implement and for future developers to understand. JUnit 5.4.0 is the first version of JUnit that has a native temporary directory API [2]. By upgrading to JUnit 5.4.0, we can directly use the org.junit.jupiter.api.io.TempDir API. This reduces the complexity of implementing a temporary directory. Let's upgrade to use JUnit 5.4.0. [1] https://medium.com/@GalletVictor/migration-from-junit-4-to-junit-5-d8fe38644abe [2] junit-team/junit5#1247
We write our tests using the JUnit 5.1.0 API. The JUnit 5.1.0 API contains most features we require, such as assertTrue or assertThrows. We have unit tests such as StorageManagerTest#prefsReadSave that require writing to the filesystem. These tests need to make use of temporary directories. This is so that (1) we can begin with a clean, known state at the start of each test and (2) we can prevent our test output from polluting the user's file system. However, JUnit 5.1.0 does not support creating temporary directories natively, so developers need to create a custom TemporaryDirectory implementation or rely on JUnit-Pioneer library [1]. Both of these solutions make it complicated to implement and for future developers to understand. JUnit 5.4.0 is the first version of JUnit that has a native temporary directory API [2]. By upgrading to JUnit 5.4.0, we can directly use the org.junit.jupiter.api.io.TempDir API. This reduces the complexity of implementing a temporary directory. Let's upgrade to use JUnit 5.4.0. [1] https://medium.com/@GalletVictor/migration-from-junit-4-to-junit-5-d8fe38644abe [2] junit-team/junit5#1247
We write our tests using the JUnit 5.1.0 API. The JUnit 5.1.0 API contains most features we require, such as assertTrue or assertThrows. We have unit tests such as StorageManagerTest#prefsReadSave that require writing to the filesystem. These tests need to make use of temporary directories. This is so that (1) we can begin with a clean, known state at the start of each test and (2) we can prevent our test output from polluting the user's file system. However, JUnit 5.1.0 does not support creating temporary directories natively, so developers need to create a custom TemporaryDirectory implementation or rely on JUnit-Pioneer library [1]. Both of these solutions make it complicated to implement and for future developers to understand. JUnit 5.4.0 is the first version of JUnit that has a native temporary directory API [2]. By upgrading to JUnit 5.4.0, we can directly use the org.junit.jupiter.api.io.TempDir API. This reduces the complexity of implementing a temporary directory. Let's upgrade to use JUnit 5.4.0. [1] https://medium.com/@GalletVictor/migration-from-junit-4-to-junit-5-d8fe38644abe [2] junit-team/junit5#1247
We write our tests using the JUnit 5.1.0 API. The JUnit 5.1.0 API contains most features we require, such as assertTrue or assertThrows. We have unit tests such as StorageManagerTest#prefsReadSave that require writing to the filesystem. These tests need to make use of temporary directories. This is so that (1) we can begin with a clean, known state at the start of each test and (2) we can prevent our test output from polluting the user's file system. However, JUnit 5.1.0 does not support creating temporary directories natively, so developers need to create a custom TemporaryDirectory implementation or rely on JUnit-Pioneer library [1]. Both of these solutions make it complicated to implement and for future developers to understand. JUnit 5.4.0 is the first version of JUnit that has a native temporary directory API [2]. By upgrading to JUnit 5.4.0, we can directly use the org.junit.jupiter.api.io.TempDir API. This reduces the complexity of implementing a temporary directory. Let's upgrade to use JUnit 5.4.0. [1] https://medium.com/@GalletVictor/migration-from-junit-4-to-junit-5-d8fe38644abe [2] junit-team/junit5#1247
We write our tests using the JUnit 5.1.0 API. The JUnit 5.1.0 API contains most features we require, such as assertTrue or assertThrows. We have unit tests such as StorageManagerTest#prefsReadSave that require writing to the filesystem. These tests need to make use of temporary directories. This is so that (1) we can begin with a clean, known state at the start of each test and (2) we can prevent our test output from polluting the user's file system. However, JUnit 5.1.0 does not support creating temporary directories natively, so developers need to create a custom TemporaryDirectory implementation or rely on JUnit-Pioneer library [1]. Both of these solutions make it complicated to implement and for future developers to understand. JUnit 5.4.0 is the first version of JUnit that has a native temporary directory API [2]. By upgrading to JUnit 5.4.0, we can directly use the org.junit.jupiter.api.io.TempDir API. This reduces the complexity of implementing a temporary directory. Let's upgrade to use JUnit 5.4.0. [1] https://medium.com/@GalletVictor/migration-from-junit-4-to-junit-5-d8fe38644abe [2] junit-team/junit5#1247
We write our tests using the JUnit 5.1.0 API. The JUnit 5.1.0 API contains most features we require, such as assertTrue or assertThrows. We have unit tests such as StorageManagerTest#prefsReadSave that require writing to the filesystem. These tests need to make use of temporary directories. This is so that (1) we can begin with a clean, known state at the start of each test and (2) we can prevent our test output from polluting the user's file system. However, JUnit 5.1.0 does not support creating temporary directories natively, so developers need to create a custom TemporaryDirectory implementation or rely on JUnit-Pioneer library [1]. Both of these solutions make it complicated to implement and for future developers to understand. JUnit 5.4.0 is the first version of JUnit that has a native temporary directory API [2]. By upgrading to JUnit 5.4.0, we can directly use the org.junit.jupiter.api.io.TempDir API. This reduces the complexity of implementing a temporary directory. Let's upgrade to use JUnit 5.4.0. [1] https://medium.com/@GalletVictor/migration-from-junit-4-to-junit-5-d8fe38644abe [2] junit-team/junit5#1247
We write our tests using the JUnit 5.1.0 API. The JUnit 5.1.0 API contains most features we require, such as assertTrue or assertThrows. We have unit tests such as StorageManagerTest#prefsReadSave that require writing to the filesystem. These tests need to make use of temporary directories. This is so that (1) we can begin with a clean, known state at the start of each test and (2) we can prevent our test output from polluting the user's file system. However, JUnit 5.1.0 does not support creating temporary directories natively, so developers need to create a custom TemporaryDirectory implementation or rely on JUnit-Pioneer library [1]. Both of these solutions make it complicated to implement and for future developers to understand. JUnit 5.4.0 is the first version of JUnit that has a native temporary directory API [2]. By upgrading to JUnit 5.4.0, we can directly use the org.junit.jupiter.api.io.TempDir API. This reduces the complexity of implementing a temporary directory. Let's upgrade to use JUnit 5.4.0. [1] https://medium.com/@GalletVictor/migration-from-junit-4-to-junit-5-d8fe38644abe [2] junit-team/junit5#1247
We write our tests using the JUnit 5.1.0 API. The JUnit 5.1.0 API contains most features we require, such as assertTrue or assertThrows. We have unit tests such as StorageManagerTest#prefsReadSave that require writing to the filesystem. These tests need to make use of temporary directories. This is so that (1) we can begin with a clean, known state at the start of each test and (2) we can prevent our test output from polluting the user's file system. However, JUnit 5.1.0 does not support creating temporary directories natively, so developers need to create a custom TemporaryDirectory implementation or rely on JUnit-Pioneer library [1]. Both of these solutions make it complicated to implement and for future developers to understand. JUnit 5.4.0 is the first version of JUnit that has a native temporary directory API [2]. By upgrading to JUnit 5.4.0, we can directly use the org.junit.jupiter.api.io.TempDir API. This reduces the complexity of implementing a temporary directory. Let's upgrade to use JUnit 5.4.0. [1] https://medium.com/@GalletVictor/migration-from-junit-4-to-junit-5-d8fe38644abe [2] junit-team/junit5#1247
We write our tests using the JUnit 5.1.0 API. The JUnit 5.1.0 API contains most features we require, such as assertTrue or assertThrows. We have unit tests such as StorageManagerTest#prefsReadSave that require writing to the filesystem. These tests need to make use of temporary directories. This is so that (1) we can begin with a clean, known state at the start of each test and (2) we can prevent our test output from polluting the user's file system. However, JUnit 5.1.0 does not support creating temporary directories natively, so developers need to create a custom TemporaryDirectory implementation or rely on JUnit-Pioneer library [1]. Both of these solutions make it complicated to implement and for future developers to understand. JUnit 5.4.0 is the first version of JUnit that has a native temporary directory API [2]. By upgrading to JUnit 5.4.0, we can directly use the org.junit.jupiter.api.io.TempDir API. This reduces the complexity of implementing a temporary directory. Let's upgrade to use JUnit 5.4.0. [1] https://medium.com/@GalletVictor/migration-from-junit-4-to-junit-5-d8fe38644abe [2] junit-team/junit5#1247
We write our tests using the JUnit 5.1.0 API. The JUnit 5.1.0 API contains most features we require, such as assertTrue or assertThrows. We have unit tests such as StorageManagerTest#prefsReadSave that require writing to the filesystem. These tests need to make use of temporary directories. This is so that (1) we can begin with a clean, known state at the start of each test and (2) we can prevent our test output from polluting the user's file system. However, JUnit 5.1.0 does not support creating temporary directories natively, so developers need to create a custom TemporaryDirectory implementation or rely on JUnit-Pioneer library [1]. Both of these solutions make it complicated to implement and for future developers to understand. JUnit 5.4.0 is the first version of JUnit that has a native temporary directory API [2]. By upgrading to JUnit 5.4.0, we can directly use the org.junit.jupiter.api.io.TempDir API. This reduces the complexity of implementing a temporary directory. Let's upgrade to use JUnit 5.4.0. [1] https://medium.com/@GalletVictor/migration-from-junit-4-to-junit-5-d8fe38644abe [2] junit-team/junit5#1247
We write our tests using the JUnit 5.1.0 API. The JUnit 5.1.0 API contains most features we require, such as assertTrue or assertThrows. We have unit tests such as StorageManagerTest#prefsReadSave that require writing to the filesystem. These tests need to make use of temporary directories. This is so that (1) we can begin with a clean, known state at the start of each test and (2) we can prevent our test output from polluting the user's file system. However, JUnit 5.1.0 does not support creating temporary directories natively, so developers need to create a custom TemporaryDirectory implementation or rely on JUnit-Pioneer library [1]. Both of these solutions make it complicated to implement and for future developers to understand. JUnit 5.4.0 is the first version of JUnit that has a native temporary directory API [2]. By upgrading to JUnit 5.4.0, we can directly use the org.junit.jupiter.api.io.TempDir API. This reduces the complexity of implementing a temporary directory. Let's upgrade to use JUnit 5.4.0. [1] https://medium.com/@GalletVictor/migration-from-junit-4-to-junit-5-d8fe38644abe [2] junit-team/junit5#1247
We write our tests using the JUnit 5.1.0 API. The JUnit 5.1.0 API contains most features we require, such as assertTrue or assertThrows. We have unit tests such as StorageManagerTest#prefsReadSave that require writing to the filesystem. These tests need to make use of temporary directories. This is so that (1) we can begin with a clean, known state at the start of each test and (2) we can prevent our test output from polluting the user's file system. However, JUnit 5.1.0 does not support creating temporary directories natively, so developers need to create a custom TemporaryDirectory implementation or rely on JUnit-Pioneer library [1]. Both of these solutions make it complicated to implement and for future developers to understand. JUnit 5.4.0 is the first version of JUnit that has a native temporary directory API [2]. By upgrading to JUnit 5.4.0, we can directly use the org.junit.jupiter.api.io.TempDir API. This reduces the complexity of implementing a temporary directory. Let's upgrade to use JUnit 5.4.0. [1] https://medium.com/@GalletVictor/migration-from-junit-4-to-junit-5-d8fe38644abe [2] junit-team/junit5#1247
We write our tests using the JUnit 5.1.0 API. The JUnit 5.1.0 API contains most features we require, such as assertTrue or assertThrows. We have unit tests such as StorageManagerTest#prefsReadSave that require writing to the filesystem. These tests need to make use of temporary directories. This is so that (1) we can begin with a clean, known state at the start of each test and (2) we can prevent our test output from polluting the user's file system. However, JUnit 5.1.0 does not support creating temporary directories natively, so developers need to create a custom TemporaryDirectory implementation or rely on JUnit-Pioneer library [1]. Both of these solutions make it complicated to implement and for future developers to understand. JUnit 5.4.0 is the first version of JUnit that has a native temporary directory API [2]. By upgrading to JUnit 5.4.0, we can directly use the org.junit.jupiter.api.io.TempDir API. This reduces the complexity of implementing a temporary directory. Let's upgrade to use JUnit 5.4.0. [1] https://medium.com/@GalletVictor/migration-from-junit-4-to-junit-5-d8fe38644abe [2] junit-team/junit5#1247
Overview
See discussion at junit-team/junit5-samples#4.
Related Issues
Deliverables
Introduce an officialTemporaryFolder
extension for JUnit Jupiter analogous to the rule support in JUnit 4.The text was updated successfully, but these errors were encountered: