piotr-szuberski commented on a change in pull request #12827: URL: https://github.com/apache/beam/pull/12827#discussion_r500403269
########## File path: sdks/java/extensions/sql/src/test/java/org/apache/beam/sdk/extensions/sql/meta/provider/kafka/BeamKafkaTableTest.java ########## @@ -0,0 +1,169 @@ +/* + * 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.sdk.extensions.sql.meta.provider.kafka; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.apache.beam.sdk.extensions.sql.impl.BeamSqlEnv; +import org.apache.beam.sdk.extensions.sql.impl.BeamTableStatistics; +import org.apache.beam.sdk.extensions.sql.meta.BeamSqlTable; +import org.apache.beam.sdk.schemas.Schema; +import org.apache.beam.sdk.testing.PAssert; +import org.apache.beam.sdk.testing.TestPipeline; +import org.apache.beam.sdk.transforms.Create; +import org.apache.beam.sdk.values.KV; +import org.apache.beam.sdk.values.PCollection; +import org.apache.beam.sdk.values.Row; +import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableList; +import org.junit.Assert; +import org.junit.Rule; +import org.junit.Test; + +/** Test for BeamKafkaCSVTable. */ +public abstract class BeamKafkaTableTest { + @Rule public TestPipeline pipeline = TestPipeline.create(); + + protected static final List<String> TOPICS = ImmutableList.of("topic1", "topic2"); + + private static final Map<String, BeamSqlTable> tables = new HashMap<>(); + + protected static BeamSqlEnv env = BeamSqlEnv.readOnly("test", tables); + + protected abstract KafkaTestRecord<?> createKafkaTestRecord(String key, int i, long timestamp); + + protected abstract KafkaTestTable getTestTable(int numberOfPartitions); + + protected abstract BeamKafkaTable getBeamKafkaTable(); + + protected abstract PCollection<KV<byte[], byte[]>> applyRowToBytesKV(PCollection<Row> rows); + + protected abstract List<Object> listFrom(int i); + + protected abstract Schema getSchema(); Review comment: Done. I hope they are clear enough. I suppose that a future implementer will look at the other tests as well anyway. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
