Enum Class Lifecycle
- All Implemented Interfaces:
Serializable
,Comparable<Lifecycle>
,Constable
Possible values for the
FuzzTest.lifecycle()
option.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionFuzz tests with this lifecycle go through the JUnit test method lifecycle once for every test method execution during fuzzing, i.e., per-test lifecycle methods such asBeforeEach
methods are executed before each individual invocation of the fuzz test method and every execution uses its own test class instance.Fuzz tests with this lifecycle only go through the JUnit test method lifecycle once during fuzzing, i.e., per-test lifecycle methods such asBeforeEach
methods are executed once for each fuzz test. -
Method Summary
-
Enum Constant Details
-
PER_TEST
Fuzz tests with this lifecycle only go through the JUnit test method lifecycle once during fuzzing, i.e., per-test lifecycle methods such asBeforeEach
methods are executed once for each fuzz test.This mode is usually more efficient than
PER_EXECUTION
, but is more likely to unintentionally preserve state between fuzz test executions, which can result in non-reproducible findings. -
PER_EXECUTION
Fuzz tests with this lifecycle go through the JUnit test method lifecycle once for every test method execution during fuzzing, i.e., per-test lifecycle methods such asBeforeEach
methods are executed before each individual invocation of the fuzz test method and every execution uses its own test class instance.This mode is usually less efficient than
PER_TEST
, but makes it easier to write stateless fuzz tests that interoperate correctly with JUnit extensions used by test frameworks.The following lifecycle methods and extensions are currently supported:
Note: Lifecycle methods for different test class instances may be invoked concurrently, which can lead to issues if these methods are using global resources (e.g. file locks).
-
-
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
-