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 9A215200BB9 for ; Mon, 7 Nov 2016 22:51:52 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 98B4A160AEC; Mon, 7 Nov 2016 21:51:52 +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 B7028160AE0 for ; Mon, 7 Nov 2016 22:51:51 +0100 (CET) Received: (qmail 8067 invoked by uid 500); 7 Nov 2016 21:51:50 -0000 Mailing-List: contact commits-help@beam.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@beam.incubator.apache.org Delivered-To: mailing list commits@beam.incubator.apache.org Received: (qmail 8058 invoked by uid 99); 7 Nov 2016 21:51:50 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Nov 2016 21:51:50 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 278101A998B for ; Mon, 7 Nov 2016 21:51:50 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -6.219 X-Spam-Level: X-Spam-Status: No, score=-6.219 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id oN6rN_mH9BkH for ; Mon, 7 Nov 2016 21:51:48 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id 0FD045F1C2 for ; Mon, 7 Nov 2016 21:51:46 +0000 (UTC) Received: (qmail 7923 invoked by uid 99); 7 Nov 2016 21:51:46 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Nov 2016 21:51:46 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 3C2C2E2F01; Mon, 7 Nov 2016 21:51:46 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: lcwik@apache.org To: commits@beam.incubator.apache.org Date: Mon, 07 Nov 2016 21:51:46 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/2] incubator-beam git commit: Fix IT Options Conflict archived-at: Mon, 07 Nov 2016 21:51:52 -0000 Repository: incubator-beam Updated Branches: refs/heads/master 3e84a5f3c -> 912500f13 Fix IT Options Conflict Project: http://git-wip-us.apache.org/repos/asf/incubator-beam/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-beam/commit/19279689 Tree: http://git-wip-us.apache.org/repos/asf/incubator-beam/tree/19279689 Diff: http://git-wip-us.apache.org/repos/asf/incubator-beam/diff/19279689 Branch: refs/heads/master Commit: 1927968955dfe834b3e48482a606ffa7fc403749 Parents: 3e84a5f Author: Mark Liu Authored: Mon Nov 7 11:27:15 2016 -0800 Committer: Luke Cwik Committed: Mon Nov 7 13:45:43 2016 -0800 ---------------------------------------------------------------------- .../apache/beam/examples/WindowedWordCountIT.java | 16 +++++++--------- .../java/org/apache/beam/examples/WordCountIT.java | 17 +++++++---------- .../examples/cookbook/BigQueryTornadoesIT.java | 16 +++++++--------- 3 files changed, 21 insertions(+), 28 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/19279689/examples/java/src/test/java/org/apache/beam/examples/WindowedWordCountIT.java ---------------------------------------------------------------------- diff --git a/examples/java/src/test/java/org/apache/beam/examples/WindowedWordCountIT.java b/examples/java/src/test/java/org/apache/beam/examples/WindowedWordCountIT.java index d545ad2..c78fad6 100644 --- a/examples/java/src/test/java/org/apache/beam/examples/WindowedWordCountIT.java +++ b/examples/java/src/test/java/org/apache/beam/examples/WindowedWordCountIT.java @@ -17,7 +17,6 @@ */ package org.apache.beam.examples; -import com.google.common.base.Strings; import java.io.IOException; import org.apache.beam.examples.WindowedWordCount.Options; import org.apache.beam.sdk.options.PipelineOptionsFactory; @@ -26,6 +25,7 @@ import org.apache.beam.sdk.testing.BigqueryMatcher; import org.apache.beam.sdk.testing.StreamingIT; import org.apache.beam.sdk.testing.TestPipeline; import org.apache.beam.sdk.testing.TestPipelineOptions; +import org.junit.BeforeClass; import org.junit.Test; import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; @@ -44,8 +44,11 @@ public class WindowedWordCountIT { */ public interface WindowedWordCountITOptions extends Options, TestPipelineOptions, StreamingOptions { - String getChecksum(); - void setChecksum(String value); + } + + @BeforeClass + public static void setUp() { + PipelineOptionsFactory.register(TestPipelineOptions.class); } @Test @@ -60,20 +63,15 @@ public class WindowedWordCountIT { } private void testWindowedWordCountPipeline(boolean isStreaming) throws IOException { - PipelineOptionsFactory.register(WindowedWordCountITOptions.class); WindowedWordCountITOptions options = TestPipeline.testingPipelineOptions().as(WindowedWordCountITOptions.class); options.setStreaming(isStreaming); String query = String.format("SELECT word, SUM(count) FROM [%s:%s.%s] GROUP BY word", options.getProject(), options.getBigQueryDataset(), options.getBigQueryTable()); - String outputChecksum = - Strings.isNullOrEmpty(options.getChecksum()) - ? DEFAULT_OUTPUT_CHECKSUM - : options.getChecksum(); options.setOnSuccessMatcher( new BigqueryMatcher( - options.getAppName(), options.getProject(), query, outputChecksum)); + options.getAppName(), options.getProject(), query, DEFAULT_OUTPUT_CHECKSUM)); WindowedWordCount.main(TestPipeline.convertToArgs(options)); } http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/19279689/examples/java/src/test/java/org/apache/beam/examples/WordCountIT.java ---------------------------------------------------------------------- diff --git a/examples/java/src/test/java/org/apache/beam/examples/WordCountIT.java b/examples/java/src/test/java/org/apache/beam/examples/WordCountIT.java index 8f170af..487f04b 100644 --- a/examples/java/src/test/java/org/apache/beam/examples/WordCountIT.java +++ b/examples/java/src/test/java/org/apache/beam/examples/WordCountIT.java @@ -18,7 +18,6 @@ package org.apache.beam.examples; -import com.google.common.base.Strings; import java.util.Date; import org.apache.beam.examples.WordCount.WordCountOptions; import org.apache.beam.sdk.options.PipelineOptionsFactory; @@ -26,6 +25,7 @@ import org.apache.beam.sdk.testing.FileChecksumMatcher; import org.apache.beam.sdk.testing.TestPipeline; import org.apache.beam.sdk.testing.TestPipelineOptions; import org.apache.beam.sdk.util.IOChannelUtils; +import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @@ -45,13 +45,15 @@ public class WordCountIT { * with customized input. */ public interface WordCountITOptions extends TestPipelineOptions, WordCountOptions { - String getChecksum(); - void setChecksum(String value); + } + + @BeforeClass + public static void setUp() { + PipelineOptionsFactory.register(TestPipelineOptions.class); } @Test public void testE2EWordCount() throws Exception { - PipelineOptionsFactory.register(WordCountITOptions.class); WordCountITOptions options = TestPipeline.testingPipelineOptions().as(WordCountITOptions.class); options.setOutput(IOChannelUtils.resolve( @@ -59,13 +61,8 @@ public class WordCountIT { String.format("WordCountIT-%tF-%