runners/google-cloud-dataflow-java/src/test/java/org/apache/beam/runners/dataflow/DataflowRunnerTest.java
/** Tests that all reads are consumed by at least one {@link PTransform}. */
Tests that all reads are consumed by at least one  PTransform.
Tests that all reads are consumed by at least one PTransform .
@Test
  public void testUnconsumedReads() throws IOException {
    DataflowPipelineOptions dataflowOptions = buildPipelineOptions();
    RuntimeTestOptions options = dataflowOptions.as(RuntimeTestOptions.class);
    Pipeline p = buildDataflowPipeline(dataflowOptions);
    p.apply(TextIO.read().from(options.getInput()));
    DataflowRunner.fromOptions(dataflowOptions).replaceV1Transforms(p);
    final AtomicBoolean unconsumedSeenAsInput = new AtomicBoolean();
    p.traverseTopologically(
        new PipelineVisitor.Defaults() {
          @Override
          public void visitPrimitiveTransform(Node node) {
            unconsumedSeenAsInput.set(true);
          }
        });
    assertThat(unconsumedSeenAsInput.get(), is(true));
  }
@ Test public void testUnconsumedReads ( ) throws IOException { DataflowPipelineOptions dataflowOptions = buildPipelineOptions ( ) ; RuntimeTestOptions options = dataflowOptions . as ( RuntimeTestOptions . class ) ; Pipeline p = buildDataflowPipeline ( dataflowOptions ) ; p . apply ( TextIO . read ( ) . from ( options . getInput ( ) ) ) ; DataflowRunner . fromOptions ( dataflowOptions ) . replaceV1Transforms ( p ) ; final AtomicBoolean unconsumedSeenAsInput = new AtomicBoolean ( ) ; p . traverseTopologically ( new PipelineVisitor . Defaults ( ) { @ Override public void visitPrimitiveTransform ( Node node ) { unconsumedSeenAsInput . set ( true ) ; } } ) ; assertThat ( unconsumedSeenAsInput . get ( ) , is ( true ) ) ; }
Tests that all reads are consumed by at least one {@link PTransform}.
Tests that all reads are consumed by at least one { @link PTransform } .