@Test @SuppressWarnings("unchecked") public void testAllowNoRules() { useAllowedExecutionContext(); CommandResult<RuleViolation> result = tested.allow(graphCommandExecutionContext); assertEquals(CommandResult.Type.INFO, result.getType()); verify(ruleManager, times(0)).evaluate(any(RuleSet.class), any(RuleEvaluationContext.class)); }
@Override public CommandResult<RuleViolation> allow(final GraphCommandExecutionContext context) { getMutableIndex(context).addEdge(edge); final CommandResult<RuleViolation> results = super.allow(context); if (CommandUtils.isError(results)) { getMutableIndex(context).removeEdge(edge); } return results; }
AddConnectorCommand extends AbstractGraphCompositeCommand { @Override public CommandResult<RuleViolation> allow(final GraphCommandExecutionContext context) { getMutableIndex(context).addEdge(edge); final CommandResult<RuleViolation> results = super.allow(context); if (CommandUtils.isError(results)) { getMutableIndex(context).removeEdge(edge); } return results; } }
AddConnectorCommand extends AbstractGraphCompositeCommand { @Override public CommandResult<RuleViolation> allow(final GraphCommandExecutionContext context) { getMutableIndex(context).addEdge(edge); final CommandResult<RuleViolation> results = super.allow(context); if (CommandUtils.isError(results)) { getMutableIndex(context).removeEdge(edge); } return results; } AddConnectorCommand(final @MapsTo("nodeUUID") String nodeUUID,
                               final @MapsTo("edge") Edge edge,
                               final @MapsTo("magnet") Connection connection);  AddConnectorCommand(final Node<?, Edge> sourceNode,
                               final Edge edge,
                               final Connection connection); }
AddConnectorCommand extends AbstractGraphCompositeCommand { @Override public CommandResult<RuleViolation> allow(final GraphCommandExecutionContext context) { getMutableIndex(context).addEdge(edge); final CommandResult<RuleViolation> results = super.allow(context); if (CommandUtils.isError(results)) { getMutableIndex(context).removeEdge(edge); } return results; } AddConnectorCommand(final @MapsTo("nodeUUID") String nodeUUID,
                               final @MapsTo("edge") Edge edge,
                               final @MapsTo("magnet") Connection connection);  AddConnectorCommand(final Node<?, Edge> sourceNode,
                               final Edge edge,
                               final Connection connection); @Override CommandResult<RuleViolation> allow(final GraphCommandExecutionContext context); @Override @SuppressWarnings("unchecked") CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context); @Override @SuppressWarnings("unchecked") CommandResult<RuleViolation> undo(final GraphCommandExecutionContext context); Edge getEdge(); Connection getConnection(); Node<?, Edge> getSourceNode(); @Override String toString(); }
AddConnectorCommand extends AbstractGraphCompositeCommand { @Override public CommandResult<RuleViolation> allow(final GraphCommandExecutionContext context) { getMutableIndex(context).addEdge(edge); final CommandResult<RuleViolation> results = super.allow(context); if (CommandUtils.isError(results)) { getMutableIndex(context).removeEdge(edge); } return results; } AddConnectorCommand(final @MapsTo("nodeUUID") String nodeUUID,
                               final @MapsTo("edge") Edge edge,
                               final @MapsTo("magnet") Connection connection);  AddConnectorCommand(final Node<?, Edge> sourceNode,
                               final Edge edge,
                               final Connection connection); @Override CommandResult<RuleViolation> allow(final GraphCommandExecutionContext context); @Override @SuppressWarnings("unchecked") CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context); @Override @SuppressWarnings("unchecked") CommandResult<RuleViolation> undo(final GraphCommandExecutionContext context); Edge getEdge(); Connection getConnection(); Node<?, Edge> getSourceNode(); @Override String toString();  }