Package org.apache.beam.sdk.testing
@DefaultAnnotation(org.checkerframework.checker.nullness.qual.NonNull.class)
package org.apache.beam.sdk.testing
Defines utilities for unit testing Apache Beam pipelines. The tests for the
PTransform
s
and examples included in the Apache Beam SDK provide examples of using these utilities.-
ClassDescriptionProperties for use in
Coder
tests.AnElementByteSizeObserver
that records the observed element sizes for testing purposes.Utilities for testingCombineFns
.APipelineRunner
that applies no overrides and throws an exception on calls toPipeline.run()
.Matcher to verify checksum of the contents of anShardedFile
in E2E test.Category tag for tests that use aFlatten
where the inputPCollectionList
containsPCollections
heterogeneouscoders
.JsonMatcher<T>Matcher to compare a string or byte[] representing a JSON Object, independent of field order.Category tags for tests which validate that a Beam runner can handle keys up to a given size.Tests if a runner supports 100KB keys.Tests if a runner supports 100MB keys.Tests if a runner supports 10KB keys.Tests if a runner supports 10MB keys.Tests if a runner supports 1MB keys.Category tag for validation tests which utilizeTestPipeline
for execution and expect to be executed by aPipelineRunner
.An assertion on the contents of aPCollection
incorporated into the pipeline.Default transform to check that a PAssert was successful.A transform that applies an assertion-checking function over iterables ofActualT
to the entirety of the contents of its input.A transform that applies an assertion-checking function to the sole element of aPCollection
.Builder interface for assertions applicable to iterables and PCollection contents.Check that the passed-in matchers match the existing data.PAssert.OneSideInputAssert<ActualT>An assertion checker that takes a singlePCollectionView<ActualT>
and an assertion overActualT
, and checks it within a Beam pipeline.Track the place where an assertion is defined.AnPAssert.IterableAssert
about the contents of aPCollection
.An assert about the contents of eachPCollection
in the givenPCollectionList
.Builder interface for assertions applicable to a single value.Hamcrest matcher to assert a string matches a pattern.AMatcher
that is alsoSerializable
.Static class for building and usingSerializableMatcher
instances.Helper functions and test harnesses for checking correctness ofSource
implementations.Expected outcome ofBoundedSource.BoundedReader.splitAtFraction(double)
.Deprecated.Output ofPAssert
.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.An exception thrown in case an abandonedPTransform
is detected, that is, aPTransform
that has not been run.An exception thrown in case a test finishes without invokingPipeline.run()
.Implementation detail ofTestPipeline.newProvider(T)
, do not use.TestPipelineOptions
is a set of options for test pipelines.Matcher which will always pass.Factory forPipelineResult
matchers which always pass.TestStream<T>A testing input that generates an unboundedPCollection
of elements, advancing the watermark and processing time as elements are emitted.An incompleteTestStream
.ATestStream.Event
that produces elements.An event in aTestStream
.The types ofTestStream.Event
that are supported byTestStream
.ATestStream.Event
that advances the processing time clock.Coder forTestStream
.ATestStream.Event
that advances the watermark.Category tag for validation tests which utilizeMetrics
.Category tag for validation tests which utilize splittableParDo
with aDoFn.BoundedPerElement
DoFn
.Category tag for validation tests which utilizeBoundedTrie
.Category tag for validation tests which useDoFn.BundleFinalizer
.Category tag for validation tests which utilizeMetrics
.Category tag for validation tests which utilizeCounter
.Category tag for validation tests which utilize custom window merging.Category tag for validation tests which utilizeDistribution
.Category tag for tests which relies on a pre-defined port, such as expansion service or transform service.Category tag for tests which validate that currect failure message is provided by failed pipeline.Category tag for validation tests which utilizeGauge
.Category for tests that useImpulse
transformations.Category tag for tests which use the expansion service in Java.Category tag for validation tests which use key.Category tag for validation tests which utilize --tempRoot fromTestPipelineOptions
and and expect a default KMS key enable for the bucket specified.Category tag for validation tests which utilize looping timers inParDo
.Category tag for validation tests which utilizeMapState
.Category tag for validation tests which utilize the metrics pusher feature.Category tag for validation tests which utilizeMultimapState
.Category tag for validation tests which utilizeDoFn.OnWindowExpiration
.Category tag for validation tests which utilizeOrderedListState
.Category tag for the ParDoLifecycleTest for exclusion (BEAM-3241).Category tag for validation tests which rely on a runner providing per-key ordering.Category tag for validation tests which rely on a runner providing per-key ordering in between transforms in the same ProcessBundleRequest.Category tag for validation tests which utilize timers inParDo
.Category tag for tests which use the expansion service in Python.Category tag for validation tests which utilizeDoFn.RequiresTimeSortedInput
in statefulParDo
.Category tag for validation tests which utilize schemas.Category tag for tests which validate that the SDK harness executes in a well formed environment.Category tag for validation tests which utilizeSetState
.Category tag for validation tests which use sideinputs.Category tag for validation tests which use multiple side inputs with different coders.Category tag for validation tests which utilize statefulParDo
.Category for tests that enforce strict event-time ordering of fired timers, even in situations where multiple tests mutually set one another and watermark hops arbitrarily far to the future.Category tag for validation tests which utilizeStringSet
.Category tag for tests that use System metrics.Category tag for tests that useTestStream
, which is not a part of the Beam model but a special feature currently only implemented by the direct runner and the Flink Runner (streaming).Subcategory forUsesTestStream
tests which useTestStream
# across multiple stages.Category tag for validation tests which use outputTimestamp.Subcategory forUsesTestStream
tests which use the processing time feature ofTestStream
.Category tag for validation tests which use timerMap.Category tag for validation tests which utilize timers inParDo
.Category tag for validation tests which use triggered sideinputs.Category tag for validation tests which utilize at least one unboundedPCollection
.Category tag for validation tests which utilize splittableParDo
with aDoFn.UnboundedPerElement
DoFn
.Category tag for tests which validate that a Beam runner is correctly implemented.A utility class for testingWindowFn
s.
UsesUnboundedPCollections
.