YARN-9397. Fix empty NMResourceInfo object test failures in branch-2
This commit is contained in:
parent
86709564cb
commit
e102c3d74e
|
@ -457,23 +457,23 @@ public class TestNMWebServices extends JerseyTestBase {
|
||||||
assertEquals(MediaType.APPLICATION_JSON, response.getType().toString());
|
assertEquals(MediaType.APPLICATION_JSON, response.getType().toString());
|
||||||
|
|
||||||
// Access resource-2 should fail (empty NMResourceInfo returned).
|
// Access resource-2 should fail (empty NMResourceInfo returned).
|
||||||
JSONObject json = response.getEntity(JSONObject.class);
|
String resp = response.getEntity(String.class);
|
||||||
assertEquals(0, json.length());
|
assertEquals("null", resp);
|
||||||
|
|
||||||
// Access resource-3 should fail (unknown plugin)
|
// Access resource-3 should fail (unknown plugin)
|
||||||
response = r.path("ws").path("v1").path("node").path(
|
response = r.path("ws").path("v1").path("node").path(
|
||||||
"resources").path("resource-3").accept(MediaType.APPLICATION_JSON).get(
|
"resources").path("resource-3").accept(MediaType.APPLICATION_JSON).get(
|
||||||
ClientResponse.class);
|
ClientResponse.class);
|
||||||
assertEquals(MediaType.APPLICATION_JSON, response.getType().toString());
|
assertEquals(MediaType.APPLICATION_JSON, response.getType().toString());
|
||||||
json = response.getEntity(JSONObject.class);
|
resp = response.getEntity(String.class);
|
||||||
assertEquals(0, json.length());
|
assertEquals("null", resp);
|
||||||
|
|
||||||
// Access resource-1 should success
|
// Access resource-1 should success
|
||||||
response = r.path("ws").path("v1").path("node").path(
|
response = r.path("ws").path("v1").path("node").path(
|
||||||
"resources").path("resource-1").accept(MediaType.APPLICATION_JSON).get(
|
"resources").path("resource-1").accept(MediaType.APPLICATION_JSON).get(
|
||||||
ClientResponse.class);
|
ClientResponse.class);
|
||||||
assertEquals(MediaType.APPLICATION_JSON, response.getType().toString());
|
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()));
|
assertEquals(1000, Long.parseLong(json.get("a").toString()));
|
||||||
|
|
||||||
// Access resource-1 should success (encoded yarn.io/Fresource-1).
|
// Access resource-1 should success (encoded yarn.io/Fresource-1).
|
||||||
|
|
Loading…
Reference in New Issue