Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-2358

"/test-your-pipeline" example code results in an exception

Details

    • Patch

    Description

      https://beam.apache.org/documentation/pipelines/test-your-pipeline/ has

       public void testCountWords() throws Exception {
            Pipeline p = TestPipeline.create();
      

      but this results in

      Exception in thread "main" java.lang.IllegalStateException: Is your TestPipeline declaration missing a @Rule annotation? Usage: @Rule public final transient TestPipeline pipeline = TestPipeline.Create();
      	at org.apache.beam.sdk.repackaged.com.google.common.base.Preconditions.checkState(Preconditions.java:444)
      	at org.apache.beam.sdk.testing.TestPipeline.run(TestPipeline.java:299)
      	at BasicPipelineTest.run(BasicPipelineTest.java:42)
      	at Main.main(Main.java:25)
      

      In the github example
      it's written as:

      public TestPipeline p = TestPipeline.create().enableAbandonedNodeEnforcement(false);
      

      I'm using 2.0.0 from the maven repo.

      Attachments

        Activity

          People

            Unassigned Unassigned
            nicku33 Nicholas Ursa
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - 2h
                2h
                Remaining:
                Remaining Estimate - 2h
                2h
                Logged:
                Time Spent - Not Specified
                Not Specified