YARN-2075. Fixed the test failure of TestRMAdminCLI. Contributed by Kenji Kikushima.

svn merge --ignore-ancestry -c 1602071 ../../trunk/


git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1602073 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Zhijie Shen 2014-06-12 06:48:49 +00:00
parent b0d286dddb
commit 48520b43ff
3 changed files with 12 additions and 6 deletions

View File

@ -19,6 +19,7 @@
import java.io.IOException; import java.io.IOException;
import java.io.PrintStream; import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
import java.util.Map; import java.util.Map;
@ -68,7 +69,7 @@ public abstract class HAAdmin extends Configured implements Tool {
protected final static Map<String, UsageInfo> USAGE = protected final static Map<String, UsageInfo> USAGE =
ImmutableMap.<String, UsageInfo>builder() ImmutableMap.<String, UsageInfo>builder()
.put("-transitionToActive", .put("-transitionToActive",
new UsageInfo(" <serviceId> [--"+FORCEACTIVE+"]", "Transitions the service into Active state")) new UsageInfo("<serviceId> [--"+FORCEACTIVE+"]", "Transitions the service into Active state"))
.put("-transitionToStandby", .put("-transitionToStandby",
new UsageInfo("<serviceId>", "Transitions the service into Standby state")) new UsageInfo("<serviceId>", "Transitions the service into Standby state"))
.put("-failover", .put("-failover",
@ -104,7 +105,8 @@ protected HAAdmin(Configuration conf) {
protected abstract HAServiceTarget resolveTarget(String string); protected abstract HAServiceTarget resolveTarget(String string);
protected Collection<String> getTargetIds(String targetNodeToActivate) { protected Collection<String> getTargetIds(String targetNodeToActivate) {
return Arrays.asList(new String[]{targetNodeToActivate}); return new ArrayList<String>(
Arrays.asList(new String[]{targetNodeToActivate}));
} }
protected String getUsageString() { protected String getUsageString() {

View File

@ -221,6 +221,9 @@ Release 2.5.0 - UNRELEASED
YARN-2148. TestNMClient failed due more exit code values added and passed YARN-2148. TestNMClient failed due more exit code values added and passed
to AM (Wangda Tan via bikas) to AM (Wangda Tan via bikas)
YARN-2075. Fixed the test failure of TestRMAdminCLI. (Kenji Kikushima via
zjshen)
Release 2.4.1 - UNRELEASED Release 2.4.1 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -305,7 +305,8 @@ public void testHelp() throws Exception {
testError(new String[] { "-help", "-getGroups" }, testError(new String[] { "-help", "-getGroups" },
"Usage: yarn rmadmin [-getGroups [username]]", dataErr, 0); "Usage: yarn rmadmin [-getGroups [username]]", dataErr, 0);
testError(new String[] { "-help", "-transitionToActive" }, testError(new String[] { "-help", "-transitionToActive" },
"Usage: yarn rmadmin [-transitionToActive <serviceId>]", dataErr, 0); "Usage: yarn rmadmin [-transitionToActive <serviceId>" +
" [--forceactive]]", dataErr, 0);
testError(new String[] { "-help", "-transitionToStandby" }, testError(new String[] { "-help", "-transitionToStandby" },
"Usage: yarn rmadmin [-transitionToStandby <serviceId>]", dataErr, 0); "Usage: yarn rmadmin [-transitionToStandby <serviceId>]", dataErr, 0);
testError(new String[] { "-help", "-getServiceState" }, testError(new String[] { "-help", "-getServiceState" },
@ -332,9 +333,9 @@ public void testHelp() throws Exception {
"yarn rmadmin [-refreshQueues] [-refreshNodes] [-refreshSuper" + "yarn rmadmin [-refreshQueues] [-refreshNodes] [-refreshSuper" +
"UserGroupsConfiguration] [-refreshUserToGroupsMappings] " + "UserGroupsConfiguration] [-refreshUserToGroupsMappings] " +
"[-refreshAdminAcls] [-refreshServiceAcl] [-getGroup" + "[-refreshAdminAcls] [-refreshServiceAcl] [-getGroup" +
" [username]] [-help [cmd]] [-transitionToActive <serviceId>]" + " [username]] [-help [cmd]] [-transitionToActive <serviceId>" +
" [-transitionToStandby <serviceId>] [-failover [--forcefence]" + " [--forceactive]] [-transitionToStandby <serviceId>] [-failover" +
" [--forceactive] <serviceId> <serviceId>] " + " [--forcefence] [--forceactive] <serviceId> <serviceId>] " +
"[-getServiceState <serviceId>] [-checkHealth <serviceId>]")); "[-getServiceState <serviceId>] [-checkHealth <serviceId>]"));
} finally { } finally {
System.setOut(oldOutPrintStream); System.setOut(oldOutPrintStream);