LadyForest commented on a change in pull request #20:
URL: https://github.com/apache/flink-table-store/pull/20#discussion_r809744849



##########
File path: 
flink-table-store-kafka/src/test/java/org/apache/flink/table/store/kafka/KafkaTableTestBase.java
##########
@@ -0,0 +1,232 @@
+/*
+ * 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.flink.table.store.kafka;
+
+import org.apache.flink.api.common.restartstrategy.RestartStrategies;
+import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
+import org.apache.flink.table.api.bridge.java.StreamTableEnvironment;
+import org.apache.flink.test.util.AbstractTestBase;
+import org.apache.flink.util.DockerImageVersions;
+
+import org.apache.kafka.clients.CommonClientConfigs;
+import org.apache.kafka.clients.admin.AdminClient;
+import org.apache.kafka.clients.admin.ListConsumerGroupOffsetsResult;
+import org.apache.kafka.clients.admin.NewTopic;
+import org.apache.kafka.clients.admin.TopicDescription;
+import org.apache.kafka.clients.admin.TopicListing;
+import org.apache.kafka.clients.consumer.ConsumerConfig;
+import org.apache.kafka.clients.consumer.KafkaConsumer;
+import org.apache.kafka.clients.consumer.OffsetAndMetadata;
+import org.apache.kafka.common.TopicPartition;
+import org.apache.kafka.common.serialization.StringDeserializer;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.ClassRule;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testcontainers.containers.KafkaContainer;
+import org.testcontainers.containers.Network;
+import org.testcontainers.containers.output.Slf4jLogConsumer;
+import org.testcontainers.utility.DockerImageName;
+
+import java.time.Duration;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Timer;
+import java.util.TimerTask;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.Collectors;
+
+/** Base class for Kafka Table IT Cases. */
+public abstract class KafkaTableTestBase extends AbstractTestBase {
+
+    private static final Logger LOG = 
LoggerFactory.getLogger(KafkaTableTestBase.class);
+
+    private static final String INTER_CONTAINER_KAFKA_ALIAS = "kafka";
+    private static final Network NETWORK = Network.newNetwork();
+    private static final int zkTimeoutMills = 30000;
+
+    @ClassRule
+    public static final KafkaContainer KAFKA_CONTAINER =
+            new 
KafkaContainer(DockerImageName.parse(DockerImageVersions.KAFKA)) {
+                @Override
+                protected void doStart() {
+                    super.doStart();
+                    if (LOG.isInfoEnabled()) {

Review comment:
       We're missing a test log4j.properties file to let the user manually 
enable log output.
   
   ```properties
   # Set root logger level to OFF to not flood build logs
   # set manually to INFO for debugging purposes
   rootLogger.level = INFO
   rootLogger.appenderRef.test.ref = TestLogger
   
   appender.testlogger.name = TestLogger
   appender.testlogger.type = CONSOLE
   appender.testlogger.target = SYSTEM_ERR
   appender.testlogger.layout.type = PatternLayout
   appender.testlogger.layout.pattern = %-4r [%t] %-5p %c %x - %m%n
   
   logger.kafka.name = kafka
   logger.kafka.level = OFF
   logger.kafka2.name = state.change
   logger.kafka2.level = OFF
   
   logger.zookeeper.name = org.apache.zookeeper
   logger.zookeeper.level = OFF
   logger.I0Itec.name = org.I0Itec
   logger.I0Itec.level = OFF
   
   ```




-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to