Package de.cuioss.test.generator.junit.parameterized
JUnit 5 Parameterized Test Support for TypedGenerator
This package provides JUnit 5 extensions that enable seamless integration of
TypedGenerator instances with JUnit 5's
parameterized testing framework. These extensions allow developers to use
TypedGenerator implementations to generate test data for parameterized tests.
This package extends the functionality provided in the parent package
de.cuioss.test.generator.junit by adding specific support for JUnit 5's
parameterized testing features.
Common Parameters
All annotations in this package support the following common parameters:
- count - Specifies the number of test instances to generate. This controls how many test invocations will occur with different generated values. Defaults to 1 in most annotations.
- seed - An optional seed value for reproducible tests.
When specified (not -1), this seed will be used for the generator instead of the
seed managed by
GeneratorControllerExtension. This is useful for tests that need specific generated values regardless of the global seed configuration.
Available Annotations
The package provides the following annotations for different use cases:
TypeGeneratorSource- Uses a TypedGenerator implementation directly via its class.TypeGeneratorMethodSource- Uses a method that returns a configured TypedGenerator instance.TypeGeneratorFactorySource- Uses a factory class with a static method to create a TypedGenerator instance.CompositeTypeGeneratorSource- Combines multiple TypedGenerator implementations to generate combinations of values.
Integration with JUnit 5
These annotations are designed to be used with JUnit 5's @ParameterizedTest
annotation. They provide ArgumentsProvider
implementations that generate test arguments from TypedGenerator instances.
For detailed usage examples, refer to the documentation of each annotation.
- Since:
- 2.0
- Author:
- Oliver Wolff
- See Also:
-
ClassDescriptionAbstract base class for TypedGenerator-based ArgumentsProviders.Implementation of
ArgumentsProviderthat provides arguments from multipleTypedGeneratorinstances for parameterized tests annotated withCompositeTypeGeneratorSource.@CompositeTypeGeneratorSourceis anArgumentsSourcethat provides access to values from multipleTypedGeneratorimplementations for parameterized tests, generating combinations of values.@GeneratorsSourceis a variant ofTypeGeneratorFactorySourcethat always usesGeneratorsas the factory class for creatingTypedGeneratorinstances for parameterized tests.Implementation ofArgumentsProviderthat provides arguments from aTypedGeneratorcreated by theGeneratorsutility class for parameterized tests annotated withGeneratorsSource.Enum representing all available generator types from theGeneratorsclass.Implementation ofArgumentsProviderthat provides arguments from aTypedGeneratorfor parameterized tests annotated withTypeGeneratorSource.Implementation ofArgumentsProviderthat provides arguments from aTypedGeneratorcreated by a factory class for parameterized tests annotated withTypeGeneratorFactorySource.@TypeGeneratorFactorySourceis anArgumentsSourcethat provides access to values from aTypedGeneratorcreated by a factory class for parameterized tests.Implementation ofArgumentsProviderthat provides arguments from aTypedGeneratorreturned by a method for parameterized tests annotated withTypeGeneratorMethodSource.@TypeGeneratorMethodSourceis anArgumentsSourcethat provides access to values from aTypedGeneratorreturned by a factory method for parameterized tests.@TypeGeneratorSourceis anArgumentsSourcethat provides access to values from aTypedGeneratorimplementation for parameterized tests.