xunliu commented on code in PR #5770:
URL: https://github.com/apache/gravitino/pull/5770#discussion_r1870999717


##########
clients/cli/src/test/java/org/apache/gravitino/cli/integration/test/TableFormatOutputIT.java:
##########
@@ -152,11 +154,11 @@ public void testCatalogDetailsCommand() {
     // Get the output and verify it
     String output = new String(outputStream.toByteArray(), 
StandardCharsets.UTF_8).trim();
     assertEquals(
-        "+----------+------------+-----------------+---------+\n"
-            + "| catalog  | type       | provider        | comment |\n"
-            + "+----------+------------+-----------------+---------+\n"
-            + "| postgres | RELATIONAL | jdbc-postgresql | null    |\n"
-            + "+----------+------------+-----------------+---------+",
+        "+----------+------------+-----------------+-------------------+\n"
+            + "| catalog  | type       | provider        | comment           
|\n"
+            + 
"+----------+------------+-----------------+-------------------+\n"
+            + "| postgres | RELATIONAL | jdbc-postgresql | catalog,用于测试 |\n"
+            + 
"+----------+------------+-----------------+-------------------+",

Review Comment:
   Don't modify original test case `testCatalogDetailsCommand()`
   
   Please add a new test `postgres2` case to standalone test full corner 
character
   ```
   testCatalogDetailsCommandFullCornerCharacter() {
       // Create a byte array output stream to capture the output of the command
       ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
       PrintStream originalOut = System.out;
       System.setOut(new PrintStream(outputStream));
       String[] args = {
         "catalog",
         "details",
         commandArg(GravitinoOptions.METALAKE),
         "my_metalake",
         commandArg(GravitinoOptions.NAME),
         "postgres2",
         commandArg(GravitinoOptions.OUTPUT),
         "table",
         commandArg(GravitinoOptions.URL),
         gravitinoUrl
       };
       Main.main(args);
   ...
   ```
   This way, We can test full-corner characters and half-corner characters. :-)



##########
clients/cli/src/test/java/org/apache/gravitino/cli/integration/test/TableFormatOutputIT.java:
##########
@@ -59,7 +59,9 @@ public void startUp() {
       commandArg(GravitinoOptions.PROPERTIES),
       
"jdbc-url=jdbc:postgresql://postgresql-host/mydb,jdbc-user=user,jdbc-password=password,jdbc-database=db,jdbc-driver=org.postgresql.Driver",
       commandArg(GravitinoOptions.URL),
-      gravitinoUrl
+      gravitinoUrl,
+      commandArg(GravitinoOptions.COMMENT),
+      "catalog,用于测试"

Review Comment:
   Don't modify original catalog(`postgres`), and I think we can create a new 
catalog(`postgres2`) have comments
   ```
       String[] create_catalog2_args = {
         "catalog",
         "create",
         commandArg(GravitinoOptions.METALAKE),
         "my_metalake",
         commandArg(GravitinoOptions.NAME),
         "postgres2",
         commandArg(GravitinoOptions.PROVIDER),
         "postgres2",
         commandArg(GravitinoOptions.PROPERTIES),
         
"jdbc-url=jdbc:postgresql://postgresql-host/mydb,jdbc-user=user,jdbc-password=password,jdbc-database=db,jdbc-driver=org.postgresql.Driver",
         commandArg(GravitinoOptions.URL),
         gravitinoUrl
         gravitinoUrl,
         commandArg(GravitinoOptions.COMMENT),
         "catalog,用于测试"
       };
       Main.main(create_catalog2_args);
   ```



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