Package org.junit.jupiter.api.extension
Enum TestInstantiationAwareExtension.ExtensionContextScope
- java.lang.Object
-
- java.lang.Enum<TestInstantiationAwareExtension.ExtensionContextScope>
-
- org.junit.jupiter.api.extension.TestInstantiationAwareExtension.ExtensionContextScope
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<TestInstantiationAwareExtension.ExtensionContextScope>
- Enclosing interface:
- TestInstantiationAwareExtension
@API(status=MAINTAINED, since="5.13.3") public static enum TestInstantiationAwareExtension.ExtensionContextScope extends java.lang.Enum<TestInstantiationAwareExtension.ExtensionContextScope>ExtensionContextScopeis used to define the scope of theExtensionContextsupplied to an extension during the instantiation of test classes or processing of test instances.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description DEFAULTDeprecated.This behavior will be removed from future versions of JUnit, andTEST_METHODwill become the default.TEST_METHODThe extension should receive anExtensionContextscoped to the test method.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDEFAULT_SCOPE_PROPERTY_NAMEProperty name used to set the default extension context scope: "junit.jupiter.extensions.testinstantiation.extensioncontextscope.default"
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static TestInstantiationAwareExtension.ExtensionContextScopevalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static TestInstantiationAwareExtension.ExtensionContextScope[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
DEFAULT
@API(status=DEPRECATED, since="5.12") @Deprecated public static final TestInstantiationAwareExtension.ExtensionContextScope DEFAULTDeprecated.This behavior will be removed from future versions of JUnit, andTEST_METHODwill become the default.The extension should receive anExtensionContextfor the the default scope.The default scope is determined by the configuration parameter
DEFAULT_SCOPE_PROPERTY_NAME. If not specified, extensions will receive anExtensionContextscoped to the test class.- See Also:
DEFAULT_SCOPE_PROPERTY_NAME
-
TEST_METHOD
public static final TestInstantiationAwareExtension.ExtensionContextScope TEST_METHOD
The extension should receive anExtensionContextscoped to the test method.Note, however, that a test-class scoped context will always be supplied if the
PER_CLASStest instance lifecycle is used.
-
-
Field Detail
-
DEFAULT_SCOPE_PROPERTY_NAME
public static final java.lang.String DEFAULT_SCOPE_PROPERTY_NAME
Property name used to set the default extension context scope: "junit.jupiter.extensions.testinstantiation.extensioncontextscope.default"Supported Values
Supported values include names of enum constants defined in this class, ignoring case.
- See Also:
DEFAULT, Constant Field Values
-
-
Method Detail
-
values
public static TestInstantiationAwareExtension.ExtensionContextScope[] 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 (TestInstantiationAwareExtension.ExtensionContextScope c : TestInstantiationAwareExtension.ExtensionContextScope.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static TestInstantiationAwareExtension.ExtensionContextScope 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
-
-