You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by "Nicholas Ursa (JIRA)" <ji...@apache.org> on 2017/05/24 16:30:09 UTC
[jira] [Updated] (BEAM-2358) "/test-your-pipeline" example code
results in an exception
[ https://issues.apache.org/jira/browse/BEAM-2358?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nicholas Ursa updated BEAM-2358:
--------------------------------
Description:
https://beam.apache.org/documentation/pipelines/test-your-pipeline/ has
{code}
public void testCountWords() throws Exception {
Pipeline p = TestPipeline.create();
{code}
but this results in
{code}
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)
{code}
In the [github example|https://github.com/apache/beam/blob/master/examples/java8/src/test/java/org/apache/beam/examples/MinimalWordCountJava8Test.java#L56]
it's written as:
{code}
public TestPipeline p = TestPipeline.create().enableAbandonedNodeEnforcement(false);
{code}
I'm using 2.0.0 from the maven repo.
was:
https://beam.apache.org/documentation/pipelines/test-your-pipeline/ has
{code}
public void testCountWords() throws Exception {
Pipeline p = TestPipeline.create();
{code}
but this results in
{{monospaced}}
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)
{{monospaced}}
In the [github example|https://github.com/apache/beam/blob/master/examples/java8/src/test/java/org/apache/beam/examples/MinimalWordCountJava8Test.java#L56]
it's written as:
{code}
public TestPipeline p = TestPipeline.create().enableAbandonedNodeEnforcement(false);
{code}
I'm using 2.0.0 from the maven repo.
> "/test-your-pipeline" example code results in an exception
> ----------------------------------------------------------
>
> Key: BEAM-2358
> URL: https://issues.apache.org/jira/browse/BEAM-2358
> Project: Beam
> Issue Type: Bug
> Components: website
> Reporter: Nicholas Ursa
> Assignee: Davor Bonaci
> Labels: documentation, easyfix
> Original Estimate: 2h
> Remaining Estimate: 2h
>
> https://beam.apache.org/documentation/pipelines/test-your-pipeline/ has
> {code}
> public void testCountWords() throws Exception {
> Pipeline p = TestPipeline.create();
> {code}
> but this results in
> {code}
> 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)
> {code}
> In the [github example|https://github.com/apache/beam/blob/master/examples/java8/src/test/java/org/apache/beam/examples/MinimalWordCountJava8Test.java#L56]
> it's written as:
> {code}
> public TestPipeline p = TestPipeline.create().enableAbandonedNodeEnforcement(false);
> {code}
> I'm using 2.0.0 from the maven repo.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)