@Test public void testNoopUpdate() { TestFixture f = new TestFixture(NEW, 1); f.setActualState(NEW); f.evaluate(EVALUATE_AFTER_MIN_RUNNING_MS, RUNNING); f.advanceTime(MIN_RUNNING_TIME); f.evaluate(SUCCEEDED, RUNNING); }
@Override public synchronized StateEvaluator.Result evaluate(Optional<IScheduledTask> actualState) { boolean desiredPresent = desiredState.isPresent(); boolean actualPresent = isTaskPresent(actualState); if (desiredPresent && actualPresent) { return handleActualAndDesiredPresent(actualState.get()); } else if (desiredPresent) { return REPLACE_TASK_AND_EVALUATE_ON_STATE_CHANGE; } else if (actualPresent) { return isKillable(actualState.get().getStatus()) ? KILL_TASK_AND_EVALUATE_ON_STATE_CHANGE : EVALUATE_ON_STATE_CHANGE; } else { return SUCCEEDED; } }
InstanceUpdater implements StateEvaluator<Optional<IScheduledTask>> { @Override public synchronized StateEvaluator.Result evaluate(Optional<IScheduledTask> actualState) { boolean desiredPresent = desiredState.isPresent(); boolean actualPresent = isTaskPresent(actualState); if (desiredPresent && actualPresent) { return handleActualAndDesiredPresent(actualState.get()); } else if (desiredPresent) { return REPLACE_TASK_AND_EVALUATE_ON_STATE_CHANGE; } else if (actualPresent) { return isKillable(actualState.get().getStatus()) ? KILL_TASK_AND_EVALUATE_ON_STATE_CHANGE : EVALUATE_ON_STATE_CHANGE; } else { return SUCCEEDED; } } }
InstanceUpdater implements StateEvaluator<Optional<IScheduledTask>> { @Override public synchronized StateEvaluator.Result evaluate(Optional<IScheduledTask> actualState) { boolean desiredPresent = desiredState.isPresent(); boolean actualPresent = isTaskPresent(actualState); if (desiredPresent && actualPresent) { return handleActualAndDesiredPresent(actualState.get()); } else if (desiredPresent) { return REPLACE_TASK_AND_EVALUATE_ON_STATE_CHANGE; } else if (actualPresent) { return isKillable(actualState.get().getStatus()) ? KILL_TASK_AND_EVALUATE_ON_STATE_CHANGE : EVALUATE_ON_STATE_CHANGE; } else { return SUCCEEDED; } } InstanceUpdater(
      Optional<ITaskConfig> desiredState,
      int toleratedFailures,
      Amount<Long, Time> minRunningTime,
      Clock clock); }
InstanceUpdater implements StateEvaluator<Optional<IScheduledTask>> { @Override public synchronized StateEvaluator.Result evaluate(Optional<IScheduledTask> actualState) { boolean desiredPresent = desiredState.isPresent(); boolean actualPresent = isTaskPresent(actualState); if (desiredPresent && actualPresent) { return handleActualAndDesiredPresent(actualState.get()); } else if (desiredPresent) { return REPLACE_TASK_AND_EVALUATE_ON_STATE_CHANGE; } else if (actualPresent) { return isKillable(actualState.get().getStatus()) ? KILL_TASK_AND_EVALUATE_ON_STATE_CHANGE : EVALUATE_ON_STATE_CHANGE; } else { return SUCCEEDED; } } InstanceUpdater(
      Optional<ITaskConfig> desiredState,
      int toleratedFailures,
      Amount<Long, Time> minRunningTime,
      Clock clock); @Override synchronized StateEvaluator.Result evaluate(Optional<IScheduledTask> actualState); }
InstanceUpdater implements StateEvaluator<Optional<IScheduledTask>> { @Override public synchronized StateEvaluator.Result evaluate(Optional<IScheduledTask> actualState) { boolean desiredPresent = desiredState.isPresent(); boolean actualPresent = isTaskPresent(actualState); if (desiredPresent && actualPresent) { return handleActualAndDesiredPresent(actualState.get()); } else if (desiredPresent) { return REPLACE_TASK_AND_EVALUATE_ON_STATE_CHANGE; } else if (actualPresent) { return isKillable(actualState.get().getStatus()) ? KILL_TASK_AND_EVALUATE_ON_STATE_CHANGE : EVALUATE_ON_STATE_CHANGE; } else { return SUCCEEDED; } } InstanceUpdater(
      Optional<ITaskConfig> desiredState,
      int toleratedFailures,
      Amount<Long, Time> minRunningTime,
      Clock clock); @Override synchronized StateEvaluator.Result evaluate(Optional<IScheduledTask> actualState);  }