Enum Class ExtensionContext.StoreScope

java.lang.Object
java.lang.Enum<ExtensionContext.StoreScope>
org.junit.jupiter.api.extension.ExtensionContext.StoreScope
All Implemented Interfaces:
Serializable, Comparable<ExtensionContext.StoreScope>, Constable
Enclosing interface:
ExtensionContext

@API(status=EXPERIMENTAL, since="5.13") public static enum ExtensionContext.StoreScope extends Enum<ExtensionContext.StoreScope>
StoreScope is an enumeration of the different scopes for ExtensionContext.Store instances.
Since:
5.13
See Also:
  • Enum Constant Details

    • LAUNCHER_SESSION

      public static final ExtensionContext.StoreScope LAUNCHER_SESSION
      The store is scoped to the current LauncherSession.

      Any data that is stored in a Store with this scope will be available throughout the entire launcher session. Therefore, it may be used to inject values from registered LauncherSessionListener implementations, to share data across multiple executions of the Jupiter engine within the same session, or even to share data across multiple engines.

      See Also:
    • EXECUTION_REQUEST

      public static final ExtensionContext.StoreScope EXECUTION_REQUEST
      The store is scoped to the current ExecutionRequest of the JUnit Platform Launcher.

      Any data that is stored in a Store with this scope will be available for the duration of the current execution request. Therefore, it may be used to share data across multiple engines.

      See Also:
    • EXTENSION_CONTEXT

      public static final ExtensionContext.StoreScope EXTENSION_CONTEXT
      The store is scoped to the current ExtensionContext.

      Any data that is stored in a Store with this scope will be bound to the current extension context lifecycle.

  • Method Details

    • values

      public static ExtensionContext.StoreScope[] 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 ExtensionContext.StoreScope 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