You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by dh...@apache.org on 2017/02/10 17:25:35 UTC
[1/3] beam-site git commit: Closes #153
Repository: beam-site
Updated Branches:
refs/heads/asf-site 0b277be13 -> 703e0bb2b
Closes #153
Project: http://git-wip-us.apache.org/repos/asf/beam-site/repo
Commit: http://git-wip-us.apache.org/repos/asf/beam-site/commit/b78d316f
Tree: http://git-wip-us.apache.org/repos/asf/beam-site/tree/b78d316f
Diff: http://git-wip-us.apache.org/repos/asf/beam-site/diff/b78d316f
Branch: refs/heads/asf-site
Commit: b78d316fe286d5d676ea705cc23f9ae2aa91daa2
Parents: 0b277be 3fd072a
Author: Dan Halperin <dh...@google.com>
Authored: Fri Feb 10 09:24:34 2017 -0800
Committer: Dan Halperin <dh...@google.com>
Committed: Fri Feb 10 09:24:34 2017 -0800
----------------------------------------------------------------------
src/documentation/pipelines/test-your-pipeline.md | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
[3/3] beam-site git commit: Regenerate website
Posted by dh...@apache.org.
Regenerate website
Project: http://git-wip-us.apache.org/repos/asf/beam-site/repo
Commit: http://git-wip-us.apache.org/repos/asf/beam-site/commit/703e0bb2
Tree: http://git-wip-us.apache.org/repos/asf/beam-site/tree/703e0bb2
Diff: http://git-wip-us.apache.org/repos/asf/beam-site/diff/703e0bb2
Branch: refs/heads/asf-site
Commit: 703e0bb2b0ecfaddf6716bd5774c4ff660788871
Parents: b78d316
Author: Dan Halperin <dh...@google.com>
Authored: Fri Feb 10 09:25:23 2017 -0800
Committer: Dan Halperin <dh...@google.com>
Committed: Fri Feb 10 09:25:23 2017 -0800
----------------------------------------------------------------------
.../pipelines/test-your-pipeline/index.html | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/beam-site/blob/703e0bb2/content/documentation/pipelines/test-your-pipeline/index.html
----------------------------------------------------------------------
diff --git a/content/documentation/pipelines/test-your-pipeline/index.html b/content/documentation/pipelines/test-your-pipeline/index.html
index a122117..cbfb489 100644
--- a/content/documentation/pipelines/test-your-pipeline/index.html
+++ b/content/documentation/pipelines/test-your-pipeline/index.html
@@ -201,7 +201,7 @@
<li>Create a <code class="highlighter-rouge">DoFnTester</code>. You\u2019ll need to pass an instance of the <code class="highlighter-rouge">DoFn</code> you want to test to the static factory method for <code class="highlighter-rouge">DoFnTester</code>.</li>
<li>Create one or more main test inputs of the appropriate type for your <code class="highlighter-rouge">DoFn</code>. If your <code class="highlighter-rouge">DoFn</code> takes side inputs and/or produces side outputs, you should also create the side inputs and the side output tags.</li>
<li>Call <code class="highlighter-rouge">DoFnTester.processBundle</code> to process the main inputs.</li>
- <li>Use JUnit\u2019s <code class="highlighter-rouge">Assert.assertThat</code> method to ensure the test outputs returned from <code class="highlighter-rouge">processBatch</code> match your expected values.</li>
+ <li>Use JUnit\u2019s <code class="highlighter-rouge">Assert.assertThat</code> method to ensure the test outputs returned from <code class="highlighter-rouge">processBundle</code> match your expected values.</li>
</ol>
<h3 id="creating-a-dofntester">Creating a DoFnTester</h3>
@@ -261,28 +261,28 @@
<h3 id="processing-test-inputs-and-checking-results">Processing Test Inputs and Checking Results</h3>
-<p>To process the inputs (and thus run the test on your <code class="highlighter-rouge">DoFn</code>), you call the method <code class="highlighter-rouge">DoFnTester.processBatch</code>. When you call <code class="highlighter-rouge">processBatch</code>, you pass one or more main test input values for your <code class="highlighter-rouge">DoFn</code>. If you set side inputs, the side inputs are available to each batch of main inputs that you provide.</p>
+<p>To process the inputs (and thus run the test on your <code class="highlighter-rouge">DoFn</code>), you call the method <code class="highlighter-rouge">DoFnTester.processBundle</code>. When you call <code class="highlighter-rouge">processBundle</code>, you pass one or more main test input values for your <code class="highlighter-rouge">DoFn</code>. If you set side inputs, the side inputs are available to each batch of main inputs that you provide.</p>
-<p><code class="highlighter-rouge">DoFnTester.processBatch</code> returns a <code class="highlighter-rouge">List</code> of outputs\u2014that is, objects of the same type as the <code class="highlighter-rouge">DoFn</code>\u2019s specified output type. For a <code class="highlighter-rouge">DoFn<String, Integer></code>, <code class="highlighter-rouge">processBatch</code> returns a <code class="highlighter-rouge">List<Integer></code>:</p>
+<p><code class="highlighter-rouge">DoFnTester.processBundle</code> returns a <code class="highlighter-rouge">List</code> of outputs\u2014that is, objects of the same type as the <code class="highlighter-rouge">DoFn</code>\u2019s specified output type. For a <code class="highlighter-rouge">DoFn<String, Integer></code>, <code class="highlighter-rouge">processBundle</code> returns a <code class="highlighter-rouge">List<Integer></code>:</p>
<div class="language-java highlighter-rouge"><pre class="highlight"><code><span class="kd">static</span> <span class="kd">class</span> <span class="nc">MyDoFn</span> <span class="kd">extends</span> <span class="n">DoFn</span><span class="o"><</span><span class="n">String</span><span class="o">,</span> <span class="n">Integer</span><span class="o">></span> <span class="o">{</span> <span class="o">...</span> <span class="o">}</span>
<span class="n">MyDoFn</span> <span class="n">myDoFn</span> <span class="o">=</span> <span class="o">...;</span>
<span class="n">DoFnTester</span><span class="o"><</span><span class="n">String</span><span class="o">,</span> <span class="n">Integer</span><span class="o">></span> <span class="n">fnTester</span> <span class="o">=</span> <span class="n">DoFnTester</span><span class="o">.</span><span class="na">of</span><span class="o">(</span><span class="n">myDoFn</span><span class="o">);</span>
<span class="n">String</span> <span class="n">testInput</span> <span class="o">=</span> <span class="s">"test1"</span><span class="o">;</span>
-<span class="n">List</span><span class="o"><</span><span class="n">Integer</span><span class="o">></span> <span class="n">testOutputs</span> <span class="o">=</span> <span class="n">fnTester</span><span class="o">.</span><span class="na">processBatch</span><span class="o">(</span><span class="n">testInput</span><span class="o">);</span>
+<span class="n">List</span><span class="o"><</span><span class="n">Integer</span><span class="o">></span> <span class="n">testOutputs</span> <span class="o">=</span> <span class="n">fnTester</span><span class="o">.</span><span class="na">processBundle</span><span class="o">(</span><span class="n">testInput</span><span class="o">);</span>
</code></pre>
</div>
-<p>To check the results of <code class="highlighter-rouge">processBatch</code>, you use JUnit\u2019s <code class="highlighter-rouge">Assert.assertThat</code> method to test if the <code class="highlighter-rouge">List</code> of outputs contains the values you expect:</p>
+<p>To check the results of <code class="highlighter-rouge">processBundle</code>, you use JUnit\u2019s <code class="highlighter-rouge">Assert.assertThat</code> method to test if the <code class="highlighter-rouge">List</code> of outputs contains the values you expect:</p>
<div class="language-java highlighter-rouge"><pre class="highlight"><code><span class="n">String</span> <span class="n">testInput</span> <span class="o">=</span> <span class="s">"test1"</span><span class="o">;</span>
-<span class="n">List</span><span class="o"><</span><span class="n">Integer</span><span class="o">></span> <span class="n">testOutputs</span> <span class="o">=</span> <span class="n">fnTester</span><span class="o">.</span><span class="na">processBatch</span><span class="o">(</span><span class="n">testInput</span><span class="o">);</span>
+<span class="n">List</span><span class="o"><</span><span class="n">Integer</span><span class="o">></span> <span class="n">testOutputs</span> <span class="o">=</span> <span class="n">fnTester</span><span class="o">.</span><span class="na">processBundle</span><span class="o">(</span><span class="n">testInput</span><span class="o">);</span>
<span class="n">Assert</span><span class="o">.</span><span class="na">assertThat</span><span class="o">(</span><span class="n">testOutputs</span><span class="o">,</span> <span class="n">Matchers</span><span class="o">.</span><span class="na">hasItems</span><span class="o">(...));</span>
<span class="c1">// Process a larger batch in a single step.</span>
-<span class="n">Assert</span><span class="o">.</span><span class="na">assertThat</span><span class="o">(</span><span class="n">fnTester</span><span class="o">.</span><span class="na">processBatch</span><span class="o">(</span><span class="s">"input1"</span><span class="o">,</span> <span class="s">"input2"</span><span class="o">,</span> <span class="s">"input3"</span><span class="o">),</span> <span class="n">Matchers</span><span class="o">.</span><span class="na">hasItems</span><span class="o">(...));</span>
+<span class="n">Assert</span><span class="o">.</span><span class="na">assertThat</span><span class="o">(</span><span class="n">fnTester</span><span class="o">.</span><span class="na">processBundle</span><span class="o">(</span><span class="s">"input1"</span><span class="o">,</span> <span class="s">"input2"</span><span class="o">,</span> <span class="s">"input3"</span><span class="o">),</span> <span class="n">Matchers</span><span class="o">.</span><span class="na">hasItems</span><span class="o">(...));</span>
</code></pre>
</div>
[2/3] beam-site git commit: processBatch() is now called
processBundle()
Posted by dh...@apache.org.
processBatch() is now called processBundle()
Project: http://git-wip-us.apache.org/repos/asf/beam-site/repo
Commit: http://git-wip-us.apache.org/repos/asf/beam-site/commit/3fd072a1
Tree: http://git-wip-us.apache.org/repos/asf/beam-site/tree/3fd072a1
Diff: http://git-wip-us.apache.org/repos/asf/beam-site/diff/3fd072a1
Branch: refs/heads/asf-site
Commit: 3fd072a1656b976b7be6b36449696c0855ad8a72
Parents: 0b277be
Author: Tobias Feldhaus <to...@localsearch.ch>
Authored: Fri Feb 10 12:32:33 2017 +0100
Committer: Dan Halperin <dh...@google.com>
Committed: Fri Feb 10 09:24:34 2017 -0800
----------------------------------------------------------------------
src/documentation/pipelines/test-your-pipeline.md | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/beam-site/blob/3fd072a1/src/documentation/pipelines/test-your-pipeline.md
----------------------------------------------------------------------
diff --git a/src/documentation/pipelines/test-your-pipeline.md b/src/documentation/pipelines/test-your-pipeline.md
index 408c810..6ce8a45 100644
--- a/src/documentation/pipelines/test-your-pipeline.md
+++ b/src/documentation/pipelines/test-your-pipeline.md
@@ -40,7 +40,7 @@ The Beam SDK for Java provides a convenient way to test an individual `DoFn` cal
1. Create a `DoFnTester`. You'll need to pass an instance of the `DoFn` you want to test to the static factory method for `DoFnTester`.
2. Create one or more main test inputs of the appropriate type for your `DoFn`. If your `DoFn` takes side inputs and/or produces side outputs, you should also create the side inputs and the side output tags.
3. Call `DoFnTester.processBundle` to process the main inputs.
-4. Use JUnit's `Assert.assertThat` method to ensure the test outputs returned from `processBatch` match your expected values.
+4. Use JUnit's `Assert.assertThat` method to ensure the test outputs returned from `processBundle` match your expected values.
### Creating a DoFnTester
@@ -99,9 +99,9 @@ See the `ParDo` documentation on [side inputs]({{ site.baseurl }}/documentation/
### Processing Test Inputs and Checking Results
-To process the inputs (and thus run the test on your `DoFn`), you call the method `DoFnTester.processBatch`. When you call `processBatch`, you pass one or more main test input values for your `DoFn`. If you set side inputs, the side inputs are available to each batch of main inputs that you provide.
+To process the inputs (and thus run the test on your `DoFn`), you call the method `DoFnTester.processBundle`. When you call `processBundle`, you pass one or more main test input values for your `DoFn`. If you set side inputs, the side inputs are available to each batch of main inputs that you provide.
-`DoFnTester.processBatch` returns a `List` of outputs\u2014that is, objects of the same type as the `DoFn`'s specified output type. For a `DoFn<String, Integer>`, `processBatch` returns a `List<Integer>`:
+`DoFnTester.processBundle` returns a `List` of outputs\u2014that is, objects of the same type as the `DoFn`'s specified output type. For a `DoFn<String, Integer>`, `processBundle` returns a `List<Integer>`:
```java
static class MyDoFn extends DoFn<String, Integer> { ... }
@@ -109,19 +109,19 @@ MyDoFn myDoFn = ...;
DoFnTester<String, Integer> fnTester = DoFnTester.of(myDoFn);
String testInput = "test1";
-List<Integer> testOutputs = fnTester.processBatch(testInput);
+List<Integer> testOutputs = fnTester.processBundle(testInput);
```
-To check the results of `processBatch`, you use JUnit's `Assert.assertThat` method to test if the `List` of outputs contains the values you expect:
+To check the results of `processBundle`, you use JUnit's `Assert.assertThat` method to test if the `List` of outputs contains the values you expect:
```java
String testInput = "test1";
-List<Integer> testOutputs = fnTester.processBatch(testInput);
+List<Integer> testOutputs = fnTester.processBundle(testInput);
Assert.assertThat(testOutputs, Matchers.hasItems(...));
// Process a larger batch in a single step.
-Assert.assertThat(fnTester.processBatch("input1", "input2", "input3"), Matchers.hasItems(...));
+Assert.assertThat(fnTester.processBundle("input1", "input2", "input3"), Matchers.hasItems(...));
```
## Testing Composite Transforms