Assert.assertNotNull(scheduleExecutionModified);
Assert.assertEquals(scheduleExecution, scheduleExecutionModified);
Assert.assertEquals(ScheduleExecutionStatus.INPROGRESS, scheduleExecutionModified.getStatus());
Assert.assertEquals(3, scheduleExecutionModified.getNodes().size());
ScheduleExecutionNode scheduleExecutionNode1 = scheduleExecutionModified.getNodes().get(0);
Assert.assertNotNull(scheduleExecutionNode1);
Assert.assertEquals(0, scheduleExecutionNode1.getOrderIndex());
Assert.assertEquals(clusterNode2.getAddress(), scheduleExecutionNode1.getAddress());
ScheduleExecutionNode scheduleExecutionNode2 = scheduleExecutionModified.getNodes().get(1);
Assert.assertNotNull(scheduleExecutionNode2);
Assert.assertEquals(1, scheduleExecutionNode2.getOrderIndex());
Assert.assertEquals(clusterNode3.getAddress(), scheduleExecutionNode2.getAddress());
ScheduleExecutionNode scheduleExecutionNode3 = scheduleExecutionModified.getNodes().get(2);
Assert.assertNotNull(scheduleExecutionNode3);
Assert.assertEquals(2, scheduleExecutionNode3.getOrderIndex());
Assert.assertEquals(clusterNode1.getAddress(), scheduleExecutionNode3.getAddress());
// Search all executions
List<ScheduleExecution> scheduleExecutions = scheduleExecutionManagementService.findAll(Extraction.ALL);
Assert.assertNotNull(scheduleExecutions);
Assert.assertTrue(scheduleExecutions.size() > 0);
Assert.assertTrue(Iterators.contains(scheduleExecutions.iterator(), scheduleExecution));
// Make some progress
ScheduleExecutionResult scheduleExecutionResult;
scheduleExecutionResult = scheduleExecutionManagementService.startExecutionResult(scheduleExecutionNode1.getId());
Assert.assertNotNull(scheduleExecutionResult);
scheduleExecutionResult = scheduleExecutionManagementService.finishExecutionResult(scheduleExecutionResult.getId(),
true, null);
Assert.assertNotNull(scheduleExecutionResult);
scheduleExecutionResult = scheduleExecutionManagementService.startExecutionResult(scheduleExecutionNode2.getId());
Assert.assertNotNull(scheduleExecutionResult);
scheduleExecutionResult = scheduleExecutionManagementService.finishExecutionResult(scheduleExecutionResult.getId(),
true, null);
Assert.assertNotNull(scheduleExecutionResult);
scheduleExecutionResult = scheduleExecutionManagementService.startExecutionResult(scheduleExecutionNode3.getId());
Assert.assertNotNull(scheduleExecutionResult);
scheduleExecutionResult = scheduleExecutionManagementService.finishExecutionResult(scheduleExecutionResult.getId(),
false, null);
Assert.assertNotNull(scheduleExecutionResult);