File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
junit-jupiter-api/src/main/java/org/junit/jupiter/api/io Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 3434 * parameters. Please use field injection instead, by annotating an
3535 * instance field with {@code @TempDir}.
3636 *
37+ * <h3>Temporary Directory Creation</h3>
38+ *
3739 * <p>The temporary directory is only created if a field in a test class or a
3840 * parameter in a lifecycle method or test method is annotated with
3941 * {@link TempDir @TempDir}. If the field type or parameter type is neither
4345 * addition, a {@code ParameterResolutionException} will be thrown for a
4446 * constructor parameter annotated with {@code @TempDir}.
4547 *
48+ * <h3>Temporary Directory Scope</h3>
49+ *
4650 * <p>The scope of the temporary directory depends on where the first
4751 * {@code @TempDir} annotation is encountered when executing a test class. The
4852 * temporary directory will be shared by all tests in a class when the
5357 * or {@link org.junit.jupiter.api.AfterEach @AfterEach} methods — each test
5458 * will use its own temporary directory.
5559 *
60+ * <h3>Temporary Directory Deletion</h3>
61+ *
5662 * <p>When the end of the scope of a temporary directory is reached, i.e. when
5763 * the test method or class has finished execution, JUnit will attempt to
5864 * recursively delete all files and directories in the temporary directory
You can’t perform that action at this time.
0 commit comments