Module org.junit.jupiter.api
Package org.junit.jupiter.api.extension
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:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe store is scoped to the currentExecutionRequest
of the JUnit PlatformLauncher
.The store is scoped to the currentExtensionContext
.The store is scoped to the currentLauncherSession
. -
Method Summary
Modifier and TypeMethodDescriptionstatic ExtensionContext.StoreScope
Returns the enum constant of this class with the specified name.static ExtensionContext.StoreScope[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
LAUNCHER_SESSION
The store is scoped to the currentLauncherSession
.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 registeredLauncherSessionListener
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
The store is scoped to the currentExecutionRequest
of the JUnit PlatformLauncher
.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
The store is scoped to the currentExtensionContext
.Any data that is stored in a
Store
with this scope will be bound to the current extension context lifecycle.
-
-
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
-