ApplicationId appId = ApplicationId.newInstance(123456789, 1);
ApplicationAttemptId attemptId = ApplicationAttemptId.newInstance(appId, 1);
ContainerId containerId = ContainerId.newInstance(attemptId, 1);
Resource resource = Resource.newInstance(1000, 200);
NMContainerStatus report =
NMContainerStatus.newInstance(containerId,
ContainerState.COMPLETE, resource, "diagnostics",
ContainerExitStatus.ABORTED, Priority.newInstance(10), 1234);
NMContainerStatus reportProto =
new NMContainerStatusPBImpl(
((NMContainerStatusPBImpl) report).getProto());
Assert.assertEquals("diagnostics", reportProto.getDiagnostics());
Assert.assertEquals(resource, reportProto.getAllocatedResource());
Assert.assertEquals(ContainerExitStatus.ABORTED,
reportProto.getContainerExitStatus());
Assert.assertEquals(ContainerState.COMPLETE,
reportProto.getContainerState());
Assert.assertEquals(containerId, reportProto.getContainerId());
Assert.assertEquals(Priority.newInstance(10), reportProto.getPriority());
Assert.assertEquals(1234, reportProto.getCreationTime());
}