hemantk-12 commented on code in PR #4125:
URL: https://github.com/apache/ozone/pull/4125#discussion_r1087174799
##########
hadoop-ozone/tools/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneAddress.java:
##########
@@ -47,26 +48,34 @@ public static Collection<Object[]> data() {
});
}
- private String prefix;
+ @Rule
+ public ExpectedException exception = ExpectedException.none();
+
+ private final String prefix;
+ private OzoneAddress address;
public TestOzoneAddress(String prefix) {
this.prefix = prefix;
}
@Test
- public void checkUrlTypes() throws OzoneClientException, IOException {
- OzoneAddress address;
-
+ public void checkRootUrlType() throws OzoneClientException {
address = new OzoneAddress("");
Review Comment:
I still don't get to have empty string in test cases. It is unnecessary to
me. But I'll leave it because it was already there.
##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/shell/keys/ListKeyHandler.java:
##########
@@ -21,25 +21,26 @@
import java.io.IOException;
import java.util.Iterator;
+import com.google.common.base.Strings;
import org.apache.hadoop.ozone.client.OzoneBucket;
import org.apache.hadoop.ozone.client.OzoneClient;
import org.apache.hadoop.ozone.client.OzoneClientException;
import org.apache.hadoop.ozone.client.OzoneKey;
import org.apache.hadoop.ozone.client.OzoneVolume;
import org.apache.hadoop.ozone.shell.ListOptions;
import org.apache.hadoop.ozone.shell.OzoneAddress;
-import org.apache.hadoop.ozone.shell.bucket.BucketHandler;
+import org.apache.hadoop.ozone.shell.snapshot.SnapshotHandler;
import picocli.CommandLine;
import picocli.CommandLine.Command;
/**
- * Executes List Keys.
+ * Executes List Keys for a bucket or snapshot.
*/
@Command(name = "list",
aliases = "ls",
- description = "list all keys in a given bucket")
-public class ListKeyHandler extends BucketHandler {
+ description = "list all keys in a given bucket or snapshot")
+public class ListKeyHandler extends SnapshotHandler {
Review Comment:
Even tho we need to verify address, I still don't believe that it is a good
idea to have it this way if you think in term of the code structure and
hierarchy.
##########
hadoop-ozone/tools/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneAddress.java:
##########
@@ -47,26 +48,34 @@ public static Collection<Object[]> data() {
});
}
- private String prefix;
+ @Rule
+ public ExpectedException exception = ExpectedException.none();
+
+ private final String prefix;
+ private OzoneAddress address;
public TestOzoneAddress(String prefix) {
this.prefix = prefix;
}
@Test
- public void checkUrlTypes() throws OzoneClientException, IOException {
- OzoneAddress address;
-
+ public void checkRootUrlType() throws OzoneClientException {
address = new OzoneAddress("");
address.ensureRootAddress();
address = new OzoneAddress(prefix + "");
address.ensureRootAddress();
+ }
+ @Test
Review Comment:
Thanks for upgrading to Junit-5.
--
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]