@Test public void execute() { final ScenarioSimulationContext.Status status = scenarioSimulationContextLocal.getStatus(); commandSpy.execute(scenarioSimulationContextLocal); try { verify(commandSpy, times(1)).internalExecute(eq(scenarioSimulationContextLocal)); assertNotEquals(status, commandSpy.restorableStatus); } catch (Exception e) { fail(e.getMessage()); } }
@Override public CommandResult<ScenarioSimulationViolation> execute(ScenarioSimulationContext context) { restorableStatus = context.getStatus().cloneStatus(); return super.execute(context); }
AbstractScenarioGridCommand extends AbstractScenarioSimulationCommand { @Override public CommandResult<ScenarioSimulationViolation> execute(ScenarioSimulationContext context) { restorableStatus = context.getStatus().cloneStatus(); return super.execute(context); } }
AbstractScenarioGridCommand extends AbstractScenarioSimulationCommand { @Override public CommandResult<ScenarioSimulationViolation> execute(ScenarioSimulationContext context) { restorableStatus = context.getStatus().cloneStatus(); return super.execute(context); } protected  AbstractScenarioGridCommand(final GridWidget gridWidget); protected  AbstractScenarioGridCommand(); }
AbstractScenarioGridCommand extends AbstractScenarioSimulationCommand { @Override public CommandResult<ScenarioSimulationViolation> execute(ScenarioSimulationContext context) { restorableStatus = context.getStatus().cloneStatus(); return super.execute(context); } protected  AbstractScenarioGridCommand(final GridWidget gridWidget); protected  AbstractScenarioGridCommand(); @Override CommandResult<ScenarioSimulationViolation> execute(ScenarioSimulationContext context); @Override CommandResult<ScenarioSimulationViolation> undo(ScenarioSimulationContext context); CommandResult<ScenarioSimulationViolation> redo(ScenarioSimulationContext context); Optional<CommandResult<ScenarioSimulationViolation>> commonUndoRedoPreexecution(final ScenarioSimulationContext context); }
AbstractScenarioGridCommand extends AbstractScenarioSimulationCommand { @Override public CommandResult<ScenarioSimulationViolation> execute(ScenarioSimulationContext context) { restorableStatus = context.getStatus().cloneStatus(); return super.execute(context); } protected  AbstractScenarioGridCommand(final GridWidget gridWidget); protected  AbstractScenarioGridCommand(); @Override CommandResult<ScenarioSimulationViolation> execute(ScenarioSimulationContext context); @Override CommandResult<ScenarioSimulationViolation> undo(ScenarioSimulationContext context); CommandResult<ScenarioSimulationViolation> redo(ScenarioSimulationContext context); Optional<CommandResult<ScenarioSimulationViolation>> commonUndoRedoPreexecution(final ScenarioSimulationContext context);  }