Skip to content

Commit

Permalink
Add missed files
Browse files Browse the repository at this point in the history
  • Loading branch information
e-mhui committed Jan 13, 2025
1 parent a0f5505 commit 7136e9c
Showing 1 changed file with 5 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.TestTemplate;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.lifecycle.Startables;
import org.testcontainers.shaded.com.github.dockerjava.core.command.ExecStartResultCallback;
Expand Down Expand Up @@ -118,12 +116,12 @@ public void startUp() throws Exception {
// Windows does not support files with wildcard characters. We can rename `e2e.txt` to
// `e*e.txt` when copying to a container
ContainerUtil.copyFileIntoContainers(
"/wildcard/e2e.txt",
"/text/e2e.txt",
"/home/seatunnel/tmp/seatunnel/read/wildcard/e*e.txt",
sftpContainer);

ContainerUtil.copyFileIntoContainers(
"/wildcard/e2e.txt",
"/text/e2e.txt",
"/home/seatunnel/tmp/seatunnel/read/wildcard/e2e.txt",
sftpContainer);
sftpContainer.execInContainer("sh", "-c", "chown -R seatunnel /home/seatunnel/tmp/");
Expand Down Expand Up @@ -151,6 +149,9 @@ public void testSftpFileReadAndWrite(TestContainer container)
helper.execute("/text/sftp_file_text_projection_to_assert.conf");
// test read sftp zip text file
helper.execute("/text/sftp_file_zip_text_to_assert.conf");
// test read file wit wildcard character, should match tmp/seatunnel/read/wildcard/e*e.txt
// and tmp/seatunnel/read/wildcard/e2e.txt
helper.execute("/text/sftp_file_text_wildcard_character_to_assert.conf");
// test write sftp json file
helper.execute("/json/fake_to_sftp_file_json.conf");
// test read sftp json file
Expand Down Expand Up @@ -203,16 +204,6 @@ public void testMultipleTableAndSaveMode(TestContainer container)
Assertions.assertEquals(getFileListFromContainer(homePath + path4).size(), 2);
}

@TestTemplate
@DisabledOnOs(OS.WINDOWS)
public void testSftpFileWithWildcardRead(TestContainer container)
throws IOException, InterruptedException {
TestHelper helper = new TestHelper(container);
// test read file wit wildcard character, should match tmp/seatunnel/read/wildcard/e*e.txt
// and tmp/seatunnel/read/wildcard/e2e.txt
helper.execute("/text/sftp_file_text_wildcard_character_to_assert.conf");
}

@SneakyThrows
private List<String> getFileListFromContainer(String path) {
String command = "ls -1 " + path;
Expand Down

0 comments on commit 7136e9c

Please sign in to comment.