@Test @SuppressWarnings("unchecked") public void testSkipRulesForSameSourceNodeAsBefore() { when(edge.getSourceNode()).thenReturn(node); CommandResult<RuleViolation> result = tested.allow(graphCommandExecutionContext); assertEquals(CommandResult.Type.INFO, result.getType()); verify(ruleManager, times(0)).evaluate(eq(ruleSet), any(RuleEvaluationContext.class)); }
@SuppressWarnings("unchecked") public Node<? extends View<?>, Edge> getSourceNode(final GraphCommandExecutionContext context) { if (null == sourceNode) { sourceNode = (Node<? extends View<?>, Edge>) getNode(context, sourceNodeUUID); } return sourceNode; }
SetConnectionSourceNodeCommand extends AbstractGraphCommand { @SuppressWarnings("unchecked") public Node<? extends View<?>, Edge> getSourceNode(final GraphCommandExecutionContext context) { if (null == sourceNode) { sourceNode = (Node<? extends View<?>, Edge>) getNode(context, sourceNodeUUID); } return sourceNode; } }
SetConnectionSourceNodeCommand extends AbstractGraphCommand { @SuppressWarnings("unchecked") public Node<? extends View<?>, Edge> getSourceNode(final GraphCommandExecutionContext context) { if (null == sourceNode) { sourceNode = (Node<? extends View<?>, Edge>) getNode(context, sourceNodeUUID); } return sourceNode; } @SuppressWarnings("unchecked")  SetConnectionSourceNodeCommand(final @MapsTo("sourceNodeUUID") String sourceNodeUUID,
                                          final @MapsTo("edgeUUID") String edgeUUID,
                                          final @MapsTo("magnet") Connection connection); @SuppressWarnings("unchecked")  SetConnectionSourceNodeCommand(final Node<? extends View<?>, Edge> sourceNode,
                                          final Edge<? extends View, Node> edge,
                                          final Connection connection); @SuppressWarnings("unchecked")  SetConnectionSourceNodeCommand(final Node<? extends View<?>, Edge> sourceNode,
                                          final Edge<? extends View, Node> edge); }
SetConnectionSourceNodeCommand extends AbstractGraphCommand { @SuppressWarnings("unchecked") public Node<? extends View<?>, Edge> getSourceNode(final GraphCommandExecutionContext context) { if (null == sourceNode) { sourceNode = (Node<? extends View<?>, Edge>) getNode(context, sourceNodeUUID); } return sourceNode; } @SuppressWarnings("unchecked")  SetConnectionSourceNodeCommand(final @MapsTo("sourceNodeUUID") String sourceNodeUUID,
                                          final @MapsTo("edgeUUID") String edgeUUID,
                                          final @MapsTo("magnet") Connection connection); @SuppressWarnings("unchecked")  SetConnectionSourceNodeCommand(final Node<? extends View<?>, Edge> sourceNode,
                                          final Edge<? extends View, Node> edge,
                                          final Connection connection); @SuppressWarnings("unchecked")  SetConnectionSourceNodeCommand(final Node<? extends View<?>, Edge> sourceNode,
                                          final Edge<? extends View, Node> edge); @Override @SuppressWarnings("unchecked") CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context); @Override @SuppressWarnings("unchecked") CommandResult<RuleViolation> undo(final GraphCommandExecutionContext context); @SuppressWarnings("unchecked") Node<? extends View<?>, Edge> getTargetNode(final GraphCommandExecutionContext context); @SuppressWarnings("unchecked") Node<? extends View<?>, Edge> getSourceNode(final GraphCommandExecutionContext context); Edge<? extends View, Node> getEdge(final GraphCommandExecutionContext context); Node<? extends View<?>, Edge> getSourceNode(); Edge<? extends View, Node> getEdge(); Node<? extends View<?>, Edge> getTargetNode(); Connection getConnection(); @Override String toString(); }
SetConnectionSourceNodeCommand extends AbstractGraphCommand { @SuppressWarnings("unchecked") public Node<? extends View<?>, Edge> getSourceNode(final GraphCommandExecutionContext context) { if (null == sourceNode) { sourceNode = (Node<? extends View<?>, Edge>) getNode(context, sourceNodeUUID); } return sourceNode; } @SuppressWarnings("unchecked")  SetConnectionSourceNodeCommand(final @MapsTo("sourceNodeUUID") String sourceNodeUUID,
                                          final @MapsTo("edgeUUID") String edgeUUID,
                                          final @MapsTo("magnet") Connection connection); @SuppressWarnings("unchecked")  SetConnectionSourceNodeCommand(final Node<? extends View<?>, Edge> sourceNode,
                                          final Edge<? extends View, Node> edge,
                                          final Connection connection); @SuppressWarnings("unchecked")  SetConnectionSourceNodeCommand(final Node<? extends View<?>, Edge> sourceNode,
                                          final Edge<? extends View, Node> edge); @Override @SuppressWarnings("unchecked") CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context); @Override @SuppressWarnings("unchecked") CommandResult<RuleViolation> undo(final GraphCommandExecutionContext context); @SuppressWarnings("unchecked") Node<? extends View<?>, Edge> getTargetNode(final GraphCommandExecutionContext context); @SuppressWarnings("unchecked") Node<? extends View<?>, Edge> getSourceNode(final GraphCommandExecutionContext context); Edge<? extends View, Node> getEdge(final GraphCommandExecutionContext context); Node<? extends View<?>, Edge> getSourceNode(); Edge<? extends View, Node> getEdge(); Node<? extends View<?>, Edge> getTargetNode(); Connection getConnection(); @Override String toString();  }