Package guru.mikelue.jdut.junit5
Enum JdutYamlFactory.Event
- java.lang.Object
-
- java.lang.Enum<JdutYamlFactory.Event>
-
- guru.mikelue.jdut.junit5.JdutYamlFactory.Event
-
- All Implemented Interfaces:
Serializable
,Comparable<JdutYamlFactory.Event>
- Enclosing class:
- JdutYamlFactory
public static enum JdutYamlFactory.Event extends Enum<JdutYamlFactory.Event>
Defins the class-level or method-level event of loading test data.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ClassLevel
Class-level of loading test data.MethodLevel
MethodLevel-level of loading test data.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getResourceUrl(org.junit.jupiter.api.extension.ExtensionContext context)
Retrieves URL for resource(YAML file) by context and current event.AnnotatedElement
getTargetElement(org.junit.jupiter.api.extension.ExtensionContext context)
static JdutYamlFactory.Event
valueOf(String name)
Returns the enum constant of this type with the specified name.static JdutYamlFactory.Event[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
MethodLevel
public static final JdutYamlFactory.Event MethodLevel
MethodLevel-level of loading test data. The resource URL would be: classpath:{package}/{classname}-{methodname}.yaml.
-
ClassLevel
public static final JdutYamlFactory.Event ClassLevel
Class-level of loading test data. The resource URL would be: classpath:{package}/{classname}.yaml.
-
-
Method Detail
-
values
public static JdutYamlFactory.Event[] 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 (JdutYamlFactory.Event c : JdutYamlFactory.Event.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static JdutYamlFactory.Event valueOf(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:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getTargetElement
public AnnotatedElement getTargetElement(org.junit.jupiter.api.extension.ExtensionContext context)
- Parameters:
context
- The context provided by JUnit 5- Returns:
- target element
-
getResourceUrl
public String getResourceUrl(org.junit.jupiter.api.extension.ExtensionContext context)
Retrieves URL for resource(YAML file) by context and current event.- Parameters:
context
- The context provided by JUnit 5- Returns:
- target element
-
-