Class JetCheckArgumentsGeneratorFactory
- All Implemented Interfaces:
ArgumentsGeneratorFactory
ArgumentsGenerators.
A third reference provider, after junit-quickcheck and Instancio. Unlike Instancio, jetCheck reads its randomness as a stream of ints rather than from a single seed, so Zest's byte-level mutations map onto local, structural changes in the generated value -- a better fit for coverage-guided search.
jetCheck has no reflective object builder, so this provider maps a fixed set of
parameter types to jetCheck-built values: the eight primitives (and their wrappers),
String, UUID, the java.time date-time types (LocalDate,
LocalTime, LocalDateTime, OffsetTime, OffsetDateTime) and
their java.sql counterparts (Date, Time, Timestamp). Any
other type fails fast with a message pointing to a richer provider.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a generator bound to the given test method.static org.jetbrains.jetCheck.Generator<?>generatorFor(Class<?> type) Maps a parameter type to a jetCheck generator for one of the supported types.
-
Constructor Details
-
JetCheckArgumentsGeneratorFactory
public JetCheckArgumentsGeneratorFactory()
-
-
Method Details
-
create
Description copied from interface:ArgumentsGeneratorFactoryCreates a generator bound to the given test method.- Specified by:
createin interfaceArgumentsGeneratorFactory- Parameters:
testClass- the class declaring the test methodtestMethod- the test method whose arguments will be generated- Returns:
- a generator for the method's parameters
-
generatorFor
Maps a parameter type to a jetCheck generator for one of the supported types.Public so a custom factory can reuse these built-in mappings for common types and supply its own generators only for its own types.
- Parameters:
type- the parameter type- Returns:
- a generator for that type
- Throws:
IllegalArgumentException- if the type is not supported
-