From 943cefc81e74862fd47c814e00beddd1cb1593b2 Mon Sep 17 00:00:00 2001 From: Naganarasimha Date: Wed, 25 May 2016 06:27:44 +0800 Subject: [PATCH] YARN-5114. Add additional tests in TestRMWebServicesApps and rectify testInvalidAppAttempts failure in 2.8. Contributed by Bibin A Chundatt --- .../resourcemanager/webapp/TestRMWebServicesApps.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesApps.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesApps.java index 02014f18f85..5ce756b66aa 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesApps.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/TestRMWebServicesApps.java @@ -1499,7 +1499,7 @@ public class TestRMWebServicesApps extends JerseyTestBase { } @Test - public void testInvalidAppAttempts() throws JSONException, Exception { + public void testInvalidAppIdGetAttempts() throws JSONException, Exception { rm.start(); MockNM amNodeManager = rm.registerNode("127.0.0.1:1234", 2048); RMApp app = rm.submitApp(CONTAINER_MB); @@ -1508,8 +1508,7 @@ public class TestRMWebServicesApps extends JerseyTestBase { try { r.path("ws").path("v1").path("cluster").path("apps") - .path(app.getApplicationId().toString()).path("appattempts") - .path("appattempt_invalid_12_000001") + .path("application_invalid_12").path("appattempts") .accept(MediaType.APPLICATION_JSON) .get(JSONObject.class); fail("should have thrown exception on invalid appAttempt"); @@ -1525,8 +1524,8 @@ public class TestRMWebServicesApps extends JerseyTestBase { String type = exception.getString("exception"); String classname = exception.getString("javaClassName"); WebServicesTestUtils.checkStringMatch("exception message", - "java.lang.IllegalArgumentException: Invalid AppAttemptId:" - + " appattempt_invalid_12_000001", + "java.lang.IllegalArgumentException: Invalid ApplicationId:" + + " application_invalid_12", message); WebServicesTestUtils.checkStringMatch("exception type", "BadRequestException", type);