use of org.apache.beam.sdk.extensions.euphoria.core.translate.EuphoriaOptions in project beam by apache.
the class AbstractOperatorTest method execute.
/**
* Run all tests with given runner.
*
* @param tc the test case to executeSync
*/
@SuppressWarnings("unchecked")
public <T> void execute(TestCase<T> tc) {
final SingleJvmAccumulatorProvider.Factory accumulatorProvider = SingleJvmAccumulatorProvider.Factory.get();
final PipelineOptions pipelineOptions = PipelineOptionsFactory.create();
final EuphoriaOptions euphoriaOptions = pipelineOptions.as(EuphoriaOptions.class);
euphoriaOptions.setAccumulatorProviderFactory(accumulatorProvider);
final Pipeline pipeline = TestPipeline.create(pipelineOptions);
pipeline.getCoderRegistry().registerCoderForClass(Object.class, KryoCoder.of(pipelineOptions));
final PCollection<T> output = tc.getOutput(pipeline);
tc.validate(output);
pipeline.run().waitUntilFinish();
tc.validateAccumulators(accumulatorProvider);
}
Aggregations