public class TestPipeline extends Pipeline
It is recommended to tag hand-selected tests for this purpose using the RunnableOnService Category annotation, as each test run against the service will spin up and tear down a single VM.
In order to run tests on the dataflow pipeline service, the following conditions must be met:
Use DataflowAssert for tests, as it integrates with this test
harness in both direct and remote execution modes. For example:
Pipeline p = TestPipeline.create();
PCollection<Integer> output = ...
DataflowAssert.that(output)
.containsInAnyOrder(1, 2, 3, 4);
p.run();
Pipeline.PipelineVisitor| Modifier and Type | Method and Description |
|---|---|
static TestPipeline |
create()
Creates and returns a new test pipeline.
|
addValueInternal, apply, applyTransform, begin, create, getCoderRegistry, getFullName, getInput, getOptions, getOutput, getRunner, run, setCoderRegistry, toString, traverseTopologicallypublic static TestPipeline create()
Use DataflowAssert to add tests, then call
Pipeline.run() to execute the pipeline and check the tests.