hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jh...@apache.org
Subject [hadoop] 42/47: YARN-9397. Fix empty NMResourceInfo object test failures in branch-2
Date Tue, 19 Mar 2019 23:02:37 GMT
This is an automated email from the ASF dual-hosted git repository.

jhung pushed a commit to branch YARN-8200
in repository https://gitbox.apache.org/repos/asf/hadoop.git

commit 7d1832ddb69fb49a3f3492cab53c86cbb9ed2878
Author: Jonathan Hung <jhung@linkedin.com>
AuthorDate: Mon Mar 18 13:44:27 2019 -0700

    YARN-9397. Fix empty NMResourceInfo object test failures in branch-2
---
 .../yarn/server/nodemanager/webapp/TestNMWebServices.java      | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/webapp/TestNMWebServices.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/webapp/TestNMWebServices.java
index 2f1577f..980eae9 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/webapp/TestNMWebServices.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/test/java/org/apache/hadoop/yarn/server/nodemanager/webapp/TestNMWebServices.java
@@ -457,23 +457,23 @@ public class TestNMWebServices extends JerseyTestBase {
     assertEquals(MediaType.APPLICATION_JSON, response.getType().toString());
 
     // Access resource-2 should fail (empty NMResourceInfo returned).
-    JSONObject json = response.getEntity(JSONObject.class);
-    assertEquals(0, json.length());
+    String resp = response.getEntity(String.class);
+    assertEquals("null", resp);
 
     // Access resource-3 should fail (unknown plugin)
     response = r.path("ws").path("v1").path("node").path(
         "resources").path("resource-3").accept(MediaType.APPLICATION_JSON).get(
         ClientResponse.class);
     assertEquals(MediaType.APPLICATION_JSON, response.getType().toString());
-    json = response.getEntity(JSONObject.class);
-    assertEquals(0, json.length());
+    resp = response.getEntity(String.class);
+    assertEquals("null", resp);
 
     // Access resource-1 should success
     response = r.path("ws").path("v1").path("node").path(
         "resources").path("resource-1").accept(MediaType.APPLICATION_JSON).get(
         ClientResponse.class);
     assertEquals(MediaType.APPLICATION_JSON, response.getType().toString());
-    json = response.getEntity(JSONObject.class);
+    JSONObject json = response.getEntity(JSONObject.class);
     assertEquals(1000, Long.parseLong(json.get("a").toString()));
 
     // Access resource-1 should success (encoded yarn.io/Fresource-1).


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message