Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 7865C200BF4 for ; Fri, 6 Jan 2017 21:07:58 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 76F87160B49; Fri, 6 Jan 2017 20:07:58 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 9C1E8160B48 for ; Fri, 6 Jan 2017 21:07:57 +0100 (CET) Received: (qmail 36720 invoked by uid 500); 6 Jan 2017 20:07:56 -0000 Mailing-List: contact commits-help@beam.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@beam.apache.org Delivered-To: mailing list commits@beam.apache.org Received: (qmail 36586 invoked by uid 99); 6 Jan 2017 20:07:56 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Jan 2017 20:07:56 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 8FD6DDFC2F; Fri, 6 Jan 2017 20:07:56 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: kenn@apache.org To: commits@beam.apache.org Date: Fri, 06 Jan 2017 20:07:58 -0000 Message-Id: <2b36e79fe58a445c909e1e0615e9e945@git.apache.org> In-Reply-To: <6079ebbced174f8a86c7020f2dd4c35d@git.apache.org> References: <6079ebbced174f8a86c7020f2dd4c35d@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [3/5] beam git commit: Reduce visibility of many Dataflow runner internals archived-at: Fri, 06 Jan 2017 20:07:58 -0000 http://git-wip-us.apache.org/repos/asf/beam/blob/33907f89/runners/google-cloud-dataflow-java/src/test/java/org/apache/beam/runners/dataflow/DataflowUnboundedReadFromBoundedSourceTest.java ---------------------------------------------------------------------- diff --git a/runners/google-cloud-dataflow-java/src/test/java/org/apache/beam/runners/dataflow/DataflowUnboundedReadFromBoundedSourceTest.java b/runners/google-cloud-dataflow-java/src/test/java/org/apache/beam/runners/dataflow/DataflowUnboundedReadFromBoundedSourceTest.java new file mode 100644 index 0000000..c479332 --- /dev/null +++ b/runners/google-cloud-dataflow-java/src/test/java/org/apache/beam/runners/dataflow/DataflowUnboundedReadFromBoundedSourceTest.java @@ -0,0 +1,79 @@ +/* + * 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.dataflow; + +import static org.junit.Assert.assertEquals; + +import java.io.IOException; +import java.util.List; +import org.apache.beam.sdk.coders.Coder; +import org.apache.beam.sdk.io.BoundedSource; +import org.apache.beam.sdk.options.PipelineOptions; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +/** + * Tests for {@see DataflowUnboundedReadFromBoundedSource}. + */ +@RunWith(JUnit4.class) +public class DataflowUnboundedReadFromBoundedSourceTest { + @Test + public void testKind() { + DataflowUnboundedReadFromBoundedSource read = new + DataflowUnboundedReadFromBoundedSource<>(new NoopNamedSource()); + + assertEquals("Read(NoopNamedSource)", read.getKindString()); + } + + @Test + public void testKindAnonymousSource() { + NoopNamedSource anonSource = new NoopNamedSource() {}; + DataflowUnboundedReadFromBoundedSource read = new + DataflowUnboundedReadFromBoundedSource<>(anonSource); + + assertEquals("Read(AnonymousSource)", read.getKindString()); + } + + /** Source implementation only useful for its identity. */ + static class NoopNamedSource extends BoundedSource { + @Override + public List> splitIntoBundles(long desiredBundleSizeBytes, + PipelineOptions options) throws Exception { + return null; + } + @Override + public long getEstimatedSizeBytes(PipelineOptions options) throws Exception { + return 0; + } + @Override + public BoundedReader createReader( + PipelineOptions options) throws IOException { + return null; + } + @Override + public void validate() { + + } + @Override + public Coder getDefaultOutputCoder() { + return null; + } + } +} http://git-wip-us.apache.org/repos/asf/beam/blob/33907f89/runners/google-cloud-dataflow-java/src/test/java/org/apache/beam/runners/dataflow/internal/DataflowUnboundedReadFromBoundedSourceTest.java ---------------------------------------------------------------------- diff --git a/runners/google-cloud-dataflow-java/src/test/java/org/apache/beam/runners/dataflow/internal/DataflowUnboundedReadFromBoundedSourceTest.java b/runners/google-cloud-dataflow-java/src/test/java/org/apache/beam/runners/dataflow/internal/DataflowUnboundedReadFromBoundedSourceTest.java deleted file mode 100644 index d38428b..0000000 --- a/runners/google-cloud-dataflow-java/src/test/java/org/apache/beam/runners/dataflow/internal/DataflowUnboundedReadFromBoundedSourceTest.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * 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.dataflow.internal; - -import static org.junit.Assert.assertEquals; - -import java.io.IOException; -import java.util.List; -import org.apache.beam.sdk.coders.Coder; -import org.apache.beam.sdk.io.BoundedSource; -import org.apache.beam.sdk.options.PipelineOptions; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.JUnit4; - -/** - * Tests for {@see DataflowUnboundedReadFromBoundedSource}. - */ -@RunWith(JUnit4.class) -public class DataflowUnboundedReadFromBoundedSourceTest { - @Test - public void testKind() { - DataflowUnboundedReadFromBoundedSource read = new - DataflowUnboundedReadFromBoundedSource<>(new NoopNamedSource()); - - assertEquals("Read(NoopNamedSource)", read.getKindString()); - } - - @Test - public void testKindAnonymousSource() { - NoopNamedSource anonSource = new NoopNamedSource() {}; - DataflowUnboundedReadFromBoundedSource read = new - DataflowUnboundedReadFromBoundedSource<>(anonSource); - - assertEquals("Read(AnonymousSource)", read.getKindString()); - } - - /** Source implementation only useful for its identity. */ - static class NoopNamedSource extends BoundedSource { - @Override - public List> splitIntoBundles(long desiredBundleSizeBytes, - PipelineOptions options) throws Exception { - return null; - } - @Override - public long getEstimatedSizeBytes(PipelineOptions options) throws Exception { - return 0; - } - @Override - public BoundedReader createReader( - PipelineOptions options) throws IOException { - return null; - } - @Override - public void validate() { - - } - @Override - public Coder getDefaultOutputCoder() { - return null; - } - } -}