@API(status=MAINTAINED, since="5.3") public class DynamicContainer extends DynamicNode
DynamicContainer
is a container generated at runtime.
It is composed of a display name
and an Iterable
or Stream
of DynamicNodes
.
Instances of DynamicContainer
must be generated by factory methods
annotated with @TestFactory
.
dynamicContainer(String, Iterable)
,
dynamicContainer(String, Stream)
,
TestFactory
,
DynamicTest
Modifier and Type | Method and Description |
---|---|
static DynamicContainer |
dynamicContainer(String displayName,
Iterable<? extends DynamicNode> dynamicNodes)
Factory for creating a new
DynamicContainer for the supplied display
name and collection of dynamic nodes. |
static DynamicContainer |
dynamicContainer(String displayName,
Stream<? extends DynamicNode> dynamicNodes)
Factory for creating a new
DynamicContainer for the supplied display
name and stream of dynamic nodes. |
static DynamicContainer |
dynamicContainer(String displayName,
URI testSourceUri,
Stream<? extends DynamicNode> dynamicNodes)
Factory for creating a new
DynamicContainer for the supplied display
name, custom test source URI , and stream of dynamic nodes. |
Stream<? extends DynamicNode> |
getChildren()
|
getDisplayName, getTestSourceUri, toString
public static DynamicContainer dynamicContainer(String displayName, Iterable<? extends DynamicNode> dynamicNodes)
DynamicContainer
for the supplied display
name and collection of dynamic nodes.
The collection of dynamic nodes must not contain null
elements.
displayName
- the display name for the dynamic container; never
null
or blankdynamicNodes
- collection of dynamic nodes to execute;
never null
dynamicContainer(String, Stream)
public static DynamicContainer dynamicContainer(String displayName, Stream<? extends DynamicNode> dynamicNodes)
DynamicContainer
for the supplied display
name and stream of dynamic nodes.
The stream of dynamic nodes must not contain null
elements.
displayName
- the display name for the dynamic container; never
null
or blankdynamicNodes
- stream of dynamic nodes to execute;
never null
dynamicContainer(String, Iterable)
public static DynamicContainer dynamicContainer(String displayName, URI testSourceUri, Stream<? extends DynamicNode> dynamicNodes)
DynamicContainer
for the supplied display
name, custom test source URI
, and stream of dynamic nodes.
The stream of dynamic nodes must not contain null
elements.
displayName
- the display name for the dynamic container; never
null
or blanktestSourceUri
- a custom test source URI for the dynamic container;
may be null
if the framework should generate the test source based
on the @TestFactory
methoddynamicNodes
- stream of dynamic nodes to execute; never null
dynamicContainer(String, Iterable)
public Stream<? extends DynamicNode> getChildren()
Copyright © 2021. All rights reserved.