XComp commented on a change in pull request #18979:
URL: https://github.com/apache/flink/pull/18979#discussion_r822665555
##########
File path:
flink-core/src/test/java/org/apache/flink/core/fs/FileSystemBehaviorTestSuite.java
##########
@@ -97,6 +99,92 @@ public void testHomeAndWorkDir() {
assertEquals(fs.getUri().getScheme(),
fs.getWorkingDirectory().toUri().getScheme());
assertEquals(fs.getUri().getScheme(),
fs.getHomeDirectory().toUri().getScheme());
}
+ // --- exists
+
+ @Test
+ public void testFileExists() throws IOException {
+ final Path filePath = createRandomFileInDirectory(basePath);
+ assertTrue(fs.exists(filePath));
+ }
+
+ @Test
+ public void testFileDoesNotExist() throws IOException {
+ assertFalse(fs.exists(new Path(basePath, randomName())));
+ }
+
+ // --- delete
+
+ @Test
+ public void testExistingFileDeletion() throws IOException {
+ testSuccessfulDeletion(createRandomFileInDirectory(basePath), false);
+ }
+
+ @Test
+ public void testExistingFileRecursiveDeletion() throws IOException {
+ testSuccessfulDeletion(createRandomFileInDirectory(basePath), true);
+ }
+
+ @Test
+ public void testNotExistingFileDeletion() throws IOException {
+ testSuccessfulDeletion(new Path(basePath, randomName()), false);
+ }
+
+ @Test
+ public void testNotExistingFileRecursiveDeletion() throws IOException {
+ testSuccessfulDeletion(new Path(basePath, randomName()), true);
+ }
+
+ @Test
+ public void testExistingEmptyDirectoryDeletion() throws IOException {
+ final Path path = new Path(basePath, "dir-" + randomName());
+ fs.mkdirs(path);
+ testSuccessfulDeletion(path, false);
+ }
+
+ @Test
+ public void testExistingEmptyDirectoryRecursiveDeletion() throws
IOException {
+ final Path path = new Path(basePath, "dir-" + randomName());
Review comment:
no, it just helped me with understanding the paths when debugging test
failures. But I can remove it
--
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]