Skip to content

Commit 37df841

Browse files
committed
Update TempDir Javadoc
1 parent 38744ab commit 37df841

File tree

1 file changed

+14
-5
lines changed
  • junit-jupiter-api/src/main/java/org/junit/jupiter/api/io

1 file changed

+14
-5
lines changed

junit-jupiter-api/src/main/java/org/junit/jupiter/api/io/TempDir.java

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,20 @@
4040
*
4141
* <p>The temporary directory is only created if a field in a test class or a
4242
* parameter in a lifecycle method or test method is annotated with
43-
* {@code @TempDir}. If the field type or parameter type is neither {@link Path}
44-
* nor {@link File}, if a field is declared as {@code final}, or if the temporary
45-
* directory cannot be created, an {@link ExtensionConfigurationException} or a
46-
* {@link ParameterResolutionException} will be thrown as appropriate. In
47-
* addition, a {@code ParameterResolutionException} will be thrown for a
43+
* {@code @TempDir}.
44+
* An {@link ExtensionConfigurationException} or a {@link ParameterResolutionException}
45+
* will be thrown in one of the following cases:
46+
*
47+
* <ul>
48+
* <li>If the field type or parameter type is neither {@link Path} nor {@link File}.</li>
49+
* <li>If a field is declared as {@code final}.</li>
50+
* <li>If the temporary directory cannot be created.</li>
51+
* <li>If the field type or parameter type is {@code File} and a custom
52+
* {@link TempDir#factory() factory} is used, which creates a temporary directory that does
53+
* not belong to the {@link java.nio.file.FileSystems#getDefault() default file system}.</li>
54+
* </ul>
55+
*
56+
* In addition, a {@code ParameterResolutionException} will be thrown for a
4857
* constructor parameter annotated with {@code @TempDir}.
4958
*
5059
* <h2>Scope</h2>

0 commit comments

Comments
 (0)