Skip to content

Commit

Permalink
add unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Joseph DellAringa committed Oct 21, 2024
1 parent 7786da3 commit 871be6e
Showing 1 changed file with 35 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1245,16 +1245,49 @@ public void testBalancerCliParseWithWrongParams() {
Balancer.Cli.parse(parameters);
fail(reason + " for -source parameter");
} catch (IllegalArgumentException ignored) {
// expected

}

parameters = new String[] {"-excludeSource"};
try {
Balancer.Cli.parse(parameters);
fail(reason + " for -excludeSource parameter");
} catch (IllegalArgumentException ignored) {

}

parameters = new String[] {"-source", "testnode1", "-excludeSource", "testnode2"};
try {
Balancer.Cli.parse(parameters);
fail("IllegalArgumentException is expected when both -source and -excludeSource are specified");
} catch (IllegalArgumentException e) {

}

parameters = new String[] {"-target"};
try {
Balancer.Cli.parse(parameters);
fail(reason + " for -target parameter");
} catch (IllegalArgumentException ignored) {
// expected

}

parameters = new String[] {"-excludeTarget"};
try {
Balancer.Cli.parse(parameters);
fail(reason + " for -excludeTarget parameter");
} catch (IllegalArgumentException ignored) {

}

parameters = new String[] {"-target", "testnode1", "-excludeTarget", "testnode2"};
try {
Balancer.Cli.parse(parameters);
fail("IllegalArgumentException is expected when both -target and -excludeTarget are specified");
} catch (IllegalArgumentException e) {

}

}

@Test
Expand Down

0 comments on commit 871be6e

Please sign in to comment.