public class StageTester extends Object
Modifier and Type | Method and Description |
---|---|
StageTester |
and()
Does nothing.
|
static <T> org.hamcrest.Matcher<OutputPort<T>> |
produces(T... values) |
static <T> org.hamcrest.Matcher<OutputPort<T>> |
producesNothing() |
<O> OutputHolder<O> |
receive(List<O> actualElements)
Deprecated.
since 3.0. Use the following code instead:
|
<I> InputHolder<I> |
send(I... elements) |
<I> InputHolder<I> |
send(List<I> elements) |
void |
start()
This method will start the test and block until it is finished.
|
static StageTester |
test(AbstractStage stage)
Prepares to test the given stage.
|
static StageTester |
test(CompositeStage compositeStage)
Prepares to test the given composite stage.
|
public static StageTester test(AbstractStage stage)
stage
- to be testedpublic static StageTester test(CompositeStage compositeStage)
compositeStage
- to be tested@SafeVarargs public final <I> InputHolder<I> send(I... elements)
elements
- which serve as input. If nothing should be sent, passpublic <I> InputHolder<I> send(List<I> elements)
elements
- which serve as input. If nothing should be sent, pass
Collections.<your type>emptyList().
@Deprecated public <O> OutputHolder<O> receive(List<O> actualElements)
import static StageTester.*;
...
assertThat(stage.getOutputPort(), produces(1,2,3));
actualElements
- which should be tested against the expected elements.public StageTester and()
public void start()
ExecutionException
- if at least one exception in one thread has occurred within the analysis.
The exception contains the pairs of thread and throwable.@SafeVarargs public static <T> org.hamcrest.Matcher<OutputPort<T>> produces(T... values)
public static <T> org.hamcrest.Matcher<OutputPort<T>> producesNothing()
Copyright © 2015–2020. All rights reserved.