[flink] add test case for Runner registration
Project: http://git-wip-us.apache.org/repos/asf/incubator-beam/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-beam/commit/cb5d6c2b Tree: http://git-wip-us.apache.org/repos/asf/incubator-beam/tree/cb5d6c2b Diff: http://git-wip-us.apache.org/repos/asf/incubator-beam/diff/cb5d6c2b Branch: refs/heads/master Commit: cb5d6c2bf577c0889adc28c06475b5ec22f027da Parents: e94e7d6 Author: Maximilian Michels <m...@apache.org> Authored: Mon Mar 21 11:36:35 2016 +0100 Committer: Maximilian Michels <m...@apache.org> Committed: Wed Mar 23 19:27:51 2016 +0100 ---------------------------------------------------------------------- .../runners/flink/FlinkRunnerRegistrarTest.java | 48 ++++++++++++++++++++ 1 file changed, 48 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/cb5d6c2b/runners/flink/runner/src/test/java/org/apache/beam/runners/flink/FlinkRunnerRegistrarTest.java ---------------------------------------------------------------------- diff --git a/runners/flink/runner/src/test/java/org/apache/beam/runners/flink/FlinkRunnerRegistrarTest.java b/runners/flink/runner/src/test/java/org/apache/beam/runners/flink/FlinkRunnerRegistrarTest.java new file mode 100644 index 0000000..45ca830 --- /dev/null +++ b/runners/flink/runner/src/test/java/org/apache/beam/runners/flink/FlinkRunnerRegistrarTest.java @@ -0,0 +1,48 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.beam.runners.flink; + +import com.google.cloud.dataflow.sdk.options.PipelineOptions; +import com.google.cloud.dataflow.sdk.options.PipelineOptionsFactory; +import org.junit.Test; + +import static org.junit.Assert.assertEquals; + +/** + * Tests the proper registration of the Flink runner. + */ +public class FlinkRunnerRegistrarTest { + + @Test + public void testFullName() { + String[] args = + new String[] {String.format("--runner=%s", FlinkPipelineRunner.class.getName())}; + PipelineOptions opts = PipelineOptionsFactory.fromArgs(args).create(); + assertEquals(opts.getRunner(), FlinkPipelineRunner.class); + } + + @Test + public void testClassName() { + String[] args = + new String[] {String.format("--runner=%s", FlinkPipelineRunner.class.getSimpleName())}; + PipelineOptions opts = PipelineOptionsFactory.fromArgs(args).create(); + assertEquals(opts.getRunner(), FlinkPipelineRunner.class); + } + +}