Skip to content

Commit

Permalink
[apache#768] feat(cli): Cli method for blacklist update
Browse files Browse the repository at this point in the history
  • Loading branch information
beryllw committed Jun 7, 2023
1 parent 3c6fc01 commit 32352c8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
9 changes: 5 additions & 4 deletions cli/src/main/java/org/apache/uniffle/cli/UniffleCLI.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,19 @@ public UniffleCLI(String shortPrefix, String longPrefix) {
true, "This is an client cli command that will print args.");
uniffleAdminCli = new Option(shortPrefix + "a", longPrefix + "admin",
true, "This is an admin command that will print args.");
refreshAccessCli = new Option(shortPrefix + "rac", longPrefix + "refreshChecker",
refreshAccessCli = new Option(shortPrefix + "rc", longPrefix + "refreshChecker",
true, "This is an admin command that will refresh access checker.");
help = new Option(shortPrefix + "h", longPrefix + "help",
false, "Help for the Uniffle CLI.");
coordServer = new Option(shortPrefix + "s", longPrefix + "server",
true, "This is coordinator server host.");
grpcPort = new Option(shortPrefix + "p", longPrefix + "port",
true, "This is coordinator server port.");
help = new Option(shortPrefix + "h", longPrefix + "help",
false, "Help for the Uniffle CLI.");
allOptions.addOption(uniffleClientCli);
allOptions.addOption(uniffleAdminCli);
allOptions.addOption(refreshAccessCli);
allOptions.addOption(coordServer);
allOptions.addOption(grpcPort);
allOptions.addOption(refreshAccessCli);
allOptions.addOption(help);
}

Expand Down Expand Up @@ -107,6 +107,7 @@ public void addRunOptions(Options baseOptions) {
baseOptions.addOption(refreshAccessCli);
baseOptions.addOption(coordServer);
baseOptions.addOption(grpcPort);
baseOptions.addOption(help);
}

@Override
Expand Down
8 changes: 4 additions & 4 deletions cli/src/test/java/org/apache/uniffle/cli/UniffleTestCLI.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ public void testHelp() throws UniffleCliArgsException, IOException {
assertEquals(0, uniffleCLI.run(args1));
oldOutPrintStream.println(dataOut);
assertTrue(dataOut.toString().contains(
"-a,--admin <arg> This is an admin command that will print args."));
"-a,--admin <arg> This is an admin command that will print args."));
assertTrue(dataOut.toString().contains(
"-c,--cli <arg> This is an client cli command that will print args."));
"-c,--cli <arg> This is an client cli command that will print args."));
assertTrue(dataOut.toString().contains(
"-h,--help Help for the Uniffle CLI."));
"-h,--help Help for the Uniffle CLI."));

System.setOut(oldOutPrintStream);
System.setErr(oldErrPrintStream);
Expand Down Expand Up @@ -93,7 +93,7 @@ public void testExampleCLI() throws UniffleCliArgsException, IOException {

@Test
public void testRefreshChecker() throws UniffleCliArgsException{
String[] args = {"-rac", "TestChecker"};
String[] args = {"-rc", "TestChecker"};
CoordinatorAdminGrpcClient grpcClient = mock(CoordinatorAdminGrpcClient.class);
when(grpcClient.refreshAccessChecker(any(String.class))).thenAnswer(new Answer<Integer>() {
@Override
Expand Down

0 comments on commit 32352c8

Please sign in to comment.