Skip to content

Commit

Permalink
fix: revert testCatalogDetailsCommand()
Browse files Browse the repository at this point in the history
  • Loading branch information
waukin committed Dec 12, 2024
1 parent 4793258 commit 93a464c
Showing 1 changed file with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,40 @@ public void testCatalogListCommand() {
output);
}

@Test
public void testCatalogDetailsCommand() {
// 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),
"postgres",
commandArg(GravitinoOptions.OUTPUT),
"table",
commandArg(GravitinoOptions.URL),
gravitinoUrl
};
Main.main(args);

// Restore the original System.out
System.setOut(originalOut);
// 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"
+ "+----------+------------+-----------------+---------+",
output);
}

@Test
public void testCatalogDetailsCommandFullCornerCharacter() {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
Expand Down

0 comments on commit 93a464c

Please sign in to comment.