openinx commented on a change in pull request #10236: [FLINK-14703][e2e] Port 
the Kafka SQL related tests.
URL: https://github.com/apache/flink/pull/10236#discussion_r358587289
 
 

 ##########
 File path: 
flink-end-to-end-tests/flink-end-to-end-tests-common-kafka/src/test/java/org/apache/flink/tests/util/kafka/SQLClientKafkaITCase.java
 ##########
 @@ -0,0 +1,248 @@
+/*
+ * 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.tests.util.TestUtils;
+import org.apache.flink.tests.util.categories.PreCommit;
+import org.apache.flink.tests.util.categories.TravisGroup1;
+import org.apache.flink.tests.util.flink.ClusterController;
+import org.apache.flink.tests.util.flink.FlinkResource;
+import org.apache.flink.tests.util.flink.SQLJobSubmission;
+import org.apache.flink.testutils.junit.FailsOnJava11;
+import org.apache.flink.util.FileUtils;
+import org.apache.flink.util.TestLogger;
+
+import org.apache.flink.shaded.guava18.com.google.common.base.Charsets;
+
+import org.junit.Assert;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.rules.TemporaryFolder;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.StandardOpenOption;
+import java.security.DigestInputStream;
+import java.security.MessageDigest;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import static org.apache.flink.util.StringUtils.byteToHexString;
+
+/**
+ * End-to-end test for the kafka SQL connectors.
+ */
+@RunWith(Parameterized.class)
+@Category(value = {TravisGroup1.class, PreCommit.class, FailsOnJava11.class})
+public class SQLClientKafkaITCase extends TestLogger {
+
+       private static final Logger LOG = 
LoggerFactory.getLogger(SQLClientKafkaITCase.class);
+
+       private static final String KAFKA_JSON_SOURCE_SCHEMA_YAML = 
"kafka_json_source_schema.yaml";
+
+       @Parameterized.Parameters(name = "{index}: kafka-version:{1} 
kafka-sql-version:{2} kafka-sql-jar-version:{3}")
+       public static Collection<Object[]> data() {
+               return Arrays.asList(new Object[][]{
+                       {"0.10.2.0", "0.10", "kafka-0.10"},
+                       {"0.11.0.2", "0.11", "kafka-0.11"},
+                       {"2.2.0", "universal", "kafka_"}
+               });
+       }
+
+       @Rule
+       public final FlinkResource flink;
+
+       @Rule
+       public final KafkaResource kafka;
+
+       @Rule
+       public final TemporaryFolder tmp = new TemporaryFolder();
+
+       private final String kafkaSQLVersion;
+       private final Path result;
+       private final Path sqlClientSessionConf;
+
+       private final Path sqlAvroJar;
+
+       private final Path sqlJsonJar;
+       private final Path sqlToolBoxJar;
+       private final Path sqlConnectorKafkaJar;
+
+       public SQLClientKafkaITCase(String kafkaVersion, String 
kafkaSQLVersion, String kafkaSQLJarPattern) throws IOException {
+               this.flink = FlinkResource.get();
+
+               this.kafka = KafkaResource.get(kafkaVersion);
+               this.kafkaSQLVersion = kafkaSQLVersion;
+
+               tmp.create();
+               Path tmpPath = tmp.getRoot().toPath();
+               LOG.info("The current temporary path: {}", tmpPath);
+               this.sqlClientSessionConf = 
tmpPath.resolve("sql-client-session.conf");
+               this.result = tmpPath.resolve("result");
 
 Review comment:
   Sounds good, will do.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to