beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amits...@apache.org
Subject [1/2] incubator-beam git commit: Support Verifiers in TestSparkRunner
Date Sat, 10 Sep 2016 08:47:28 GMT
Repository: incubator-beam
Updated Branches:
  refs/heads/master 82ebfd487 -> 49208cadd


Support Verifiers in TestSparkRunner


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

Branch: refs/heads/master
Commit: 0f4ef88b58ea8a7851f592dc4bb42702fdde9c0a
Parents: 82ebfd4
Author: Aviem Zur <aviemzur@gmail.com>
Authored: Thu Aug 25 17:23:07 2016 +0300
Committer: Sela <ansela@paypal.com>
Committed: Sat Sep 10 11:25:28 2016 +0300

----------------------------------------------------------------------
 runners/spark/pom.xml                                    | 11 +++++++++--
 .../org/apache/beam/runners/spark/TestSparkRunner.java   |  9 ++++++++-
 2 files changed, 17 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/0f4ef88b/runners/spark/pom.xml
----------------------------------------------------------------------
diff --git a/runners/spark/pom.xml b/runners/spark/pom.xml
index b928b44..14bbd73 100644
--- a/runners/spark/pom.xml
+++ b/runners/spark/pom.xml
@@ -242,12 +242,19 @@
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
-      <scope>test</scope>
+      <scope>provided</scope>
+      <exclusions>
+        <exclusion>
+          <artifactId>hamcrest-core</artifactId>
+          <groupId>org.hamcrest</groupId>
+        </exclusion>
+      </exclusions>
     </dependency>
+
     <dependency>
       <groupId>org.hamcrest</groupId>
       <artifactId>hamcrest-all</artifactId>
-      <scope>test</scope>
+      <scope>provided</scope>
     </dependency>
 
     <!-- Depend on test jar to scan for RunnableOnService tests -->

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/0f4ef88b/runners/spark/src/main/java/org/apache/beam/runners/spark/TestSparkRunner.java
----------------------------------------------------------------------
diff --git a/runners/spark/src/main/java/org/apache/beam/runners/spark/TestSparkRunner.java
b/runners/spark/src/main/java/org/apache/beam/runners/spark/TestSparkRunner.java
index 376b80f..a1e5918 100644
--- a/runners/spark/src/main/java/org/apache/beam/runners/spark/TestSparkRunner.java
+++ b/runners/spark/src/main/java/org/apache/beam/runners/spark/TestSparkRunner.java
@@ -18,10 +18,13 @@
 
 package org.apache.beam.runners.spark;
 
+import static org.hamcrest.MatcherAssert.assertThat;
+
 import org.apache.beam.sdk.Pipeline;
 import org.apache.beam.sdk.options.PipelineOptions;
 import org.apache.beam.sdk.options.PipelineOptionsValidator;
 import org.apache.beam.sdk.runners.PipelineRunner;
+import org.apache.beam.sdk.testing.TestPipelineOptions;
 import org.apache.beam.sdk.transforms.PTransform;
 import org.apache.beam.sdk.values.PInput;
 import org.apache.beam.sdk.values.POutput;
@@ -70,6 +73,10 @@ public final class TestSparkRunner extends PipelineRunner<EvaluationResult>
{
 
   @Override
   public EvaluationResult run(Pipeline pipeline) {
-    return delegate.run(pipeline);
+    TestPipelineOptions testPipelineOptions = pipeline.getOptions().as(TestPipelineOptions.class);
+    EvaluationResult result = delegate.run(pipeline);
+    assertThat(result, testPipelineOptions.getOnCreateMatcher());
+    assertThat(result, testPipelineOptions.getOnSuccessMatcher());
+    return result;
   }
 }


Mime
View raw message