- All Implemented Interfaces:
Serializable
,Comparable<CleanupMode>
,java.lang.constant.Constable
Enumeration of cleanup modes for
@TempDir
.
When a test with a temporary directory completes, it might be useful in
some cases to be able to view the contents of the temporary directory used by
the test. CleanupMode
allows you to control how a TempDir
is cleaned up.
- Since:
- 5.9
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionAlways clean up a temporary directory after the test has completed.Use the default cleanup mode.Never clean up a temporary directory after the test has completed.Only clean up a temporary directory if the test completed successfully. -
Method Summary
Modifier and TypeMethodDescriptionstatic CleanupMode
Returns the enum constant of this class with the specified name.static CleanupMode[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DEFAULT
Use the default cleanup mode. -
ALWAYS
Always clean up a temporary directory after the test has completed. -
ON_SUCCESS
Only clean up a temporary directory if the test completed successfully. -
NEVER
Never clean up a temporary directory after the test has completed.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-