navinko commented on code in PR #3711:
URL: https://github.com/apache/ozone/pull/3711#discussion_r965077547


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestRootedOzoneFileSystem.java:
##########
@@ -387,6 +388,184 @@ public void testListStatus() throws Exception {
     fs.delete(parent, true);
   }
 
+  @Test
+  public void testListStatusIteratorWithDir() throws Exception {
+    Path parent = new Path(bucketPath, "testListStatus");
+    Path file1 = new Path(parent, "key1");
+    Path file2 = new Path(parent, "key2");
+
+    // Iterator should have no items when dir is empty
+    RemoteIterator<FileStatus> it = ofs.listStatusIterator(bucketPath);
+    while (it.hasNext()) {
+      Assert.assertFalse(it.hasNext());

Review Comment:
   Resolved and added testListStatusIteratorWithPathNotFound



##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestRootedOzoneFileSystem.java:
##########
@@ -387,6 +388,184 @@ public void testListStatus() throws Exception {
     fs.delete(parent, true);
   }
 
+  @Test
+  public void testListStatusIteratorWithDir() throws Exception {
+    Path parent = new Path(bucketPath, "testListStatus");
+    Path file1 = new Path(parent, "key1");
+    Path file2 = new Path(parent, "key2");
+
+    // Iterator should have no items when dir is empty
+    RemoteIterator<FileStatus> it = ofs.listStatusIterator(bucketPath);
+    while (it.hasNext()) {
+      Assert.assertFalse(it.hasNext());
+    }
+    ContractTestUtils.touch(fs, file1);
+    ContractTestUtils.touch(fs, file2);
+    // Iterator should have an item when dir is not empty
+    it = ofs.listStatusIterator(bucketPath);
+    while (it.hasNext()) {
+      FileStatus fileStatus = it.next();
+      Assert.assertNotNull(fileStatus);
+      Assert.assertEquals("Parent path doesn't match",
+              fileStatus.getPath().toUri().getPath(), parent.toString());
+    }
+    // Iterator on a directory should return all subdirs along with
+    // files, even if there exists a file and sub-dir with the same name.

Review Comment:
   removed



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to