use of alluxio.job.JobConfig in project alluxio by Alluxio.
the class JobMasterClientRestApiTest method getStatus.
@Test
public void getStatus() throws Exception {
JobConfig config = new SleepJobConfig(Constants.SECOND_MS);
final long jobId = startJob(config);
Map<String, String> params = Maps.newHashMap();
params.put("jobId", Long.toString(jobId));
TestCaseOptions options = TestCaseOptions.defaults().setPrettyPrint(true);
String result = new TestCase(mHostname, mPort, getEndpoint(ServiceConstants.GET_STATUS), params, HttpMethod.GET, null, options).call();
TypeReference<HashMap<String, Object>> typeRef = new TypeReference<HashMap<String, Object>>() {
};
HashMap<String, Object> jobInfo = new ObjectMapper().readValue(result, typeRef);
Assert.assertEquals(jobId, jobInfo.get("id"));
Assert.assertEquals(1, ((Collection) jobInfo.get("children")).size());
}
Aggregations