Enum CustomClassLoaderCloseStrategy
- java.lang.Object
-
- java.lang.Enum<CustomClassLoaderCloseStrategy>
-
- org.junit.platform.console.command.CustomClassLoaderCloseStrategy
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<CustomClassLoaderCloseStrategy>
@API(status=INTERNAL, since="1.13") public enum CustomClassLoaderCloseStrategy extends java.lang.Enum<CustomClassLoaderCloseStrategy>Defines the strategy for closing custom class loaders created for test discovery and execution.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CLOSE_AFTER_CALLING_LAUNCHERClose the custom class loader after calling theLauncherfor test discovery or execution.KEEP_OPENRely on the JVM to release resources held by the custom class loader when it terminates.
-
Constructor Summary
Constructors Modifier Constructor Description privateCustomClassLoaderCloseStrategy()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidhandle(java.lang.ClassLoader classLoader)Handle the class loader according to the strategy.static CustomClassLoaderCloseStrategyvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static CustomClassLoaderCloseStrategy[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
CLOSE_AFTER_CALLING_LAUNCHER
public static final CustomClassLoaderCloseStrategy CLOSE_AFTER_CALLING_LAUNCHER
Close the custom class loader after calling theLauncherfor test discovery or execution.
-
KEEP_OPEN
public static final CustomClassLoaderCloseStrategy KEEP_OPEN
Rely on the JVM to release resources held by the custom class loader when it terminates.This mode is only safe to use when calling
System.exit(int)afterward.
-
-
Method Detail
-
values
public static CustomClassLoaderCloseStrategy[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (CustomClassLoaderCloseStrategy c : CustomClassLoaderCloseStrategy.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static CustomClassLoaderCloseStrategy valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
handle
public abstract void handle(java.lang.ClassLoader classLoader)
Handle the class loader according to the strategy.
-
-