@Test public void testDeletePendingTask() { String taskId = "a"; expect(taskIdGenerator.generate(NON_SERVICE_CONFIG, 0)).andReturn(taskId); expectStateTransitions(taskId, INIT, PENDING); eventSink.post(matchTasksDeleted(taskId)); control.replay(); insertTask(NON_SERVICE_CONFIG, 0); changeState(taskId, KILLING); }
@Override public StateChangeResult changeState( MutableStoreProvider storeProvider, String taskId, Optional<ScheduleStatus> casState, final ScheduleStatus newState, final Optional<String> auditMessage) { return updateTaskAndExternalState( storeProvider.getUnsafeTaskStore(), casState, taskId, newState, auditMessage); }
StateManagerImpl implements StateManager { @Override public StateChangeResult changeState( MutableStoreProvider storeProvider, String taskId, Optional<ScheduleStatus> casState, final ScheduleStatus newState, final Optional<String> auditMessage) { return updateTaskAndExternalState( storeProvider.getUnsafeTaskStore(), casState, taskId, newState, auditMessage); } }
StateManagerImpl implements StateManager { @Override public StateChangeResult changeState( MutableStoreProvider storeProvider, String taskId, Optional<ScheduleStatus> casState, final ScheduleStatus newState, final Optional<String> auditMessage) { return updateTaskAndExternalState( storeProvider.getUnsafeTaskStore(), casState, taskId, newState, auditMessage); } @Inject  StateManagerImpl(
      final Clock clock,
      Driver driver,
      TaskIdGenerator taskIdGenerator,
      EventSink eventSink,
      RescheduleCalculator rescheduleCalculator); }
StateManagerImpl implements StateManager { @Override public StateChangeResult changeState( MutableStoreProvider storeProvider, String taskId, Optional<ScheduleStatus> casState, final ScheduleStatus newState, final Optional<String> auditMessage) { return updateTaskAndExternalState( storeProvider.getUnsafeTaskStore(), casState, taskId, newState, auditMessage); } @Inject  StateManagerImpl(
      final Clock clock,
      Driver driver,
      TaskIdGenerator taskIdGenerator,
      EventSink eventSink,
      RescheduleCalculator rescheduleCalculator); @Override void insertPendingTasks(
      MutableStoreProvider storeProvider,
      final ITaskConfig task,
      Set<Integer> instanceIds); @Override StateChangeResult changeState(
      MutableStoreProvider storeProvider,
      String taskId,
      Optional<ScheduleStatus> casState,
      final ScheduleStatus newState,
      final Optional<String> auditMessage); @Override IAssignedTask assignTask(
      MutableStoreProvider storeProvider,
      String taskId,
      String slaveHost,
      SlaveID slaveId,
      Map<String, Integer> assignedPorts); @Override void deleteTasks(MutableStoreProvider storeProvider, final Set<String> taskIds); }
StateManagerImpl implements StateManager { @Override public StateChangeResult changeState( MutableStoreProvider storeProvider, String taskId, Optional<ScheduleStatus> casState, final ScheduleStatus newState, final Optional<String> auditMessage) { return updateTaskAndExternalState( storeProvider.getUnsafeTaskStore(), casState, taskId, newState, auditMessage); } @Inject  StateManagerImpl(
      final Clock clock,
      Driver driver,
      TaskIdGenerator taskIdGenerator,
      EventSink eventSink,
      RescheduleCalculator rescheduleCalculator); @Override void insertPendingTasks(
      MutableStoreProvider storeProvider,
      final ITaskConfig task,
      Set<Integer> instanceIds); @Override StateChangeResult changeState(
      MutableStoreProvider storeProvider,
      String taskId,
      Optional<ScheduleStatus> casState,
      final ScheduleStatus newState,
      final Optional<String> auditMessage); @Override IAssignedTask assignTask(
      MutableStoreProvider storeProvider,
      String taskId,
      String slaveHost,
      SlaveID slaveId,
      Map<String, Integer> assignedPorts); @Override void deleteTasks(MutableStoreProvider storeProvider, final Set<String> taskIds);  }