Package | Description |
---|---|
com.pholser.junit.quickcheck.generator |
Modifier and Type | Class and Description |
---|---|
class |
ComponentizedGenerator<T>
Produces values for property parameters of types that have parameterizations
that would also need generation, such as collections, maps, and predicates.
|
class |
Ctor<T>
Produces instances of a class by generating values for the parameters of
one of the constructors on the class, and invoking the constructor.
|
class |
Fields<T>
Produces instances of a class by reflecting the class's fields and
generating random values for them.
|
class |
Generator<T>
Produces values for property parameters.
|
Modifier and Type | Method and Description |
---|---|
default Gen<T> |
Gen.filter(Predicate<? super T> condition)
Gives a generation strategy that produces a random value by having this
strategy produce random values until one satisfies the given condition,
then using that value as the result.
|
default Gen<Optional<T>> |
Gen.filterOptional(Predicate<? super T> condition)
|
default <U> Gen<U> |
Gen.flatMap(Function<? super T,? extends Gen<? extends U>> mapper)
Gives a generation strategy that produces a random value by having this
strategy produce a random value, then applying the given function to
that value, and asking the result to produce a value.
|
static <U> Gen<U> |
Gen.frequency(Pair<Integer,Gen<? extends U>> first,
Pair<Integer,Gen<? extends U>>... rest)
Gives a generation strategy that produces a random value by choosing
one of the given generators at random with probability in proportion
to their given weights, and having it generate a value.
|
default <U> Gen<U> |
Gen.map(Function<? super T,? extends U> mapper)
Gives a generation strategy that produces a random value by having this
strategy produce a random value, then applying the given function to
that value, and returning the result.
|
static <U> Gen<U> |
Gen.oneOf(Gen<? extends U> first,
Gen<? extends U>... rest)
Gives a generation strategy that produces a random value by choosing
one of the given generators at random with (approximately) equal
probability, and having it generate a value.
|
static <U> Gen<U> |
Gen.oneOf(U first,
U... rest)
Gives a generation strategy that produces a random value by choosing
one of the given values at random with (approximately) equal
probability.
|
static <U> Gen<U> |
Gen.pure(U constant)
Gives a generation strategy that produces the given value, always.
|
default Gen<List<T>> |
Gen.times(int times) |
Modifier and Type | Method and Description |
---|---|
static <U> Pair<Integer,Gen<? extends U>> |
Gen.freq(int weight,
Gen<? extends U> generator)
Helper for making a weighted generator indicator for
frequency(Pair, Pair[]) . |
Modifier and Type | Method and Description |
---|---|
static <U> Pair<Integer,Gen<? extends U>> |
Gen.freq(int weight,
Gen<? extends U> generator)
Helper for making a weighted generator indicator for
frequency(Pair, Pair[]) . |
static <U> Gen<U> |
Gen.oneOf(Gen<? extends U> first,
Gen<? extends U>... rest)
Gives a generation strategy that produces a random value by choosing
one of the given generators at random with (approximately) equal
probability, and having it generate a value.
|
static <U> Gen<U> |
Gen.oneOf(Gen<? extends U> first,
Gen<? extends U>... rest)
Gives a generation strategy that produces a random value by choosing
one of the given generators at random with (approximately) equal
probability, and having it generate a value.
|
Modifier and Type | Method and Description |
---|---|
default <U> Gen<U> |
Gen.flatMap(Function<? super T,? extends Gen<? extends U>> mapper)
Gives a generation strategy that produces a random value by having this
strategy produce a random value, then applying the given function to
that value, and asking the result to produce a value.
|
static <U> Gen<U> |
Gen.frequency(Pair<Integer,Gen<? extends U>> first,
Pair<Integer,Gen<? extends U>>... rest)
Gives a generation strategy that produces a random value by choosing
one of the given generators at random with probability in proportion
to their given weights, and having it generate a value.
|
© Copyright 2010-2016 Paul R. Holser, Jr. All rights reserved. Licensed under The MIT License. pholser@alumni.rice.edu