You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by ke...@apache.org on 2016/11/10 18:49:43 UTC
[3/6] incubator-beam git commit: Fix breakage in WindowedWordCountIT
Fix breakage in WindowedWordCountIT
Project: http://git-wip-us.apache.org/repos/asf/incubator-beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-beam/commit/e5b2f13f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-beam/tree/e5b2f13f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-beam/diff/e5b2f13f
Branch: refs/heads/master
Commit: e5b2f13f0116b0cd954b2214ca33cbf5a46a7261
Parents: ab06647
Author: Kenneth Knowles <kl...@google.com>
Authored: Wed Nov 9 10:22:51 2016 -0800
Committer: Kenneth Knowles <kl...@google.com>
Committed: Thu Nov 10 10:49:28 2016 -0800
----------------------------------------------------------------------
.../org/apache/beam/examples/WindowedWordCountIT.java | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/e5b2f13f/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 c78fad6..ccc2d5e 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
@@ -18,13 +18,14 @@
package org.apache.beam.examples;
import java.io.IOException;
-import org.apache.beam.examples.WindowedWordCount.Options;
+import java.util.Date;
import org.apache.beam.sdk.options.PipelineOptionsFactory;
import org.apache.beam.sdk.options.StreamingOptions;
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.apache.beam.sdk.util.IOChannelUtils;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;
@@ -43,7 +44,7 @@ public class WindowedWordCountIT {
* Options for the {@link WindowedWordCount} Integration Test.
*/
public interface WindowedWordCountITOptions
- extends Options, TestPipelineOptions, StreamingOptions {
+ extends WindowedWordCount.Options, TestPipelineOptions, StreamingOptions {
}
@BeforeClass
@@ -67,6 +68,14 @@ public class WindowedWordCountIT {
TestPipeline.testingPipelineOptions().as(WindowedWordCountITOptions.class);
options.setStreaming(isStreaming);
+ // Note: currently unused because the example writes to BigQuery, but WindowedWordCount.Options
+ // are tightly coupled to WordCount.Options, where the option is required.
+ options.setOutput(IOChannelUtils.resolve(
+ options.getTempRoot(),
+ String.format("WindowedWordCountIT-%tF-%<tH-%<tM-%<tS-%<tL", new Date()),
+ "output",
+ "results"));
+
String query = String.format("SELECT word, SUM(count) FROM [%s:%s.%s] GROUP BY word",
options.getProject(), options.getBigQueryDataset(), options.getBigQueryTable());
options.setOnSuccessMatcher(