public class DataProviders
extends java.lang.Object
| Constructor and Description |
|---|
DataProviders() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.Object[] |
$(java.lang.Object... args)
Helper method to create an
Object array containing all the given arguments, e.g. |
static java.lang.Object[][] |
$$(java.lang.Object[]... args)
Helper method to create an array of the given
Object arrays, e.g. |
static java.lang.Object[][] |
crossProduct(java.lang.Object[][] rows1,
java.lang.Object[][] rows2)
Creates a dataprovider test for each combination of elements of the two provided data providers.
|
static <E extends java.lang.Enum<E>> |
testForEach(java.lang.Class<E> enumClass)
Creates a dataprovider test for each value in the given
Enum class. |
static <T> java.lang.Object[][] |
testForEach(java.lang.Iterable<T> args)
Deprecated.
since 1.12.0
Iterable<?> can directly be returned from any dataprovider method |
static java.lang.Object[][] |
testForEach(java.lang.Object... args)
Creates a dataprovider test for each argument.
|
public static java.lang.Object[] $(java.lang.Object... args)
Object array containing all the given arguments, e.g.
Object[] a = $("test", 4);
args - which should be contained in the resulting Object arrayObject array containing all the given args$$(java.lang.Object[]...)public static java.lang.Object[][] $$(java.lang.Object[]... args)
Object arrays, e.g.
// @formatter:off
Object[][] b = $$(
$("", 0),
$("test", 4),
$("foo bar", 7),
);
// @formatter:on
args - which should be contained in the resulting array of Object arrayObject arrays containing all the given args$(java.lang.Object...)public static java.lang.Object[][] testForEach(java.lang.Object... args)
args - which are wrapped in Object arrays and combined to Object[][]Object arrays for each single argument@Deprecated public static <T> java.lang.Object[][] testForEach(java.lang.Iterable<T> args)
Iterable<?> can directly be returned from any dataprovider methodIterable.T - the type of elements returned by the given Iterableargs - which are wrapped in Object arrays and combined to Object[][]Object arrays for each single element in the given Iterablejava.lang.NullPointerException - iif given args is nullpublic static <E extends java.lang.Enum<E>> java.lang.Object[][] testForEach(java.lang.Class<E> enumClass)
Enum class.E - the type of the enum type subclass modeled by the given ClassenumClass - for which each value is wrapped into an array of Object arraysObject arrays for each single value in the given Enumjava.lang.NullPointerException - iif given enumClass is nullpublic static java.lang.Object[][] crossProduct(java.lang.Object[][] rows1,
java.lang.Object[][] rows2)
Object[][] r = crossProduct(dataProviderMethod1, dataProviderMethod2);
rows1 - of first dataprovider which should be cross producted with the secondrows2 - of second dataprovider which should be cross producted with the firstObject array array containing the cross product of the given rows