YARN-2158. Improved assertion messages of TestRMWebServicesAppsModification. Contributed by Varun Vasudev.

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


git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1608668 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Zhijie Shen 2014-07-08 06:09:09 +00:00
parent fd6f4f72e4
commit 077278fa9e
2 changed files with 9 additions and 3 deletions

View File

@ -340,6 +340,9 @@ Release 2.5.0 - UNRELEASED
YARN-2250. FairScheduler.findLowestCommonAncestorQueue returns null when YARN-2250. FairScheduler.findLowestCommonAncestorQueue returns null when
queues not identical (Krisztian Horvath via Sandy Ryza) queues not identical (Krisztian Horvath via Sandy Ryza)
YARN-2158. Improved assertion messages of TestRMWebServicesAppsModification.
(Varun Vasudev via zjshen)
Release 2.4.1 - 2014-06-23 Release 2.4.1 - 2014-06-23
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -411,13 +411,15 @@ public class TestRMWebServicesAppsModification extends JerseyTest {
assertEquals(MediaType.APPLICATION_JSON_TYPE, response.getType()); assertEquals(MediaType.APPLICATION_JSON_TYPE, response.getType());
JSONObject json = response.getEntity(JSONObject.class); JSONObject json = response.getEntity(JSONObject.class);
assertEquals("incorrect number of elements", 1, json.length()); assertEquals("incorrect number of elements", 1, json.length());
String responseState = json.getString("state");
boolean valid = false; boolean valid = false;
for (RMAppState state : states) { for (RMAppState state : states) {
if (state.toString().equals(json.getString("state"))) { if (state.toString().equals(responseState)) {
valid = true; valid = true;
} }
} }
assertTrue("app state incorrect", valid); String msg = "app state incorrect, got " + responseState;
assertTrue(msg, valid);
return; return;
} }
@ -441,7 +443,8 @@ public class TestRMWebServicesAppsModification extends JerseyTest {
valid = true; valid = true;
} }
} }
assertTrue("app state incorrect", valid); String msg = "app state incorrect, got " + state;
assertTrue(msg, valid);
return; return;
} }