use of org.apache.hadoop.yarn.server.resourcemanager.webapp.dao.ReservationSubmissionRequestInfo in project hadoop by apache.
the class TestRMWebServicesReservation method submitAndVerifyReservation.
private ClientResponse submitAndVerifyReservation(String path, String media, String reservationJson) throws Exception {
JSONJAXBContext jc = new JSONJAXBContext(JSONConfiguration.mapped().build(), ReservationSubmissionRequestInfo.class);
JSONUnmarshaller unmarshaller = jc.createJSONUnmarshaller();
ReservationSubmissionRequestInfo rsci = unmarshaller.unmarshalFromJSON(new StringReader(reservationJson), ReservationSubmissionRequestInfo.class);
Thread.sleep(1000);
ClientResponse response = constructWebResource(path).entity(rsci, MediaType.APPLICATION_JSON).accept(media).post(ClientResponse.class);
if (!this.isAuthenticationEnabled()) {
assertResponseStatusCode(Status.UNAUTHORIZED, response.getStatusInfo());
}
return response;
}
Aggregations