From 48520b43ff9f5ff5956c32c1e3f3d12b7dd0a1a7 Mon Sep 17 00:00:00 2001 From: Zhijie Shen Date: Thu, 12 Jun 2014 06:48:49 +0000 Subject: [PATCH] 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 --- .../src/main/java/org/apache/hadoop/ha/HAAdmin.java | 6 ++++-- hadoop-yarn-project/CHANGES.txt | 3 +++ .../org/apache/hadoop/yarn/client/TestRMAdminCLI.java | 9 +++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/HAAdmin.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/HAAdmin.java index 8555ad7d2c6..dfa03e896e1 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/HAAdmin.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ha/HAAdmin.java @@ -19,6 +19,7 @@ package org.apache.hadoop.ha; import java.io.IOException; import java.io.PrintStream; +import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Map; @@ -68,7 +69,7 @@ public abstract class HAAdmin extends Configured implements Tool { protected final static Map USAGE = ImmutableMap.builder() .put("-transitionToActive", - new UsageInfo(" [--"+FORCEACTIVE+"]", "Transitions the service into Active state")) + new UsageInfo(" [--"+FORCEACTIVE+"]", "Transitions the service into Active state")) .put("-transitionToStandby", new UsageInfo("", "Transitions the service into Standby state")) .put("-failover", @@ -104,7 +105,8 @@ public abstract class HAAdmin extends Configured implements Tool { protected abstract HAServiceTarget resolveTarget(String string); protected Collection getTargetIds(String targetNodeToActivate) { - return Arrays.asList(new String[]{targetNodeToActivate}); + return new ArrayList( + Arrays.asList(new String[]{targetNodeToActivate})); } protected String getUsageString() { diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index b473abaf494..33c3ed73323 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -221,6 +221,9 @@ Release 2.5.0 - UNRELEASED YARN-2148. TestNMClient failed due more exit code values added and passed to AM (Wangda Tan via bikas) + YARN-2075. Fixed the test failure of TestRMAdminCLI. (Kenji Kikushima via + zjshen) + Release 2.4.1 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMAdminCLI.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMAdminCLI.java index f4ef0aa6ad2..419b9ae4869 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMAdminCLI.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMAdminCLI.java @@ -305,7 +305,8 @@ public class TestRMAdminCLI { testError(new String[] { "-help", "-getGroups" }, "Usage: yarn rmadmin [-getGroups [username]]", dataErr, 0); testError(new String[] { "-help", "-transitionToActive" }, - "Usage: yarn rmadmin [-transitionToActive ]", dataErr, 0); + "Usage: yarn rmadmin [-transitionToActive " + + " [--forceactive]]", dataErr, 0); testError(new String[] { "-help", "-transitionToStandby" }, "Usage: yarn rmadmin [-transitionToStandby ]", dataErr, 0); testError(new String[] { "-help", "-getServiceState" }, @@ -332,9 +333,9 @@ public class TestRMAdminCLI { "yarn rmadmin [-refreshQueues] [-refreshNodes] [-refreshSuper" + "UserGroupsConfiguration] [-refreshUserToGroupsMappings] " + "[-refreshAdminAcls] [-refreshServiceAcl] [-getGroup" + - " [username]] [-help [cmd]] [-transitionToActive ]" + - " [-transitionToStandby ] [-failover [--forcefence]" + - " [--forceactive] ] " + + " [username]] [-help [cmd]] [-transitionToActive " + + " [--forceactive]] [-transitionToStandby ] [-failover" + + " [--forcefence] [--forceactive] ] " + "[-getServiceState ] [-checkHealth ]")); } finally { System.setOut(oldOutPrintStream);