Class Autofuzz
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T1> void
autofuzz
(FuzzedDataProvider data, Consumer1<T1> func) Attempts to invokefunc
with arguments created automatically from the fuzzer input using only public methods available on the classpath.static <T1,
T2> void autofuzz
(FuzzedDataProvider data, Consumer2<T1, T2> func) Attempts to invokefunc
with arguments created automatically from the fuzzer input using only public methods available on the classpath.static <T1,
T2, T3> void autofuzz
(FuzzedDataProvider data, Consumer3<T1, T2, T3> func) Attempts to invokefunc
with arguments created automatically from the fuzzer input using only public methods available on the classpath.static <T1,
T2, T3, T4>
voidautofuzz
(FuzzedDataProvider data, Consumer4<T1, T2, T3, T4> func) Attempts to invokefunc
with arguments created automatically from the fuzzer input using only public methods available on the classpath.static <T1,
T2, T3, T4, T5>
voidautofuzz
(FuzzedDataProvider data, Consumer5<T1, T2, T3, T4, T5> func) Attempts to invokefunc
with arguments created automatically from the fuzzer input using only public methods available on the classpath.static <T1,
R> R autofuzz
(FuzzedDataProvider data, Function1<T1, R> func) Attempts to invokefunc
with arguments created automatically from the fuzzer input using only public methods available on the classpath.static <T1,
T2, R> R autofuzz
(FuzzedDataProvider data, Function2<T1, T2, R> func) Attempts to invokefunc
with arguments created automatically from the fuzzer input using only public methods available on the classpath.static <T1,
T2, T3, R>
Rautofuzz
(FuzzedDataProvider data, Function3<T1, T2, T3, R> func) Attempts to invokefunc
with arguments created automatically from the fuzzer input using only public methods available on the classpath.static <T1,
T2, T3, T4, R>
Rautofuzz
(FuzzedDataProvider data, Function4<T1, T2, T3, T4, R> func) Attempts to invokefunc
with arguments created automatically from the fuzzer input using only public methods available on the classpath.static <T1,
T2, T3, T4, T5, R>
Rautofuzz
(FuzzedDataProvider data, Function5<T1, T2, T3, T4, T5, R> func) Attempts to invokefunc
with arguments created automatically from the fuzzer input using only public methods available on the classpath.static <T> T
consume
(FuzzedDataProvider data, Class<T> type) Attempts to construct an instance oftype
from the fuzzer input using only public methods available on the classpath.
-
Method Details
-
autofuzz
Attempts to invokefunc
with arguments created automatically from the fuzzer input using only public methods available on the classpath.Note: This function is inherently heuristic and may fail to execute
func
in meaningful ways for a number of reasons.- Parameters:
data
- theFuzzedDataProvider
instance provided tofuzzerTestOneInput
.func
- a method reference for the function to autofuzz. If there are multiple overloads, resolve ambiguities by explicitly casting toFunction1
with (partially) specified type variables, e.g.(Function1<String, ?>) String::new
.- Returns:
- the return value of
func
, ornull
ifautofuzz
failed to invoke the function. - Throws:
Throwable
- anyThrowable
thrown byfunc
, or anAutofuzzConstructionException
if autofuzz failed to construct the arguments for the call. TheThrowable
is thrown unchecked.
-
autofuzz
Attempts to invokefunc
with arguments created automatically from the fuzzer input using only public methods available on the classpath.Note: This function is inherently heuristic and may fail to execute
func
in meaningful ways for a number of reasons.- Parameters:
data
- theFuzzedDataProvider
instance provided tofuzzerTestOneInput
.func
- a method reference for the function to autofuzz. If there are multiple overloads, resolve ambiguities by explicitly casting toFunction2
with (partially) specified type variables.- Returns:
- the return value of
func
, ornull
ifautofuzz
failed to invoke the function. - Throws:
Throwable
- anyThrowable
thrown byfunc
, or anAutofuzzConstructionException
if autofuzz failed to construct the arguments for the call. TheThrowable
is thrown unchecked.
-
autofuzz
Attempts to invokefunc
with arguments created automatically from the fuzzer input using only public methods available on the classpath.Note: This function is inherently heuristic and may fail to execute
func
in meaningful ways for a number of reasons.- Parameters:
data
- theFuzzedDataProvider
instance provided tofuzzerTestOneInput
.func
- a method reference for the function to autofuzz. If there are multiple overloads, resolve ambiguities by explicitly casting toFunction3
with (partially) specified type variables.- Returns:
- the return value of
func
, ornull
ifautofuzz
failed to invoke the function. - Throws:
Throwable
- anyThrowable
thrown byfunc
, or anAutofuzzConstructionException
if autofuzz failed to construct the arguments for the call. TheThrowable
is thrown unchecked.
-
autofuzz
public static <T1,T2, R autofuzzT3, T4, R> (FuzzedDataProvider data, Function4<T1, T2, T3, T4, R> func) Attempts to invokefunc
with arguments created automatically from the fuzzer input using only public methods available on the classpath.Note: This function is inherently heuristic and may fail to execute
func
in meaningful ways for a number of reasons.- Parameters:
data
- theFuzzedDataProvider
instance provided tofuzzerTestOneInput
.func
- a method reference for the function to autofuzz. If there are multiple overloads, resolve ambiguities by explicitly casting toFunction4
with (partially) specified type variables.- Returns:
- the return value of
func
, ornull
ifautofuzz
failed to invoke the function. - Throws:
Throwable
- anyThrowable
thrown byfunc
, or anAutofuzzConstructionException
if autofuzz failed to construct the arguments for the call. TheThrowable
is thrown unchecked.
-
autofuzz
public static <T1,T2, R autofuzzT3, T4, T5, R> (FuzzedDataProvider data, Function5<T1, T2, T3, T4, T5, R> func) Attempts to invokefunc
with arguments created automatically from the fuzzer input using only public methods available on the classpath.Note: This function is inherently heuristic and may fail to execute
func
in meaningful ways for a number of reasons.- Parameters:
data
- theFuzzedDataProvider
instance provided tofuzzerTestOneInput
.func
- a method reference for the function to autofuzz. If there are multiple overloads, resolve ambiguities by explicitly casting toFunction5
with (partially) specified type variables.- Returns:
- the return value of
func
, ornull
ifautofuzz
failed to invoke the function. - Throws:
Throwable
- anyThrowable
thrown byfunc
, or anAutofuzzConstructionException
if autofuzz failed to construct the arguments for the call. TheThrowable
is thrown unchecked.
-
autofuzz
Attempts to invokefunc
with arguments created automatically from the fuzzer input using only public methods available on the classpath.Note: This function is inherently heuristic and may fail to execute
func
in meaningful ways for a number of reasons.- Parameters:
data
- theFuzzedDataProvider
instance provided tofuzzerTestOneInput
.func
- a method reference for the function to autofuzz. If there are multiple overloads, resolve ambiguities by explicitly casting toConsumer1
with explicitly specified type variable.- Throws:
Throwable
- anyThrowable
thrown byfunc
, or anAutofuzzConstructionException
if autofuzz failed to construct the arguments for the call. TheThrowable
is thrown unchecked.
-
autofuzz
Attempts to invokefunc
with arguments created automatically from the fuzzer input using only public methods available on the classpath.Note: This function is inherently heuristic and may fail to execute
func
in meaningful ways for a number of reasons.- Parameters:
data
- theFuzzedDataProvider
instance provided tofuzzerTestOneInput
.func
- a method reference for the function to autofuzz. If there are multiple overloads, resolve ambiguities by explicitly casting toConsumer2
with (partially) specified type variables.- Throws:
Throwable
- anyThrowable
thrown byfunc
, or anAutofuzzConstructionException
if autofuzz failed to construct the arguments for the call. TheThrowable
is thrown unchecked.
-
autofuzz
Attempts to invokefunc
with arguments created automatically from the fuzzer input using only public methods available on the classpath.Note: This function is inherently heuristic and may fail to execute
func
in meaningful ways for a number of reasons.- Parameters:
data
- theFuzzedDataProvider
instance provided tofuzzerTestOneInput
.func
- a method reference for the function to autofuzz. If there are multiple overloads, resolve ambiguities by explicitly casting toConsumer3
with (partially) specified type variables.- Throws:
Throwable
- anyThrowable
thrown byfunc
, or anAutofuzzConstructionException
if autofuzz failed to construct the arguments for the call. TheThrowable
is thrown unchecked.
-
autofuzz
Attempts to invokefunc
with arguments created automatically from the fuzzer input using only public methods available on the classpath.Note: This function is inherently heuristic and may fail to execute
func
in meaningful ways for a number of reasons.- Parameters:
data
- theFuzzedDataProvider
instance provided tofuzzerTestOneInput
.func
- a method reference for the function to autofuzz. If there are multiple overloads, resolve ambiguities by explicitly casting toConsumer4
with (partially) specified type variables.- Throws:
Throwable
- anyThrowable
thrown byfunc
, or anAutofuzzConstructionException
if autofuzz failed to construct the arguments for the call. TheThrowable
is thrown unchecked.
-
autofuzz
public static <T1,T2, void autofuzzT3, T4, T5> (FuzzedDataProvider data, Consumer5<T1, T2, T3, T4, T5> func) Attempts to invokefunc
with arguments created automatically from the fuzzer input using only public methods available on the classpath.Note: This function is inherently heuristic and may fail to execute
func
in meaningful ways for a number of reasons.- Parameters:
data
- theFuzzedDataProvider
instance provided tofuzzerTestOneInput
.func
- a method reference for the function to autofuzz. If there are multiple overloads, resolve ambiguities by explicitly casting toConsumer5
with (partially) specified type variables.- Throws:
Throwable
- anyThrowable
thrown byfunc
, or anAutofuzzConstructionException
if autofuzz failed to construct the arguments for the call. TheThrowable
is thrown unchecked.
-
consume
Attempts to construct an instance oftype
from the fuzzer input using only public methods available on the classpath.Note: This function is inherently heuristic and may fail to return meaningful values for a variety of reasons.
- Parameters:
data
- theFuzzedDataProvider
instance provided tofuzzerTestOneInput
.type
- theClass
to construct an instance of.- Returns:
- an instance of
type
constructed from the fuzzer input, ornull
if autofuzz failed to create an instance.
-