beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From k...@apache.org
Subject [38/50] beam git commit: Add window matcher for pane info
Date Fri, 23 Jun 2017 03:05:04 GMT
Add window matcher for pane info


Project: http://git-wip-us.apache.org/repos/asf/beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/497cfabe
Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/497cfabe
Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/497cfabe

Branch: refs/heads/gearpump-runner
Commit: 497cfabea7d6dcee0c5d327022678c571c3ec487
Parents: 9ed0af8
Author: Kenneth Knowles <klk@google.com>
Authored: Thu Jun 22 11:31:28 2017 -0700
Committer: Kenneth Knowles <klk@google.com>
Committed: Thu Jun 22 13:58:08 2017 -0700

----------------------------------------------------------------------
 .../org/apache/beam/runners/core/WindowMatchers.java | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/beam/blob/497cfabe/runners/core-java/src/test/java/org/apache/beam/runners/core/WindowMatchers.java
----------------------------------------------------------------------
diff --git a/runners/core-java/src/test/java/org/apache/beam/runners/core/WindowMatchers.java
b/runners/core-java/src/test/java/org/apache/beam/runners/core/WindowMatchers.java
index 9769d10..26cbfee 100644
--- a/runners/core-java/src/test/java/org/apache/beam/runners/core/WindowMatchers.java
+++ b/runners/core-java/src/test/java/org/apache/beam/runners/core/WindowMatchers.java
@@ -116,6 +116,21 @@ public class WindowMatchers {
   }
 
   public static <T> Matcher<WindowedValue<? extends T>> isSingleWindowedValue(
+      Matcher<T> valueMatcher,
+      long timestamp,
+      long windowStart,
+      long windowEnd,
+      PaneInfo paneInfo) {
+    IntervalWindow intervalWindow =
+        new IntervalWindow(new Instant(windowStart), new Instant(windowEnd));
+    return WindowMatchers.<T>isSingleWindowedValue(
+        valueMatcher,
+        Matchers.describedAs("%0", Matchers.equalTo(new Instant(timestamp)), timestamp),
+        Matchers.<BoundedWindow>equalTo(intervalWindow),
+        Matchers.equalTo(paneInfo));
+  }
+
+  public static <T> Matcher<WindowedValue<? extends T>> isSingleWindowedValue(
       Matcher<? super T> valueMatcher,
       Matcher<? super Instant> timestampMatcher,
       Matcher<? super BoundedWindow> windowMatcher) {


Mime
View raw message