Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id C6E03200C7F for ; Wed, 24 May 2017 18:37:09 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C586D160BD0; Wed, 24 May 2017 16:37:09 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 18698160BA5 for ; Wed, 24 May 2017 18:37:08 +0200 (CEST) Received: (qmail 3306 invoked by uid 500); 24 May 2017 16:37:08 -0000 Mailing-List: contact commits-help@beam.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@beam.apache.org Delivered-To: mailing list commits@beam.apache.org Received: (qmail 3297 invoked by uid 99); 24 May 2017 16:37:08 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 May 2017 16:37:08 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id B88F4C4423 for ; Wed, 24 May 2017 16:37:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id MuwHKKESkKMh for ; Wed, 24 May 2017 16:37:05 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 55B5A5FD38 for ; Wed, 24 May 2017 16:37:05 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id D7D02E0D50 for ; Wed, 24 May 2017 16:37:04 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 5126921B5D for ; Wed, 24 May 2017 16:37:04 +0000 (UTC) Date: Wed, 24 May 2017 16:37:04 +0000 (UTC) From: "Nicholas Ursa (JIRA)" To: commits@beam.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (BEAM-2358) "/test-your-pipeline" example code results in an exception MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 24 May 2017 16:37:10 -0000 [ https://issues.apache.org/jira/browse/BEAM-2358?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16023187#comment-16023187 ] Nicholas Ursa edited comment on BEAM-2358 at 5/24/17 4:36 PM: -------------------------------------------------------------- @Rule only works on methods and fields, so this means you wouldn't be able to create a pipeline in a local variable, which seems overly restrictive. {code} @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.FIELD, ElementType.METHOD}) public @interface Rule { } {code} The change in code came out of this ticket: https://issues.apache.org/jira/browse/BEAM-1205 was (Author: nicku33): @Rule only works on methods and fields, so this means you wouldn't be able to create a pipeline in a method, which seems overly restrictive. {code} @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.FIELD, ElementType.METHOD}) public @interface Rule { } {code} The change in code came out of this ticket: https://issues.apache.org/jira/browse/BEAM-1205 > "/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)