}
@Test
public void testGetRoleSummary() throws Exception {
final String BAZ_ROLE = "baz_role";
final Identity BAZ_ROLE_IDENTITY = new Identity(BAZ_ROLE, USER);
JobConfiguration cronJobOne = makeJob()
.setCronSchedule("1 * * * *")
.setKey(JOB_KEY.newBuilder())
.setTaskConfig(nonProductionTask());
JobConfiguration cronJobTwo = makeJob()
.setCronSchedule("2 * * * *")
.setKey(JOB_KEY.newBuilder().setName("cronJob2"))
.setTaskConfig(nonProductionTask());
JobConfiguration cronJobThree = makeJob()
.setCronSchedule("3 * * * *")
.setKey(JOB_KEY.newBuilder().setRole(BAZ_ROLE))
.setTaskConfig(nonProductionTask())
.setOwner(BAZ_ROLE_IDENTITY);
Set<JobConfiguration> crons = ImmutableSet.of(cronJobOne, cronJobTwo, cronJobThree);
TaskConfig immediateTaskConfig = defaultTask(false)
.setJob(JOB_KEY.newBuilder().setName("immediate"))
.setJobName("immediate")
.setOwner(ROLE_IDENTITY);
IScheduledTask task1 = IScheduledTask.build(new ScheduledTask()
.setAssignedTask(new AssignedTask().setTask(immediateTaskConfig)));
IScheduledTask task2 = IScheduledTask.build(new ScheduledTask()
.setAssignedTask(new AssignedTask().setTask(immediateTaskConfig.setNumCpus(2))));
TaskConfig immediateTaskConfigTwo = defaultTask(false)
.setJob(JOB_KEY.newBuilder().setRole(BAZ_ROLE_IDENTITY.getRole()).setName("immediateTwo"))
.setJobName("immediateTwo")
.setOwner(BAZ_ROLE_IDENTITY);
IScheduledTask task3 = IScheduledTask.build(new ScheduledTask()
.setAssignedTask(new AssignedTask().setTask(immediateTaskConfigTwo)));
TaskConfig immediateTaskConfigThree = defaultTask(false)
.setJob(JOB_KEY.newBuilder().setRole(BAZ_ROLE_IDENTITY.getRole()).setName("immediateThree"))
.setJobName("immediateThree")
.setOwner(BAZ_ROLE_IDENTITY);
IScheduledTask task4 = IScheduledTask.build(new ScheduledTask()
.setAssignedTask(new AssignedTask().setTask(immediateTaskConfigThree)));