Enum Class CustomClassLoaderCloseStrategy

java.lang.Object
java.lang.Enum<CustomClassLoaderCloseStrategy>
org.junit.platform.console.tasks.CustomClassLoaderCloseStrategy
All Implemented Interfaces:
Serializable, Comparable<CustomClassLoaderCloseStrategy>, Constable

@API(status=INTERNAL, since="1.13") public enum CustomClassLoaderCloseStrategy extends Enum<CustomClassLoaderCloseStrategy>
Defines the strategy for closing custom class loaders created for test discovery and execution.
  • Enum Constant Details

    • CLOSE_AFTER_CALLING_LAUNCHER

      public static final CustomClassLoaderCloseStrategy CLOSE_AFTER_CALLING_LAUNCHER
      Close the custom class loader after calling the Launcher for 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 Details

    • values

      public static CustomClassLoaderCloseStrategy[] 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

      public static CustomClassLoaderCloseStrategy valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • handle

      public abstract void handle(ClassLoader classLoader)
      Handle the class loader according to the strategy.