Class SourceTestUtils

java.lang.Object
org.apache.beam.sdk.testing.SourceTestUtils

public class SourceTestUtils extends Object
Helper functions and test harnesses for checking correctness of Source implementations.

Contains a few lightweight utilities (e.g. reading items from a source or a reader, such as readFromSource(org.apache.beam.sdk.io.BoundedSource<T>, org.apache.beam.sdk.options.PipelineOptions) and readFromUnstartedReader(org.apache.beam.sdk.io.Source.Reader<T>)), as well as heavyweight property testing and stress testing harnesses that help getting a large amount of test coverage with few code. Most notable ones are:

For example usages, see the unit tests of classes such as AvroSource or TextSource.

Like PAssert, requires JUnit and Hamcrest to be present in the classpath.