justinmclean commented on code in PR #5906:
URL: https://github.com/apache/gravitino/pull/5906#discussion_r1895079513


##########
clients/cli/src/test/java/org/apache/gravitino/cli/TestTableCommands.java:
##########
@@ -41,17 +47,45 @@
 import org.apache.gravitino.cli.commands.TableSortOrder;
 import org.apache.gravitino.cli.commands.UpdateTableComment;
 import org.apache.gravitino.cli.commands.UpdateTableName;
+import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 
 class TestTableCommands {
   private CommandLine mockCommandLine;
   private Options mockOptions;
 
+  private final ByteArrayOutputStream outContent = new ByteArrayOutputStream();
+  private final ByteArrayOutputStream errContent = new ByteArrayOutputStream();
+  private final PrintStream originalOut = System.out;
+  private final PrintStream originalErr = System.err;
+
+  private final SecurityManager securityManager =
+      new SecurityManager() {
+        public void checkPermission(Permission permission) {
+          if (permission.getName().startsWith("exitVM")) {
+            throw new RuntimeException(permission.getName());
+          }
+        }
+      };
+

Review Comment:
   There is no need to do this (and it doesn't work on all Java VMs) as there's 
a flag you can set to have Main.exit(-1) thow an exception instead.



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

Reply via email to