hailin0 commented on code in PR #8376:
URL: https://github.com/apache/seatunnel/pull/8376#discussion_r1897407816


##########
seatunnel-connectors-v2/connector-file/connector-file-base/src/test/java/org/apache/seatunnel/connectors/seatunnel/file/reader/ReadStrategyTest.java:
##########
@@ -0,0 +1,76 @@
+/*
+ * 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.seatunnel.connectors.seatunnel.file.reader;
+
+import org.apache.seatunnel.shade.com.typesafe.config.Config;
+import org.apache.seatunnel.shade.com.typesafe.config.ConfigFactory;
+
+import org.apache.seatunnel.connectors.seatunnel.file.config.HadoopConf;
+import 
org.apache.seatunnel.connectors.seatunnel.file.source.reader.XmlReadStrategy;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.nio.file.Paths;
+import java.util.List;
+
+import static 
org.apache.hadoop.fs.CommonConfigurationKeysPublic.FS_DEFAULT_NAME_DEFAULT;
+
+public class ReadStrategyTest {
+
+    @Test
+    public void testXmlRead() throws IOException, URISyntaxException {
+        URL xmlFile = 
XmlReadStrategyTest.class.getResource("/xml/name=xmlTest");
+        URL conf = 
XmlReadStrategyTest.class.getResource("/xml/test_grok_read_xml.conf");
+        Assertions.assertNotNull(xmlFile);
+        Assertions.assertNotNull(conf);
+        String xmlFilePath = Paths.get(xmlFile.toURI()).toString();
+        String confPath = Paths.get(conf.toURI()).toString();
+        Config pluginConfig = ConfigFactory.parseFile(new File(confPath));
+        XmlReadStrategy xmlReadStrategy = new XmlReadStrategy();
+        LocalConf localConf = new LocalConf(FS_DEFAULT_NAME_DEFAULT);
+        xmlReadStrategy.setPluginConfig(pluginConfig);
+        xmlReadStrategy.init(localConf);
+        System.out.println("test...................." + xmlFilePath);

Review Comment:
   Use log.info(...)



##########
seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/config/BaseSourceConfigOptions.java:
##########
@@ -40,6 +41,24 @@ public class BaseSourceConfigOptions {
                     .noDefaultValue()
                     .withDescription("The file path of source files");
 
+    public static final Option<FilePathRule> FILE_PATH_RULE =

Review Comment:
   add `SinkFactory#optionRule()`?



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