vinishjail97 commented on code in PR #659:
URL: https://github.com/apache/incubator-xtable/pull/659#discussion_r2011346585
##########
xtable-utilities/src/test/java/org/apache/xtable/utilities/TestRunSync.java:
##########
@@ -22,19 +22,62 @@
import static org.apache.xtable.model.storage.TableFormat.HUDI;
import static org.apache.xtable.model.storage.TableFormat.ICEBERG;
+import java.io.File;
import java.io.IOException;
import java.util.Map;
import org.apache.hadoop.conf.Configuration;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
-import org.apache.xtable.iceberg.IcebergCatalogConfig;
+import org.apache.xtable.conversion.CatalogConfig;
+import org.apache.xtable.utilities.RunSync.DatasetConfig;
import org.apache.xtable.utilities.RunSync.TableFormatConverters;
import
org.apache.xtable.utilities.RunSync.TableFormatConverters.ConversionConfig;
class TestRunSync {
+ @Test
+ public void testMain() {
+ String projectRoot = System.getProperty("user.dir");
+ // Construct the path to the file in the root directory
+ int lastSlashIndex = projectRoot.lastIndexOf('/');
+ String result = projectRoot.substring(0, lastSlashIndex);
+ File file = new File(result, "/my_config.yaml");
+ String filePath = file.getPath();
+ String[] args = new String[] {"--datasetConfig", filePath};
+ // RunSync.main(args);
+ Assertions.assertDoesNotThrow(
+ () -> RunSync.main(args), "RunSync.main() threw an unexpected
exception.");
+ }
+
+ @Test
+ public void testGetDatasetConfigWithNonExistentFile() {
+ String projectRoot = System.getProperty("user.dir");
+ // Construct the path to the file in the root directory
+ int lastSlashIndex = projectRoot.lastIndexOf('/');
+ String result = projectRoot.substring(0, lastSlashIndex);
+ File file = new File(result, "/my_config1.yaml");
+ String filePath = file.getPath();
+ Assertions.assertThrows(
+ IOException.class,
+ () -> {
+ RunSync.getDatasetConfig(filePath);
+ });
+ }
+
+ @Test
+ public void testGetDatasetConfigWithValidYAML() throws IOException {
+ String projectRoot = System.getProperty("user.dir");
+ // Construct the path to the file in the root directory
+ int lastSlashIndex = projectRoot.lastIndexOf('/');
+ String result = projectRoot.substring(0, lastSlashIndex);
+ File file = new File(result, "/my_config.yaml");
Review Comment:
This file doesn't exist.
--
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]