AutomaticJobExecutionParameters jobExecutionParameters = new AutomaticJobExecutionParameters();
jobExecutionParameters.setScheduledTime(ChronometerUtils.parseMoment("2012-02-20 10:00:00.000 UTC"));
jobExecutionParameters.setFiredTime(ChronometerUtils.parseMoment("2012-02-20 10:00:00.231 UTC"));
jobExecutionParameters.setNextFireTime(null);
ScheduleExecution scheduleExecution = scheduleJobExecutorService.executeAutomaticJob(scheduleJob.getId(),
jobExecutionParameters);
Assert.assertNotNull(scheduleExecution);
control.verify();
ScheduleExecutionNode scheduleExecutionNode;
ScheduleExecutionResult scheduleExecutionResult;
scheduleExecution = scheduleExecutionManagementService.findExecution(scheduleExecution.getId());
Assert.assertEquals(ScheduleExecutionStatus.SUCCEED, scheduleExecution.getStatus());
Assert.assertEquals(2, scheduleExecution.getNodes().size());
Assert.assertEquals(2, scheduleExecution.getResults().size());
scheduleExecutionNode = scheduleExecution.getNodes().get(0);
Assert.assertNotNull(scheduleExecutionNode);
Assert.assertEquals(clusterNode2.getAddress(), scheduleExecutionNode.getAddress());
scheduleExecutionResult = scheduleExecutionNode.getResult();
Assert.assertNotNull(scheduleExecutionResult);
Assert.assertFalse(scheduleExecutionResult.isSucceed());
scheduleExecutionNode = scheduleExecution.getNodes().get(1);
Assert.assertNotNull(scheduleExecutionNode);
Assert.assertEquals(clusterNode1.getAddress(), scheduleExecutionNode.getAddress());
scheduleExecutionResult = scheduleExecutionNode.getResult();
Assert.assertNotNull(scheduleExecutionResult);
Assert.assertTrue(scheduleExecutionResult.isSucceed());