containerManager.startContainers(requestList);
// Get container statuses
GetContainerStatusesRequest statusRequest =
GetContainerStatusesRequest.newInstance(containerIds);
GetContainerStatusesResponse statusResponse =
containerManager.getContainerStatuses(statusRequest);
Assert.assertEquals(5, statusResponse.getContainerStatuses().size());
for (ContainerStatus status : statusResponse.getContainerStatuses()) {
// Containers with odd id should succeed
Assert.assertEquals(1, status.getContainerId().getId() & 1);
}
Assert.assertEquals(5, statusResponse.getFailedRequests().size());
for (Map.Entry<ContainerId, SerializedException> entry : statusResponse
.getFailedRequests().entrySet()) {
// Containers with even id should fail.
Assert.assertEquals(0, entry.getKey().getId() & 1);
Assert.assertTrue(entry.getValue().getMessage()
.contains("Reject this container"));