@Test public void testCheck() { tested = new AddControlPointCommand(EDGE_UUID, newControlPoint, 0); CommandResult<RuleViolation> result = tested.check(graphCommandExecutionContext); assertFalse(CommandUtils.isError(result)); tested = new AddControlPointCommand(EDGE_UUID, newControlPoint, 1); result = tested.check(graphCommandExecutionContext); assertFalse(CommandUtils.isError(result)); tested = new AddControlPointCommand(EDGE_UUID, newControlPoint, 2); result = tested.check(graphCommandExecutionContext); assertFalse(CommandUtils.isError(result)); tested = new AddControlPointCommand(EDGE_UUID, newControlPoint, 3); result = tested.check(graphCommandExecutionContext); assertFalse(CommandUtils.isError(result)); }
@Override protected CommandResult<RuleViolation> check(final GraphCommandExecutionContext context) { checkAddControlPoint(getEdgeControlPoints(context).getControlPoints(), controlPoint, index); return GraphCommandResultBuilder.SUCCESS; }
AddControlPointCommand extends AbstractControlPointCommand { @Override protected CommandResult<RuleViolation> check(final GraphCommandExecutionContext context) { checkAddControlPoint(getEdgeControlPoints(context).getControlPoints(), controlPoint, index); return GraphCommandResultBuilder.SUCCESS; } }
AddControlPointCommand extends AbstractControlPointCommand { @Override protected CommandResult<RuleViolation> check(final GraphCommandExecutionContext context) { checkAddControlPoint(getEdgeControlPoints(context).getControlPoints(), controlPoint, index); return GraphCommandResultBuilder.SUCCESS; } AddControlPointCommand(final @MapsTo("edgeUUID") String edgeUUID,
                                  final @MapsTo("controlPoint") ControlPoint controlPoint,
                                  final @MapsTo("index") int index); }
AddControlPointCommand extends AbstractControlPointCommand { @Override protected CommandResult<RuleViolation> check(final GraphCommandExecutionContext context) { checkAddControlPoint(getEdgeControlPoints(context).getControlPoints(), controlPoint, index); return GraphCommandResultBuilder.SUCCESS; } AddControlPointCommand(final @MapsTo("edgeUUID") String edgeUUID,
                                  final @MapsTo("controlPoint") ControlPoint controlPoint,
                                  final @MapsTo("index") int index); @Override CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context); @Override CommandResult<RuleViolation> undo(final GraphCommandExecutionContext context); }
AddControlPointCommand extends AbstractControlPointCommand { @Override protected CommandResult<RuleViolation> check(final GraphCommandExecutionContext context) { checkAddControlPoint(getEdgeControlPoints(context).getControlPoints(), controlPoint, index); return GraphCommandResultBuilder.SUCCESS; } AddControlPointCommand(final @MapsTo("edgeUUID") String edgeUUID,
                                  final @MapsTo("controlPoint") ControlPoint controlPoint,
                                  final @MapsTo("index") int index); @Override CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context); @Override CommandResult<RuleViolation> undo(final GraphCommandExecutionContext context);  }