Package org.junit.jupiter.api.extension
Enum ExtensionContext.StoreScope
- java.lang.Object
-
- java.lang.Enum<ExtensionContext.StoreScope>
-
- org.junit.jupiter.api.extension.ExtensionContext.StoreScope
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<ExtensionContext.StoreScope>
- Enclosing interface:
- ExtensionContext
@API(status=MAINTAINED, since="5.13.3") public static enum ExtensionContext.StoreScope extends java.lang.Enum<ExtensionContext.StoreScope>StoreScopeis an enumeration of the different scopes forExtensionContext.Storeinstances.- Since:
- 5.13
- See Also:
ExtensionContext.getStore(StoreScope, Namespace)
-
-
Enum Constant Summary
Enum Constants Enum Constant Description EXECUTION_REQUESTThe store is scoped to the currentExecutionRequestof the JUnit PlatformLauncher.EXTENSION_CONTEXTThe store is scoped to the currentExtensionContext.LAUNCHER_SESSIONThe store is scoped to the currentLauncherSession.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ExtensionContext.StoreScopevalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static ExtensionContext.StoreScope[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
LAUNCHER_SESSION
public static final ExtensionContext.StoreScope LAUNCHER_SESSION
The store is scoped to the currentLauncherSession.Any data that is stored in a
Storewith this scope will be available throughout the entire launcher session. Therefore, it may be used to inject values from registeredLauncherSessionListenerimplementations, to share data across multiple executions of the Jupiter engine within the same session, or even to share data across multiple engines.- See Also:
org.junit.platform.launcher.LauncherSession#getStore(),org.junit.platform.launcher.LauncherSessionListener
-
EXECUTION_REQUEST
public static final ExtensionContext.StoreScope EXECUTION_REQUEST
The store is scoped to the currentExecutionRequestof the JUnit PlatformLauncher.Any data that is stored in a
Storewith 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:
org.junit.platform.engine.ExecutionRequest#getStore()
-
EXTENSION_CONTEXT
public static final ExtensionContext.StoreScope EXTENSION_CONTEXT
The store is scoped to the currentExtensionContext.Any data that is stored in a
Storewith this scope will be bound to the current extension context lifecycle.
-
-
Method Detail
-
values
public static ExtensionContext.StoreScope[] 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 (ExtensionContext.StoreScope c : ExtensionContext.StoreScope.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ExtensionContext.StoreScope 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
-
-