PatrickRen commented on a change in pull request #16590:
URL: https://github.com/apache/flink/pull/16590#discussion_r686943185



##########
File path: 
flink-end-to-end-tests/flink-end-to-end-tests-common-kafka/src/test/java/org/apache/flink/tests/util/kafka/KafkaSourceE2ECase.java
##########
@@ -0,0 +1,73 @@
+/*
+ * 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.tests.util.kafka;
+
+import 
org.apache.flink.connector.kafka.source.testutils.KafkaContainerizedExternalSystem;
+import 
org.apache.flink.connector.kafka.source.testutils.KafkaMultipleTopicExternalContext;
+import 
org.apache.flink.connector.kafka.source.testutils.KafkaSingleTopicExternalContext;
+import 
org.apache.flink.connectors.test.common.junit.annotations.WithExternalContextFactory;
+import 
org.apache.flink.connectors.test.common.junit.annotations.WithExternalSystem;
+import 
org.apache.flink.connectors.test.common.junit.annotations.WithTestEnvironment;
+import org.apache.flink.connectors.test.common.testsuites.SourceTestSuiteBase;
+import org.apache.flink.tests.util.TestUtils;
+import org.apache.flink.tests.util.flink.FlinkContainerTestEnvironment;
+
+/** Kafka E2E test based on connector testing framework. */
+public class KafkaSourceE2ECase extends SourceTestSuiteBase<String> {
+
+    // Defines TestEnvironment
+    @WithTestEnvironment public FlinkContainerTestEnvironment flink;
+
+    // Defines ExternalSystem
+    @WithExternalSystem public KafkaContainerizedExternalSystem kafka;
+
+    // Defines 2 External context Factories, so test cases will be invoked 
twice using these two
+    // kinds of external contexts.
+    @WithExternalContextFactory public KafkaSingleTopicExternalContext.Factory 
singleTopic;
+    @WithExternalContextFactory public 
KafkaMultipleTopicExternalContext.Factory multipleTopic;
+
+    /** Instantiate and preparing test resources. */
+    public KafkaSourceE2ECase() {

Review comment:
       I think constructor _should_ be the place doing test resource 
initialization. 
   
   By adding abstract method in ```SourceTestSuiteBase``` do you mean something 
like "initialize()"? I think it just has the same semantic as using the 
constructor. 




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to