Myracle commented on code in PR #20361:
URL: https://github.com/apache/flink/pull/20361#discussion_r937462826


##########
flink-end-to-end-tests/flink-end-to-end-tests-sql/src/test/java/org/apache/flink/table/sql/codegen/AddRemoteJarITCase.java:
##########
@@ -0,0 +1,280 @@
+/*
+ * 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.sql.codegen;
+
+import org.apache.flink.api.common.time.Deadline;
+import org.apache.flink.test.util.SQLJobSubmission;
+import org.apache.flink.tests.util.TestUtils;
+import org.apache.flink.tests.util.flink.ClusterController;
+import org.apache.flink.tests.util.flink.FlinkResource;
+import org.apache.flink.tests.util.flink.FlinkResourceSetup;
+import org.apache.flink.tests.util.flink.LocalStandaloneFlinkResourceFactory;
+import org.apache.flink.util.FileUtils;
+import org.apache.flink.util.OperatingSystem;
+import org.apache.flink.util.TestLogger;
+import org.apache.flink.util.UserClassLoaderJarTestUtils;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileUtil;
+import org.apache.hadoop.hdfs.MiniDFSCluster;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Assume;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Rule;
+import org.junit.Test;
+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.net.URL;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.time.Duration;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.Assert.assertTrue;
+
+/** ITCase for adding remote jar. */
+@RunWith(Parameterized.class)
+public class AddRemoteJarITCase extends TestLogger {
+    private static final Logger LOG = 
LoggerFactory.getLogger(AddRemoteJarITCase.class);
+
+    private static final String ADD_REMOTE_JAR_E2E_SQL = 
"add_remote_jar_e2e.sql";
+
+    private static final String EXECUTE_SQL_RESULT =
+            "{\"before\":null,\"after\":{\"id\":1,\"content\":\"hello 
world\"},\"op\":\"c\"}";
+
+    public static final String GENERATED_LOWER_UDF_CLASS = "LowerUDF";
+
+    public static final String GENERATED_LOWER_UDF_CODE =
+            "public class "
+                    + "%s"
+                    + " extends 
org.apache.flink.table.functions.ScalarFunction {\n"
+                    + "  public String eval(String str) {\n"
+                    + "    return str.toLowerCase();\n"
+                    + "  }\n"
+                    + "}\n";
+
+    @ClassRule public static TemporaryFolder tempFolder = new 
TemporaryFolder();
+
+    private static final Path hadoopClasspath = 
TestUtils.getResource(".*hadoop.classpath");
+
+    @Parameterized.Parameters(name = "executionMode")
+    public static Collection<String> data() {
+        return Arrays.asList("streaming", "batch");
+    }
+
+    @Rule
+    public final FlinkResource flink =
+            new 
LocalStandaloneFlinkResourceFactory().create(FlinkResourceSetup.builder().build());
+
+    private final String executionMode;
+    private Path result;
+
+    private MiniDFSCluster hdfsCluster;
+    private org.apache.hadoop.fs.Path hdPath;
+    private org.apache.hadoop.fs.FileSystem hdfs;
+
+    public AddRemoteJarITCase(String executionMode) {
+        this.executionMode = executionMode;
+    }
+
+    @BeforeClass
+    public static void verifyOS() {
+        Assume.assumeTrue(
+                "HDFS cluster cannot be started on Windows without 
extensions.",
+                !OperatingSystem.isWindows());
+    }
+
+    @Before
+    public void createHDFS() {
+        try {
+            Configuration hdConf = new Configuration();
+
+            File baseDir = new 
File("./target/hdfs/hdfsTest").getAbsoluteFile();

Review Comment:
   The subDir of current test is code path. I prefer to use target.



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