blob: 93f2bc8edf3481d619ec80bad086bc87bed318e5 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_181-google-v7) on Mon Jan 27 16:42:31 PST 2020 -->
<title>TestPipeline (Apache Beam 2.20.0-SNAPSHOT)</title>
<meta name="date" content="2020-01-27">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="TestPipeline (Apache Beam 2.20.0-SNAPSHOT)";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":9,"i2":10,"i3":10,"i4":9,"i5":10,"i6":10,"i7":10,"i8":10,"i9":9,"i10":10,"i11":9};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/beam/sdk/testing/SuccessOrFailure.html" title="class in org.apache.beam.sdk.testing"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../org/apache/beam/sdk/testing/TestPipeline.AbandonedNodeException.html" title="class in org.apache.beam.sdk.testing"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/beam/sdk/testing/TestPipeline.html" target="_top">Frames</a></li>
<li><a href="TestPipeline.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.beam.sdk.testing</div>
<h2 title="Class TestPipeline" class="title">Class TestPipeline</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li><a href="../../../../../org/apache/beam/sdk/Pipeline.html" title="class in org.apache.beam.sdk">org.apache.beam.sdk.Pipeline</a></li>
<li>
<ul class="inheritance">
<li>org.apache.beam.sdk.testing.TestPipeline</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="https://static.javadoc.io/junit/junit/4.13-beta-3/org/junit/rules/TestRule.html?is-external=true" title="class or interface in org.junit.rules">TestRule</a></dd>
</dl>
<hr>
<br>
<pre>public class <span class="typeNameLabel">TestPipeline</span>
extends <a href="../../../../../org/apache/beam/sdk/Pipeline.html" title="class in org.apache.beam.sdk">Pipeline</a>
implements <a href="https://static.javadoc.io/junit/junit/4.13-beta-3/org/junit/rules/TestRule.html?is-external=true" title="class or interface in org.junit.rules">TestRule</a></pre>
<div class="block">A creator of test pipelines that can be used inside of tests that can be configured to run
locally or against a remote pipeline runner.
<p>It is recommended to tag hand-selected tests for this purpose using the <a href="../../../../../org/apache/beam/sdk/testing/ValidatesRunner.html" title="interface in org.apache.beam.sdk.testing"><code>ValidatesRunner</code></a> <a href="https://static.javadoc.io/junit/junit/4.13-beta-3/org/junit/experimental/categories/Category.html?is-external=true" title="class or interface in org.junit.experimental.categories"><code>Category</code></a> annotation, as each test run against a pipeline runner will
utilize resources of that pipeline runner.
<p>In order to run tests on a pipeline runner, the following conditions must be met:
<ul>
<li>System property "beamTestPipelineOptions" must contain a JSON delimited list of pipeline
options. For example:
<pre><code> [
"--runner=TestDataflowRunner",
"--project=mygcpproject",
"--stagingLocation=gs://mygcsbucket/path"
]</code></pre>
Note that the set of pipeline options required is pipeline runner specific.
<li>Jars containing the SDK and test classes must be available on the classpath.
</ul>
<p>Use <a href="../../../../../org/apache/beam/sdk/testing/PAssert.html" title="class in org.apache.beam.sdk.testing"><code>PAssert</code></a> for tests, as it integrates with this test harness in both direct and
remote execution modes. For example:
<pre><code>
@Rule
public final transient TestPipeline p = TestPipeline.create();
@Test
@Category(NeedsRunner.class)
public void myPipelineTest() throws Exception {
final PCollection&lt;String&gt; pCollection = pipeline.apply(...)
PAssert.that(pCollection).containsInAnyOrder(...);
pipeline.run();
}
</code></pre>
<p>For pipeline runners, it is required that they must throw an <code>AssertionError</code> containing
the message from the <a href="../../../../../org/apache/beam/sdk/testing/PAssert.html" title="class in org.apache.beam.sdk.testing"><code>PAssert</code></a> that failed.
<p>See also the <a href="https://beam.apache.org/contribute/testing/">Testing</a> documentation
section.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="nested.class.summary">
<!-- -->
</a>
<h3>Nested Class Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation">
<caption><span>Nested Classes</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Class and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static class&nbsp;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/testing/TestPipeline.AbandonedNodeException.html" title="class in org.apache.beam.sdk.testing">TestPipeline.AbandonedNodeException</a></span></code>
<div class="block">An exception thrown in case an abandoned <a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html" title="class in org.apache.beam.sdk.transforms"><code>PTransform</code></a> is
detected, that is, a <a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html" title="class in org.apache.beam.sdk.transforms"><code>PTransform</code></a> that has not been run.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static class&nbsp;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/testing/TestPipeline.PipelineRunMissingException.html" title="class in org.apache.beam.sdk.testing">TestPipeline.PipelineRunMissingException</a></span></code>
<div class="block">An exception thrown in case a test finishes without invoking <a href="../../../../../org/apache/beam/sdk/Pipeline.html#run--"><code>Pipeline.run()</code></a>.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static interface&nbsp;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/testing/TestPipeline.TestValueProviderOptions.html" title="interface in org.apache.beam.sdk.testing">TestPipeline.TestValueProviderOptions</a></span></code>
<div class="block">Implementation detail of <a href="../../../../../org/apache/beam/sdk/testing/TestPipeline.html#newProvider-T-"><code>newProvider(T)</code></a>, do not use.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="nested.classes.inherited.from.class.org.apache.beam.sdk.Pipeline">
<!-- -->
</a>
<h3>Nested classes/interfaces inherited from class&nbsp;org.apache.beam.sdk.<a href="../../../../../org/apache/beam/sdk/Pipeline.html" title="class in org.apache.beam.sdk">Pipeline</a></h3>
<code><a href="../../../../../org/apache/beam/sdk/Pipeline.PipelineExecutionException.html" title="class in org.apache.beam.sdk">Pipeline.PipelineExecutionException</a>, <a href="../../../../../org/apache/beam/sdk/Pipeline.PipelineVisitor.html" title="interface in org.apache.beam.sdk">Pipeline.PipelineVisitor</a></code></li>
</ul>
</li>
</ul>
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/testing/TestPipeline.html#PROPERTY_BEAM_TEST_PIPELINE_OPTIONS">PROPERTY_BEAM_TEST_PIPELINE_OPTIONS</a></span></code>
<div class="block">System property used to set <a href="../../../../../org/apache/beam/sdk/testing/TestPipelineOptions.html" title="interface in org.apache.beam.sdk.testing"><code>TestPipelineOptions</code></a>.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code><a href="https://static.javadoc.io/junit/junit/4.13-beta-3/org/junit/runners/model/Statement.html?is-external=true" title="class or interface in org.junit.runners.model">Statement</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/testing/TestPipeline.html#apply-org.junit.runners.model.Statement-org.junit.runner.Description-">apply</a></span>(<a href="https://static.javadoc.io/junit/junit/4.13-beta-3/org/junit/runners/model/Statement.html?is-external=true" title="class or interface in org.junit.runners.model">Statement</a>&nbsp;statement,
<a href="https://static.javadoc.io/junit/junit/4.13-beta-3/org/junit/runner/Description.html?is-external=true" title="class or interface in org.junit.runner">Description</a>&nbsp;description)</code>&nbsp;</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>static <a href="../../../../../org/apache/beam/sdk/testing/TestPipeline.html" title="class in org.apache.beam.sdk.testing">TestPipeline</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/testing/TestPipeline.html#create--">create</a></span>()</code>
<div class="block">Creates and returns a new test pipeline.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/beam/sdk/testing/TestPipeline.html" title="class in org.apache.beam.sdk.testing">TestPipeline</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/testing/TestPipeline.html#enableAbandonedNodeEnforcement-boolean-">enableAbandonedNodeEnforcement</a></span>(boolean&nbsp;enable)</code>
<div class="block">Enables the abandoned node detection.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/beam/sdk/testing/TestPipeline.html" title="class in org.apache.beam.sdk.testing">TestPipeline</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/testing/TestPipeline.html#enableAutoRunIfMissing-boolean-">enableAutoRunIfMissing</a></span>(boolean&nbsp;enable)</code>
<div class="block">If enabled, a <code>pipeline.run()</code> statement will be added automatically in case it is
missing in the test.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>static <a href="../../../../../org/apache/beam/sdk/testing/TestPipeline.html" title="class in org.apache.beam.sdk.testing">TestPipeline</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/testing/TestPipeline.html#fromOptions-org.apache.beam.sdk.options.PipelineOptions-">fromOptions</a></span>(<a href="../../../../../org/apache/beam/sdk/options/PipelineOptions.html" title="interface in org.apache.beam.sdk.options">PipelineOptions</a>&nbsp;options)</code>&nbsp;</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/beam/sdk/options/PipelineOptions.html" title="interface in org.apache.beam.sdk.options">PipelineOptions</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/testing/TestPipeline.html#getOptions--">getOptions</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>&lt;T&gt;&nbsp;<a href="../../../../../org/apache/beam/sdk/options/ValueProvider.html" title="interface in org.apache.beam.sdk.options">ValueProvider</a>&lt;T&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/testing/TestPipeline.html#newProvider-T-">newProvider</a></span>(T&nbsp;runtimeValue)</code>
<div class="block">Returns a new <a href="../../../../../org/apache/beam/sdk/options/ValueProvider.html" title="interface in org.apache.beam.sdk.options"><code>ValueProvider</code></a> that is inaccessible before <a href="../../../../../org/apache/beam/sdk/testing/TestPipeline.html#run--"><code>run()</code></a>, but will be
accessible while the pipeline runs.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/beam/sdk/PipelineResult.html" title="interface in org.apache.beam.sdk">PipelineResult</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/testing/TestPipeline.html#run--">run</a></span>()</code>
<div class="block">Runs this <a href="../../../../../org/apache/beam/sdk/testing/TestPipeline.html" title="class in org.apache.beam.sdk.testing"><code>TestPipeline</code></a>, unwrapping any <code>AssertionError</code> that is raised during
testing.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/beam/sdk/PipelineResult.html" title="interface in org.apache.beam.sdk">PipelineResult</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/testing/TestPipeline.html#run-org.apache.beam.sdk.options.PipelineOptions-">run</a></span>(<a href="../../../../../org/apache/beam/sdk/options/PipelineOptions.html" title="interface in org.apache.beam.sdk.options">PipelineOptions</a>&nbsp;options)</code>
<div class="block">Like <a href="../../../../../org/apache/beam/sdk/testing/TestPipeline.html#run--"><code>run()</code></a> but with the given potentially modified options.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>static <a href="../../../../../org/apache/beam/sdk/options/PipelineOptions.html" title="interface in org.apache.beam.sdk.options">PipelineOptions</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/testing/TestPipeline.html#testingPipelineOptions--">testingPipelineOptions</a></span>()</code>
<div class="block">Creates <a href="../../../../../org/apache/beam/sdk/options/PipelineOptions.html" title="interface in org.apache.beam.sdk.options"><code>PipelineOptions</code></a> for testing.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/testing/TestPipeline.html#toString--">toString</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/testing/TestPipeline.html#verifyPAssertsSucceeded-org.apache.beam.sdk.Pipeline-org.apache.beam.sdk.PipelineResult-">verifyPAssertsSucceeded</a></span>(<a href="../../../../../org/apache/beam/sdk/Pipeline.html" title="class in org.apache.beam.sdk">Pipeline</a>&nbsp;pipeline,
<a href="../../../../../org/apache/beam/sdk/PipelineResult.html" title="interface in org.apache.beam.sdk">PipelineResult</a>&nbsp;pipelineResult)</code>
<div class="block">Verifies all {<a href="../../../../../org/apache/beam/sdk/testing/PAssert.html" title="class in org.apache.beam.sdk.testing"><code>PAsserts</code></a>} in the pipeline have been executed and were successful.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.org.apache.beam.sdk.Pipeline">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;org.apache.beam.sdk.<a href="../../../../../org/apache/beam/sdk/Pipeline.html" title="class in org.apache.beam.sdk">Pipeline</a></h3>
<code><a href="../../../../../org/apache/beam/sdk/Pipeline.html#apply-org.apache.beam.sdk.transforms.PTransform-">apply</a>, <a href="../../../../../org/apache/beam/sdk/Pipeline.html#apply-java.lang.String-org.apache.beam.sdk.transforms.PTransform-">apply</a>, <a href="../../../../../org/apache/beam/sdk/Pipeline.html#applyTransform-InputT-org.apache.beam.sdk.transforms.PTransform-">applyTransform</a>, <a href="../../../../../org/apache/beam/sdk/Pipeline.html#applyTransform-java.lang.String-InputT-org.apache.beam.sdk.transforms.PTransform-">applyTransform</a>, <a href="../../../../../org/apache/beam/sdk/Pipeline.html#begin--">begin</a>, <a href="../../../../../org/apache/beam/sdk/Pipeline.html#create-org.apache.beam.sdk.options.PipelineOptions-">create</a>, <a href="../../../../../org/apache/beam/sdk/Pipeline.html#forTransformHierarchy-org.apache.beam.sdk.runners.TransformHierarchy-org.apache.beam.sdk.options.PipelineOptions-">forTransformHierarchy</a>, <a href="../../../../../org/apache/beam/sdk/Pipeline.html#getCoderRegistry--">getCoderRegistry</a>, <a href="../../../../../org/apache/beam/sdk/Pipeline.html#getSchemaRegistry--">getSchemaRegistry</a>, <a href="../../../../../org/apache/beam/sdk/Pipeline.html#replaceAll-java.util.List-">replaceAll</a>, <a href="../../../../../org/apache/beam/sdk/Pipeline.html#setCoderRegistry-org.apache.beam.sdk.coders.CoderRegistry-">setCoderRegistry</a>, <a href="../../../../../org/apache/beam/sdk/Pipeline.html#traverseTopologically-org.apache.beam.sdk.Pipeline.PipelineVisitor-">traverseTopologically</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="PROPERTY_BEAM_TEST_PIPELINE_OPTIONS">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>PROPERTY_BEAM_TEST_PIPELINE_OPTIONS</h4>
<pre>public static final&nbsp;java.lang.String PROPERTY_BEAM_TEST_PIPELINE_OPTIONS</pre>
<div class="block">System property used to set <a href="../../../../../org/apache/beam/sdk/testing/TestPipelineOptions.html" title="interface in org.apache.beam.sdk.testing"><code>TestPipelineOptions</code></a>.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../constant-values.html#org.apache.beam.sdk.testing.TestPipeline.PROPERTY_BEAM_TEST_PIPELINE_OPTIONS">Constant Field Values</a></dd>
</dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="create--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>create</h4>
<pre>public static&nbsp;<a href="../../../../../org/apache/beam/sdk/testing/TestPipeline.html" title="class in org.apache.beam.sdk.testing">TestPipeline</a>&nbsp;create()</pre>
<div class="block">Creates and returns a new test pipeline.
<p>Use <a href="../../../../../org/apache/beam/sdk/testing/PAssert.html" title="class in org.apache.beam.sdk.testing"><code>PAssert</code></a> to add tests, then call <a href="../../../../../org/apache/beam/sdk/Pipeline.html#run--"><code>Pipeline.run()</code></a> to execute the pipeline and
check the tests.</div>
</li>
</ul>
<a name="fromOptions-org.apache.beam.sdk.options.PipelineOptions-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>fromOptions</h4>
<pre>public static&nbsp;<a href="../../../../../org/apache/beam/sdk/testing/TestPipeline.html" title="class in org.apache.beam.sdk.testing">TestPipeline</a>&nbsp;fromOptions(<a href="../../../../../org/apache/beam/sdk/options/PipelineOptions.html" title="interface in org.apache.beam.sdk.options">PipelineOptions</a>&nbsp;options)</pre>
</li>
</ul>
<a name="getOptions--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getOptions</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/beam/sdk/options/PipelineOptions.html" title="interface in org.apache.beam.sdk.options">PipelineOptions</a>&nbsp;getOptions()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="../../../../../org/apache/beam/sdk/Pipeline.html#getOptions--">getOptions</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../org/apache/beam/sdk/Pipeline.html" title="class in org.apache.beam.sdk">Pipeline</a></code></dd>
</dl>
</li>
</ul>
<a name="apply-org.junit.runners.model.Statement-org.junit.runner.Description-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>apply</h4>
<pre>public&nbsp;<a href="https://static.javadoc.io/junit/junit/4.13-beta-3/org/junit/runners/model/Statement.html?is-external=true" title="class or interface in org.junit.runners.model">Statement</a>&nbsp;apply(<a href="https://static.javadoc.io/junit/junit/4.13-beta-3/org/junit/runners/model/Statement.html?is-external=true" title="class or interface in org.junit.runners.model">Statement</a>&nbsp;statement,
<a href="https://static.javadoc.io/junit/junit/4.13-beta-3/org/junit/runner/Description.html?is-external=true" title="class or interface in org.junit.runner">Description</a>&nbsp;description)</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="https://static.javadoc.io/junit/junit/4.13-beta-3/org/junit/rules/TestRule.html?is-external=true#apply-org.junit.runners.model.Statement-org.junit.runner.Description-" title="class or interface in org.junit.rules">apply</a></code>&nbsp;in interface&nbsp;<code><a href="https://static.javadoc.io/junit/junit/4.13-beta-3/org/junit/rules/TestRule.html?is-external=true" title="class or interface in org.junit.rules">TestRule</a></code></dd>
</dl>
</li>
</ul>
<a name="run--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>run</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/beam/sdk/PipelineResult.html" title="interface in org.apache.beam.sdk">PipelineResult</a>&nbsp;run()</pre>
<div class="block">Runs this <a href="../../../../../org/apache/beam/sdk/testing/TestPipeline.html" title="class in org.apache.beam.sdk.testing"><code>TestPipeline</code></a>, unwrapping any <code>AssertionError</code> that is raised during
testing.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="../../../../../org/apache/beam/sdk/Pipeline.html#run--">run</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../org/apache/beam/sdk/Pipeline.html" title="class in org.apache.beam.sdk">Pipeline</a></code></dd>
</dl>
</li>
</ul>
<a name="run-org.apache.beam.sdk.options.PipelineOptions-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>run</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/beam/sdk/PipelineResult.html" title="interface in org.apache.beam.sdk">PipelineResult</a>&nbsp;run(<a href="../../../../../org/apache/beam/sdk/options/PipelineOptions.html" title="interface in org.apache.beam.sdk.options">PipelineOptions</a>&nbsp;options)</pre>
<div class="block">Like <a href="../../../../../org/apache/beam/sdk/testing/TestPipeline.html#run--"><code>run()</code></a> but with the given potentially modified options.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="../../../../../org/apache/beam/sdk/Pipeline.html#run-org.apache.beam.sdk.options.PipelineOptions-">run</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../org/apache/beam/sdk/Pipeline.html" title="class in org.apache.beam.sdk">Pipeline</a></code></dd>
</dl>
</li>
</ul>
<a name="newProvider-java.lang.Object-">
<!-- -->
</a><a name="newProvider-T-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>newProvider</h4>
<pre>public&nbsp;&lt;T&gt;&nbsp;<a href="../../../../../org/apache/beam/sdk/options/ValueProvider.html" title="interface in org.apache.beam.sdk.options">ValueProvider</a>&lt;T&gt;&nbsp;newProvider(T&nbsp;runtimeValue)</pre>
<div class="block">Returns a new <a href="../../../../../org/apache/beam/sdk/options/ValueProvider.html" title="interface in org.apache.beam.sdk.options"><code>ValueProvider</code></a> that is inaccessible before <a href="../../../../../org/apache/beam/sdk/testing/TestPipeline.html#run--"><code>run()</code></a>, but will be
accessible while the pipeline runs.</div>
</li>
</ul>
<a name="enableAbandonedNodeEnforcement-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>enableAbandonedNodeEnforcement</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/beam/sdk/testing/TestPipeline.html" title="class in org.apache.beam.sdk.testing">TestPipeline</a>&nbsp;enableAbandonedNodeEnforcement(boolean&nbsp;enable)</pre>
<div class="block">Enables the abandoned node detection. Abandoned nodes are <code>PTransforms</code>, <code>
PAsserts</code> included, that were not executed by the pipeline runner. Abandoned nodes are
most likely to occur due to the one of the following scenarios:
<ul>
<li>Lack of a <code>pipeline.run()</code> statement at the end of a test.
<li>Addition of PTransforms after the pipeline has already run.
</ul>
Abandoned node detection is automatically enabled when a real pipeline runner (i.e. not a
<a href="../../../../../org/apache/beam/sdk/testing/CrashingRunner.html" title="class in org.apache.beam.sdk.testing"><code>CrashingRunner</code></a>) and/or a <a href="../../../../../org/apache/beam/sdk/testing/NeedsRunner.html" title="interface in org.apache.beam.sdk.testing"><code>NeedsRunner</code></a> or a <a href="../../../../../org/apache/beam/sdk/testing/ValidatesRunner.html" title="interface in org.apache.beam.sdk.testing"><code>ValidatesRunner</code></a> annotation
are detected.</div>
</li>
</ul>
<a name="enableAutoRunIfMissing-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>enableAutoRunIfMissing</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/beam/sdk/testing/TestPipeline.html" title="class in org.apache.beam.sdk.testing">TestPipeline</a>&nbsp;enableAutoRunIfMissing(boolean&nbsp;enable)</pre>
<div class="block">If enabled, a <code>pipeline.run()</code> statement will be added automatically in case it is
missing in the test.</div>
</li>
</ul>
<a name="toString--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toString</h4>
<pre>public&nbsp;java.lang.String&nbsp;toString()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="../../../../../org/apache/beam/sdk/Pipeline.html#toString--">toString</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../org/apache/beam/sdk/Pipeline.html" title="class in org.apache.beam.sdk">Pipeline</a></code></dd>
</dl>
</li>
</ul>
<a name="testingPipelineOptions--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>testingPipelineOptions</h4>
<pre>public static&nbsp;<a href="../../../../../org/apache/beam/sdk/options/PipelineOptions.html" title="interface in org.apache.beam.sdk.options">PipelineOptions</a>&nbsp;testingPipelineOptions()</pre>
<div class="block">Creates <a href="../../../../../org/apache/beam/sdk/options/PipelineOptions.html" title="interface in org.apache.beam.sdk.options"><code>PipelineOptions</code></a> for testing.</div>
</li>
</ul>
<a name="verifyPAssertsSucceeded-org.apache.beam.sdk.Pipeline-org.apache.beam.sdk.PipelineResult-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>verifyPAssertsSucceeded</h4>
<pre>public static&nbsp;void&nbsp;verifyPAssertsSucceeded(<a href="../../../../../org/apache/beam/sdk/Pipeline.html" title="class in org.apache.beam.sdk">Pipeline</a>&nbsp;pipeline,
<a href="../../../../../org/apache/beam/sdk/PipelineResult.html" title="interface in org.apache.beam.sdk">PipelineResult</a>&nbsp;pipelineResult)</pre>
<div class="block">Verifies all {<a href="../../../../../org/apache/beam/sdk/testing/PAssert.html" title="class in org.apache.beam.sdk.testing"><code>PAsserts</code></a>} in the pipeline have been executed and were successful.
<p>Note this only runs for runners which support Metrics. Runners which do not should verify
this in some other way. See: https://issues.apache.org/jira/browse/BEAM-2001</div>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/beam/sdk/testing/SuccessOrFailure.html" title="class in org.apache.beam.sdk.testing"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../org/apache/beam/sdk/testing/TestPipeline.AbandonedNodeException.html" title="class in org.apache.beam.sdk.testing"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/beam/sdk/testing/TestPipeline.html" target="_top">Frames</a></li>
<li><a href="TestPipeline.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>