target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test @SuppressWarnings("unchecked") public void testAcceptFailed() { when(context.getParent()).thenReturn(element); when(context.getCandidate()).thenReturn(candidate); final boolean accepts = tested.accepts(RULE, context); assertFalse(accepts); } | @Override public boolean accepts(final CanDock rule, final NodeDockingContext context) { final Set<String> parentLabels = evalUtils.getLabels(context.getParent()); return dockingHandler.accepts(rule, RuleEvaluationContextBuilder.DomainContexts.docking(parentLabels, Collections.emptySet())); } | NodeDockingEvaluationHandler implements RuleEvaluationHandler<CanDock, NodeDockingContext> { @Override public boolean accepts(final CanDock rule, final NodeDockingContext context) { final Set<String> parentLabels = evalUtils.getLabels(context.getParent()); return dockingHandler.accepts(rule, RuleEvaluationContextBuilde... | NodeDockingEvaluationHandler implements RuleEvaluationHandler<CanDock, NodeDockingContext> { @Override public boolean accepts(final CanDock rule, final NodeDockingContext context) { final Set<String> parentLabels = evalUtils.getLabels(context.getParent()); return dockingHandler.accepts(rule, RuleEvaluationContextBuilde... | NodeDockingEvaluationHandler implements RuleEvaluationHandler<CanDock, NodeDockingContext> { @Override public boolean accepts(final CanDock rule, final NodeDockingContext context) { final Set<String> parentLabels = evalUtils.getLabels(context.getParent()); return dockingHandler.accepts(rule, RuleEvaluationContextBuilde... | NodeDockingEvaluationHandler implements RuleEvaluationHandler<CanDock, NodeDockingContext> { @Override public boolean accepts(final CanDock rule, final NodeDockingContext context) { final Set<String> parentLabels = evalUtils.getLabels(context.getParent()); return dockingHandler.accepts(rule, RuleEvaluationContextBuilde... |
@Test @SuppressWarnings("unchecked") public void testEvaluateSuccess() { when(context.getCandidate()).thenReturn(candidate); final RuleViolations violations = tested.evaluate(RULE, context); assertNotNull(violations); assertFalse(violations.violations(RuleViolation.Type.ERROR).iterator().hasNext()); } | @Override public RuleViolations evaluate(final CanDock rule, final NodeDockingContext context) { final Node<? extends Definition<?>, ? extends Edge> target = context.getCandidate(); final Set<String> parentLabels = evalUtils.getLabels(context.getParent()); final Set<String> candidateLabels = evalUtils.getLabels(target)... | NodeDockingEvaluationHandler implements RuleEvaluationHandler<CanDock, NodeDockingContext> { @Override public RuleViolations evaluate(final CanDock rule, final NodeDockingContext context) { final Node<? extends Definition<?>, ? extends Edge> target = context.getCandidate(); final Set<String> parentLabels = evalUtils.ge... | NodeDockingEvaluationHandler implements RuleEvaluationHandler<CanDock, NodeDockingContext> { @Override public RuleViolations evaluate(final CanDock rule, final NodeDockingContext context) { final Node<? extends Definition<?>, ? extends Edge> target = context.getCandidate(); final Set<String> parentLabels = evalUtils.ge... | NodeDockingEvaluationHandler implements RuleEvaluationHandler<CanDock, NodeDockingContext> { @Override public RuleViolations evaluate(final CanDock rule, final NodeDockingContext context) { final Node<? extends Definition<?>, ? extends Edge> target = context.getCandidate(); final Set<String> parentLabels = evalUtils.ge... | NodeDockingEvaluationHandler implements RuleEvaluationHandler<CanDock, NodeDockingContext> { @Override public RuleViolations evaluate(final CanDock rule, final NodeDockingContext context) { final Node<? extends Definition<?>, ? extends Edge> target = context.getCandidate(); final Set<String> parentLabels = evalUtils.ge... |
@Test @SuppressWarnings("unchecked") public void testEvaluateFailed() { when(context.getCandidate()).thenReturn(candidate); final RuleViolations violations = tested.evaluate(RULE_INVALID, context); assertNotNull(violations); assertTrue(violations.violations(RuleViolation.Type.ERROR).iterator().hasNext()); } | @Override public RuleViolations evaluate(final CanDock rule, final NodeDockingContext context) { final Node<? extends Definition<?>, ? extends Edge> target = context.getCandidate(); final Set<String> parentLabels = evalUtils.getLabels(context.getParent()); final Set<String> candidateLabels = evalUtils.getLabels(target)... | NodeDockingEvaluationHandler implements RuleEvaluationHandler<CanDock, NodeDockingContext> { @Override public RuleViolations evaluate(final CanDock rule, final NodeDockingContext context) { final Node<? extends Definition<?>, ? extends Edge> target = context.getCandidate(); final Set<String> parentLabels = evalUtils.ge... | NodeDockingEvaluationHandler implements RuleEvaluationHandler<CanDock, NodeDockingContext> { @Override public RuleViolations evaluate(final CanDock rule, final NodeDockingContext context) { final Node<? extends Definition<?>, ? extends Edge> target = context.getCandidate(); final Set<String> parentLabels = evalUtils.ge... | NodeDockingEvaluationHandler implements RuleEvaluationHandler<CanDock, NodeDockingContext> { @Override public RuleViolations evaluate(final CanDock rule, final NodeDockingContext context) { final Node<? extends Definition<?>, ? extends Edge> target = context.getCandidate(); final Set<String> parentLabels = evalUtils.ge... | NodeDockingEvaluationHandler implements RuleEvaluationHandler<CanDock, NodeDockingContext> { @Override public RuleViolations evaluate(final CanDock rule, final NodeDockingContext context) { final Node<? extends Definition<?>, ? extends Edge> target = context.getCandidate(); final Set<String> parentLabels = evalUtils.ge... |
@Test public void testEvaluateSuccess1() { final RuleViolations violations = tested.evaluate(RULE, context); assertNotNull(violations); assertFalse(violations.violations(RuleViolation.Type.ERROR).iterator().hasNext()); } | @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final CanConnect rule, final GraphConnectionContext context) { final GraphEvaluationState.ConnectionState connectionState = context.getState().getConnectionState(); final Edge<? extends View<?>, ? extends Node> connector = context.getConnector(); f... | GraphConnectionEvaluationHandler implements RuleEvaluationHandler<CanConnect, GraphConnectionContext> { @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final CanConnect rule, final GraphConnectionContext context) { final GraphEvaluationState.ConnectionState connectionState = context.getState().g... | GraphConnectionEvaluationHandler implements RuleEvaluationHandler<CanConnect, GraphConnectionContext> { @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final CanConnect rule, final GraphConnectionContext context) { final GraphEvaluationState.ConnectionState connectionState = context.getState().g... | GraphConnectionEvaluationHandler implements RuleEvaluationHandler<CanConnect, GraphConnectionContext> { @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final CanConnect rule, final GraphConnectionContext context) { final GraphEvaluationState.ConnectionState connectionState = context.getState().g... | GraphConnectionEvaluationHandler implements RuleEvaluationHandler<CanConnect, GraphConnectionContext> { @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final CanConnect rule, final GraphConnectionContext context) { final GraphEvaluationState.ConnectionState connectionState = context.getState().g... |
@Test @SuppressWarnings("unchecked") public void testEvaluateFailed1() { when(context.getSource()).thenReturn(Optional.of(candidate)); when(context.getTarget()).thenReturn(Optional.of(parent)); final RuleViolations violations = tested.evaluate(RULE, context); assertNotNull(violations); assertTrue(violations.violations(... | @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final CanConnect rule, final GraphConnectionContext context) { final GraphEvaluationState.ConnectionState connectionState = context.getState().getConnectionState(); final Edge<? extends View<?>, ? extends Node> connector = context.getConnector(); f... | GraphConnectionEvaluationHandler implements RuleEvaluationHandler<CanConnect, GraphConnectionContext> { @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final CanConnect rule, final GraphConnectionContext context) { final GraphEvaluationState.ConnectionState connectionState = context.getState().g... | GraphConnectionEvaluationHandler implements RuleEvaluationHandler<CanConnect, GraphConnectionContext> { @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final CanConnect rule, final GraphConnectionContext context) { final GraphEvaluationState.ConnectionState connectionState = context.getState().g... | GraphConnectionEvaluationHandler implements RuleEvaluationHandler<CanConnect, GraphConnectionContext> { @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final CanConnect rule, final GraphConnectionContext context) { final GraphEvaluationState.ConnectionState connectionState = context.getState().g... | GraphConnectionEvaluationHandler implements RuleEvaluationHandler<CanConnect, GraphConnectionContext> { @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final CanConnect rule, final GraphConnectionContext context) { final GraphEvaluationState.ConnectionState connectionState = context.getState().g... |
@Test @SuppressWarnings("unchecked") public void testAccepts() { when(context.getDirection()).thenReturn(EdgeCardinalityContext.Direction.INCOMING); assertTrue(tested.accepts(RULE_IN_NO_LIMIT, context)); when(context.getDirection()).thenReturn(EdgeCardinalityContext.Direction.OUTGOING); assertFalse(tested.accepts(RULE_... | @Override @SuppressWarnings("unchecked") public boolean accepts(final EdgeOccurrences rule, final ConnectorCardinalityContext context) { final Edge<? extends View<?>, Node> edge = context.getEdge(); final Element<? extends View<?>> candidate = context.getCandidate(); final String edgeId = evalUtils.getElementDefinition... | ConnectorCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, ConnectorCardinalityContext> { @Override @SuppressWarnings("unchecked") public boolean accepts(final EdgeOccurrences rule, final ConnectorCardinalityContext context) { final Edge<? extends View<?>, Node> edge = context.getEdge(); fi... | ConnectorCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, ConnectorCardinalityContext> { @Override @SuppressWarnings("unchecked") public boolean accepts(final EdgeOccurrences rule, final ConnectorCardinalityContext context) { final Edge<? extends View<?>, Node> edge = context.getEdge(); fi... | ConnectorCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, ConnectorCardinalityContext> { @Override @SuppressWarnings("unchecked") public boolean accepts(final EdgeOccurrences rule, final ConnectorCardinalityContext context) { final Edge<? extends View<?>, Node> edge = context.getEdge(); fi... | ConnectorCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, ConnectorCardinalityContext> { @Override @SuppressWarnings("unchecked") public boolean accepts(final EdgeOccurrences rule, final ConnectorCardinalityContext context) { final Edge<? extends View<?>, Node> edge = context.getEdge(); fi... |
@Test @SuppressWarnings("unchecked") public void testEvaluateInNoLimit() { when(evalUtils.countEdges(anyString(), any(List.class))).thenReturn(0); when(context.getDirection()).thenReturn(EdgeCardinalityContext.Direction.INCOMING); when(context.getOperation()).thenReturn(Optional.of(CardinalityContext.Operation.ADD)); R... | @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final EdgeOccurrences rule, final ConnectorCardinalityContext context) { final GraphEvaluationState.ConnectorCardinalityState cardinalityState = context.getState().getConnectorCardinalityState(); final DefaultRuleViolations result = new DefaultRule... | ConnectorCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, ConnectorCardinalityContext> { @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final EdgeOccurrences rule, final ConnectorCardinalityContext context) { final GraphEvaluationState.ConnectorCardinalityState car... | ConnectorCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, ConnectorCardinalityContext> { @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final EdgeOccurrences rule, final ConnectorCardinalityContext context) { final GraphEvaluationState.ConnectorCardinalityState car... | ConnectorCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, ConnectorCardinalityContext> { @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final EdgeOccurrences rule, final ConnectorCardinalityContext context) { final GraphEvaluationState.ConnectorCardinalityState car... | ConnectorCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, ConnectorCardinalityContext> { @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final EdgeOccurrences rule, final ConnectorCardinalityContext context) { final GraphEvaluationState.ConnectorCardinalityState car... |
@Test @SuppressWarnings("unchecked") public void testEvaluateInMaxOneSucess() { when(evalUtils.countEdges(anyString(), any(List.class))).thenReturn(0); when(context.getDirection()).thenReturn(EdgeCardinalityContext.Direction.INCOMING); when(context.getOperation()).thenReturn(Optional.of(CardinalityContext.Operation.ADD... | @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final EdgeOccurrences rule, final ConnectorCardinalityContext context) { final GraphEvaluationState.ConnectorCardinalityState cardinalityState = context.getState().getConnectorCardinalityState(); final DefaultRuleViolations result = new DefaultRule... | ConnectorCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, ConnectorCardinalityContext> { @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final EdgeOccurrences rule, final ConnectorCardinalityContext context) { final GraphEvaluationState.ConnectorCardinalityState car... | ConnectorCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, ConnectorCardinalityContext> { @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final EdgeOccurrences rule, final ConnectorCardinalityContext context) { final GraphEvaluationState.ConnectorCardinalityState car... | ConnectorCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, ConnectorCardinalityContext> { @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final EdgeOccurrences rule, final ConnectorCardinalityContext context) { final GraphEvaluationState.ConnectorCardinalityState car... | ConnectorCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, ConnectorCardinalityContext> { @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final EdgeOccurrences rule, final ConnectorCardinalityContext context) { final GraphEvaluationState.ConnectorCardinalityState car... |
@Test @SuppressWarnings("unchecked") public void testEvaluateInMaxOneFailed() { when(evalUtils.countEdges(anyString(), any(List.class))).thenReturn(1); when(context.getDirection()).thenReturn(EdgeCardinalityContext.Direction.INCOMING); when(context.getOperation()).thenReturn(Optional.of(CardinalityContext.Operation.ADD... | @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final EdgeOccurrences rule, final ConnectorCardinalityContext context) { final GraphEvaluationState.ConnectorCardinalityState cardinalityState = context.getState().getConnectorCardinalityState(); final DefaultRuleViolations result = new DefaultRule... | ConnectorCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, ConnectorCardinalityContext> { @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final EdgeOccurrences rule, final ConnectorCardinalityContext context) { final GraphEvaluationState.ConnectorCardinalityState car... | ConnectorCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, ConnectorCardinalityContext> { @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final EdgeOccurrences rule, final ConnectorCardinalityContext context) { final GraphEvaluationState.ConnectorCardinalityState car... | ConnectorCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, ConnectorCardinalityContext> { @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final EdgeOccurrences rule, final ConnectorCardinalityContext context) { final GraphEvaluationState.ConnectorCardinalityState car... | ConnectorCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, ConnectorCardinalityContext> { @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final EdgeOccurrences rule, final ConnectorCardinalityContext context) { final GraphEvaluationState.ConnectorCardinalityState car... |
@Test public void testDelegateGetColumnCount() { uiModel.getColumnCount(); verify(delegate).getColumnCount(); } | @Override public int getColumnCount() { return delegate.getColumnCount(); } | DelegatingGridData implements GridData { @Override public int getColumnCount() { return delegate.getColumnCount(); } } | DelegatingGridData implements GridData { @Override public int getColumnCount() { return delegate.getColumnCount(); } DelegatingGridData(final DMNGridData delegate); } | DelegatingGridData implements GridData { @Override public int getColumnCount() { return delegate.getColumnCount(); } DelegatingGridData(final DMNGridData delegate); @Override void moveRowTo(final int index,
final GridRow row); @Override void moveRowsTo(final int index,
... | DelegatingGridData implements GridData { @Override public int getColumnCount() { return delegate.getColumnCount(); } DelegatingGridData(final DMNGridData delegate); @Override void moveRowTo(final int index,
final GridRow row); @Override void moveRowsTo(final int index,
... |
@Test @SuppressWarnings("unchecked") public void testEvaluateInMinOneSucess() { when(evalUtils.countEdges(anyString(), any(List.class))).thenReturn(0); when(context.getDirection()).thenReturn(EdgeCardinalityContext.Direction.INCOMING); when(context.getOperation()).thenReturn(Optional.of(CardinalityContext.Operation.ADD... | @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final EdgeOccurrences rule, final ConnectorCardinalityContext context) { final GraphEvaluationState.ConnectorCardinalityState cardinalityState = context.getState().getConnectorCardinalityState(); final DefaultRuleViolations result = new DefaultRule... | ConnectorCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, ConnectorCardinalityContext> { @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final EdgeOccurrences rule, final ConnectorCardinalityContext context) { final GraphEvaluationState.ConnectorCardinalityState car... | ConnectorCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, ConnectorCardinalityContext> { @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final EdgeOccurrences rule, final ConnectorCardinalityContext context) { final GraphEvaluationState.ConnectorCardinalityState car... | ConnectorCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, ConnectorCardinalityContext> { @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final EdgeOccurrences rule, final ConnectorCardinalityContext context) { final GraphEvaluationState.ConnectorCardinalityState car... | ConnectorCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, ConnectorCardinalityContext> { @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final EdgeOccurrences rule, final ConnectorCardinalityContext context) { final GraphEvaluationState.ConnectorCardinalityState car... |
@Test @SuppressWarnings("unchecked") public void testEvaluateInMinOneFailed() { when(evalUtils.countEdges(anyString(), any(List.class))).thenReturn(1); when(context.getDirection()).thenReturn(EdgeCardinalityContext.Direction.INCOMING); when(context.getOperation()).thenReturn(Optional.of(CardinalityContext.Operation.DEL... | @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final EdgeOccurrences rule, final ConnectorCardinalityContext context) { final GraphEvaluationState.ConnectorCardinalityState cardinalityState = context.getState().getConnectorCardinalityState(); final DefaultRuleViolations result = new DefaultRule... | ConnectorCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, ConnectorCardinalityContext> { @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final EdgeOccurrences rule, final ConnectorCardinalityContext context) { final GraphEvaluationState.ConnectorCardinalityState car... | ConnectorCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, ConnectorCardinalityContext> { @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final EdgeOccurrences rule, final ConnectorCardinalityContext context) { final GraphEvaluationState.ConnectorCardinalityState car... | ConnectorCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, ConnectorCardinalityContext> { @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final EdgeOccurrences rule, final ConnectorCardinalityContext context) { final GraphEvaluationState.ConnectorCardinalityState car... | ConnectorCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, ConnectorCardinalityContext> { @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final EdgeOccurrences rule, final ConnectorCardinalityContext context) { final GraphEvaluationState.ConnectorCardinalityState car... |
@Test @SuppressWarnings("unchecked") public void testAcceptsNoOp() { when(context.getCandidates()).thenReturn(Collections.emptyList()); assertTrue(tested.accepts(RULE_NO_LIMIT, context)); } | @Override @SuppressWarnings("unchecked") public boolean accepts(final Occurrences rule, final ElementCardinalityContext context) { final Collection<Element<? extends View<?>>> candidates = context.getCandidates(); return candidates.isEmpty() || candidates.stream().anyMatch(candidate -> accepts(rule, context, candidate)... | ElementCardinalityEvaluationHandler implements RuleEvaluationHandler<Occurrences, ElementCardinalityContext> { @Override @SuppressWarnings("unchecked") public boolean accepts(final Occurrences rule, final ElementCardinalityContext context) { final Collection<Element<? extends View<?>>> candidates = context.getCandidate... | ElementCardinalityEvaluationHandler implements RuleEvaluationHandler<Occurrences, ElementCardinalityContext> { @Override @SuppressWarnings("unchecked") public boolean accepts(final Occurrences rule, final ElementCardinalityContext context) { final Collection<Element<? extends View<?>>> candidates = context.getCandidate... | ElementCardinalityEvaluationHandler implements RuleEvaluationHandler<Occurrences, ElementCardinalityContext> { @Override @SuppressWarnings("unchecked") public boolean accepts(final Occurrences rule, final ElementCardinalityContext context) { final Collection<Element<? extends View<?>>> candidates = context.getCandidate... | ElementCardinalityEvaluationHandler implements RuleEvaluationHandler<Occurrences, ElementCardinalityContext> { @Override @SuppressWarnings("unchecked") public boolean accepts(final Occurrences rule, final ElementCardinalityContext context) { final Collection<Element<? extends View<?>>> candidates = context.getCandidate... |
@Test @SuppressWarnings("unchecked") public void testAccepts() { when(context.getOperation()).thenReturn(Optional.of(CardinalityContext.Operation.ADD)); when(context.getCandidates()).thenReturn(candidates); assertTrue(tested.accepts(RULE_NO_LIMIT, context)); when(context.getCandidates()).thenReturn(Collections.singleto... | @Override @SuppressWarnings("unchecked") public boolean accepts(final Occurrences rule, final ElementCardinalityContext context) { final Collection<Element<? extends View<?>>> candidates = context.getCandidates(); return candidates.isEmpty() || candidates.stream().anyMatch(candidate -> accepts(rule, context, candidate)... | ElementCardinalityEvaluationHandler implements RuleEvaluationHandler<Occurrences, ElementCardinalityContext> { @Override @SuppressWarnings("unchecked") public boolean accepts(final Occurrences rule, final ElementCardinalityContext context) { final Collection<Element<? extends View<?>>> candidates = context.getCandidate... | ElementCardinalityEvaluationHandler implements RuleEvaluationHandler<Occurrences, ElementCardinalityContext> { @Override @SuppressWarnings("unchecked") public boolean accepts(final Occurrences rule, final ElementCardinalityContext context) { final Collection<Element<? extends View<?>>> candidates = context.getCandidate... | ElementCardinalityEvaluationHandler implements RuleEvaluationHandler<Occurrences, ElementCardinalityContext> { @Override @SuppressWarnings("unchecked") public boolean accepts(final Occurrences rule, final ElementCardinalityContext context) { final Collection<Element<? extends View<?>>> candidates = context.getCandidate... | ElementCardinalityEvaluationHandler implements RuleEvaluationHandler<Occurrences, ElementCardinalityContext> { @Override @SuppressWarnings("unchecked") public boolean accepts(final Occurrences rule, final ElementCardinalityContext context) { final Collection<Element<? extends View<?>>> candidates = context.getCandidate... |
@Test public void testAccepts() { Set<String> candidateRoles = Collections.singleton("role2"); Set<String> parentRoles = Collections.singleton(PARENT_ID); when(context.getParentRoles()).thenReturn(parentRoles); when(context.getCandidateRoles()).thenReturn(candidateRoles); assertTrue(tested.accepts(RULE, context)); pare... | @Override public boolean accepts(final CanDock rule, final DockingContext context) { return context.getParentRoles().contains(rule.getRole()); } | DockingEvaluationHandler implements RuleEvaluationHandler<CanDock, DockingContext> { @Override public boolean accepts(final CanDock rule, final DockingContext context) { return context.getParentRoles().contains(rule.getRole()); } } | DockingEvaluationHandler implements RuleEvaluationHandler<CanDock, DockingContext> { @Override public boolean accepts(final CanDock rule, final DockingContext context) { return context.getParentRoles().contains(rule.getRole()); } } | DockingEvaluationHandler implements RuleEvaluationHandler<CanDock, DockingContext> { @Override public boolean accepts(final CanDock rule, final DockingContext context) { return context.getParentRoles().contains(rule.getRole()); } @Override Class<CanDock> getRuleType(); @Override Class<DockingContext> getContextType();... | DockingEvaluationHandler implements RuleEvaluationHandler<CanDock, DockingContext> { @Override public boolean accepts(final CanDock rule, final DockingContext context) { return context.getParentRoles().contains(rule.getRole()); } @Override Class<CanDock> getRuleType(); @Override Class<DockingContext> getContextType();... |
@Test public void testEvaluateSuccess() { final Set<String> candidateRoles = new HashSet<String>(1) {{ add("drole2"); }}; when(context.getParentRoles()).thenReturn(PARENT_ROLES); when(context.getCandidateRoles()).thenReturn(candidateRoles); final RuleViolations violations = tested.evaluate(RULE, context); assertNotNull... | @Override public RuleViolations evaluate(final CanDock rule, final DockingContext context) { final DefaultRuleViolations results = new DefaultRuleViolations(); final boolean present = context.getCandidateRoles() .stream() .filter(cr -> rule.getAllowedRoles().contains(cr)) .findAny() .isPresent(); if (!present) { result... | DockingEvaluationHandler implements RuleEvaluationHandler<CanDock, DockingContext> { @Override public RuleViolations evaluate(final CanDock rule, final DockingContext context) { final DefaultRuleViolations results = new DefaultRuleViolations(); final boolean present = context.getCandidateRoles() .stream() .filter(cr ->... | DockingEvaluationHandler implements RuleEvaluationHandler<CanDock, DockingContext> { @Override public RuleViolations evaluate(final CanDock rule, final DockingContext context) { final DefaultRuleViolations results = new DefaultRuleViolations(); final boolean present = context.getCandidateRoles() .stream() .filter(cr ->... | DockingEvaluationHandler implements RuleEvaluationHandler<CanDock, DockingContext> { @Override public RuleViolations evaluate(final CanDock rule, final DockingContext context) { final DefaultRuleViolations results = new DefaultRuleViolations(); final boolean present = context.getCandidateRoles() .stream() .filter(cr ->... | DockingEvaluationHandler implements RuleEvaluationHandler<CanDock, DockingContext> { @Override public RuleViolations evaluate(final CanDock rule, final DockingContext context) { final DefaultRuleViolations results = new DefaultRuleViolations(); final boolean present = context.getCandidateRoles() .stream() .filter(cr ->... |
@Test public void testEvaluateFailed() { final Set<String> candidateRoles = new HashSet<String>(1) {{ add("drole4"); }}; when(context.getParentRoles()).thenReturn(PARENT_ROLES); when(context.getCandidateRoles()).thenReturn(candidateRoles); final RuleViolations violations = tested.evaluate(RULE, context); assertNotNull(... | @Override public RuleViolations evaluate(final CanDock rule, final DockingContext context) { final DefaultRuleViolations results = new DefaultRuleViolations(); final boolean present = context.getCandidateRoles() .stream() .filter(cr -> rule.getAllowedRoles().contains(cr)) .findAny() .isPresent(); if (!present) { result... | DockingEvaluationHandler implements RuleEvaluationHandler<CanDock, DockingContext> { @Override public RuleViolations evaluate(final CanDock rule, final DockingContext context) { final DefaultRuleViolations results = new DefaultRuleViolations(); final boolean present = context.getCandidateRoles() .stream() .filter(cr ->... | DockingEvaluationHandler implements RuleEvaluationHandler<CanDock, DockingContext> { @Override public RuleViolations evaluate(final CanDock rule, final DockingContext context) { final DefaultRuleViolations results = new DefaultRuleViolations(); final boolean present = context.getCandidateRoles() .stream() .filter(cr ->... | DockingEvaluationHandler implements RuleEvaluationHandler<CanDock, DockingContext> { @Override public RuleViolations evaluate(final CanDock rule, final DockingContext context) { final DefaultRuleViolations results = new DefaultRuleViolations(); final boolean present = context.getCandidateRoles() .stream() .filter(cr ->... | DockingEvaluationHandler implements RuleEvaluationHandler<CanDock, DockingContext> { @Override public RuleViolations evaluate(final CanDock rule, final DockingContext context) { final DefaultRuleViolations results = new DefaultRuleViolations(); final boolean present = context.getCandidateRoles() .stream() .filter(cr ->... |
@Test @SuppressWarnings("unchecked") public void testAcceptSuccess() { when(context.getParent()).thenReturn(element); when(context.getCandidates()).thenReturn(candidates); final boolean accepts = tested.accepts(RULE, context); assertTrue(accepts); } | @Override public boolean accepts(final CanContain rule, final NodeContainmentContext context) { final Set<String> parenteLabels = evalUtils.getLabels(context.getParent()); return containmentHandler.accepts(rule, RuleEvaluationContextBuilder.DomainContexts.containment(parenteLabels, Collections.emptySet())); } | NodeContainmentEvaluationHandler implements RuleEvaluationHandler<CanContain, NodeContainmentContext> { @Override public boolean accepts(final CanContain rule, final NodeContainmentContext context) { final Set<String> parenteLabels = evalUtils.getLabels(context.getParent()); return containmentHandler.accepts(rule, Rule... | NodeContainmentEvaluationHandler implements RuleEvaluationHandler<CanContain, NodeContainmentContext> { @Override public boolean accepts(final CanContain rule, final NodeContainmentContext context) { final Set<String> parenteLabels = evalUtils.getLabels(context.getParent()); return containmentHandler.accepts(rule, Rule... | NodeContainmentEvaluationHandler implements RuleEvaluationHandler<CanContain, NodeContainmentContext> { @Override public boolean accepts(final CanContain rule, final NodeContainmentContext context) { final Set<String> parenteLabels = evalUtils.getLabels(context.getParent()); return containmentHandler.accepts(rule, Rule... | NodeContainmentEvaluationHandler implements RuleEvaluationHandler<CanContain, NodeContainmentContext> { @Override public boolean accepts(final CanContain rule, final NodeContainmentContext context) { final Set<String> parenteLabels = evalUtils.getLabels(context.getParent()); return containmentHandler.accepts(rule, Rule... |
@Test @SuppressWarnings("unchecked") public void testAcceptFailed() { when(context.getParent()).thenReturn(parent); when(context.getCandidates()).thenReturn(candidates); final boolean accepts = tested.accepts(RULE, context); assertFalse(accepts); } | @Override public boolean accepts(final CanContain rule, final NodeContainmentContext context) { final Set<String> parenteLabels = evalUtils.getLabels(context.getParent()); return containmentHandler.accepts(rule, RuleEvaluationContextBuilder.DomainContexts.containment(parenteLabels, Collections.emptySet())); } | NodeContainmentEvaluationHandler implements RuleEvaluationHandler<CanContain, NodeContainmentContext> { @Override public boolean accepts(final CanContain rule, final NodeContainmentContext context) { final Set<String> parenteLabels = evalUtils.getLabels(context.getParent()); return containmentHandler.accepts(rule, Rule... | NodeContainmentEvaluationHandler implements RuleEvaluationHandler<CanContain, NodeContainmentContext> { @Override public boolean accepts(final CanContain rule, final NodeContainmentContext context) { final Set<String> parenteLabels = evalUtils.getLabels(context.getParent()); return containmentHandler.accepts(rule, Rule... | NodeContainmentEvaluationHandler implements RuleEvaluationHandler<CanContain, NodeContainmentContext> { @Override public boolean accepts(final CanContain rule, final NodeContainmentContext context) { final Set<String> parenteLabels = evalUtils.getLabels(context.getParent()); return containmentHandler.accepts(rule, Rule... | NodeContainmentEvaluationHandler implements RuleEvaluationHandler<CanContain, NodeContainmentContext> { @Override public boolean accepts(final CanContain rule, final NodeContainmentContext context) { final Set<String> parenteLabels = evalUtils.getLabels(context.getParent()); return containmentHandler.accepts(rule, Rule... |
@Test @SuppressWarnings("unchecked") public void testEvaluateSuccess() { when(context.getCandidates()).thenReturn(candidates); final RuleViolations violations = tested.evaluate(RULE, context); assertNotNull(violations); assertFalse(violations.violations(RuleViolation.Type.ERROR).iterator().hasNext()); } | @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final CanContain rule, final NodeContainmentContext context) { final Element<? extends Definition<?>> parent = context.getParent(); final Set<String> parentLabels = evalUtils.getLabels(parent); final DefaultRuleViolations result = new DefaultRuleVi... | NodeContainmentEvaluationHandler implements RuleEvaluationHandler<CanContain, NodeContainmentContext> { @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final CanContain rule, final NodeContainmentContext context) { final Element<? extends Definition<?>> parent = context.getParent(); final Set<St... | NodeContainmentEvaluationHandler implements RuleEvaluationHandler<CanContain, NodeContainmentContext> { @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final CanContain rule, final NodeContainmentContext context) { final Element<? extends Definition<?>> parent = context.getParent(); final Set<St... | NodeContainmentEvaluationHandler implements RuleEvaluationHandler<CanContain, NodeContainmentContext> { @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final CanContain rule, final NodeContainmentContext context) { final Element<? extends Definition<?>> parent = context.getParent(); final Set<St... | NodeContainmentEvaluationHandler implements RuleEvaluationHandler<CanContain, NodeContainmentContext> { @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final CanContain rule, final NodeContainmentContext context) { final Element<? extends Definition<?>> parent = context.getParent(); final Set<St... |
@Test public void testDelegateAppendColumn() { uiModel.appendColumn(gridColumn); verify(delegate).appendColumn(eq(gridColumn)); } | @Override public void appendColumn(final GridColumn<?> column) { delegate.appendColumn(column); } | DelegatingGridData implements GridData { @Override public void appendColumn(final GridColumn<?> column) { delegate.appendColumn(column); } } | DelegatingGridData implements GridData { @Override public void appendColumn(final GridColumn<?> column) { delegate.appendColumn(column); } DelegatingGridData(final DMNGridData delegate); } | DelegatingGridData implements GridData { @Override public void appendColumn(final GridColumn<?> column) { delegate.appendColumn(column); } DelegatingGridData(final DMNGridData delegate); @Override void moveRowTo(final int index,
final GridRow row); @Override void moveRowsTo(final int index,
... | DelegatingGridData implements GridData { @Override public void appendColumn(final GridColumn<?> column) { delegate.appendColumn(column); } DelegatingGridData(final DMNGridData delegate); @Override void moveRowTo(final int index,
final GridRow row); @Override void moveRowsTo(final int index,
... |
@Test @SuppressWarnings("unchecked") public void testEvaluateFailed() { when(context.getCandidates()).thenReturn(candidates); final RuleViolations violations = tested.evaluate(RULE_INVALID, context); assertNotNull(violations); assertTrue(violations.violations(RuleViolation.Type.ERROR).iterator().hasNext()); } | @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final CanContain rule, final NodeContainmentContext context) { final Element<? extends Definition<?>> parent = context.getParent(); final Set<String> parentLabels = evalUtils.getLabels(parent); final DefaultRuleViolations result = new DefaultRuleVi... | NodeContainmentEvaluationHandler implements RuleEvaluationHandler<CanContain, NodeContainmentContext> { @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final CanContain rule, final NodeContainmentContext context) { final Element<? extends Definition<?>> parent = context.getParent(); final Set<St... | NodeContainmentEvaluationHandler implements RuleEvaluationHandler<CanContain, NodeContainmentContext> { @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final CanContain rule, final NodeContainmentContext context) { final Element<? extends Definition<?>> parent = context.getParent(); final Set<St... | NodeContainmentEvaluationHandler implements RuleEvaluationHandler<CanContain, NodeContainmentContext> { @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final CanContain rule, final NodeContainmentContext context) { final Element<? extends Definition<?>> parent = context.getParent(); final Set<St... | NodeContainmentEvaluationHandler implements RuleEvaluationHandler<CanContain, NodeContainmentContext> { @Override @SuppressWarnings("unchecked") public RuleViolations evaluate(final CanContain rule, final NodeContainmentContext context) { final Element<? extends Definition<?>> parent = context.getParent(); final Set<St... |
@Test public void testAccept() { when(context.getDirection()).thenReturn(EdgeCardinalityContext.Direction.OUTGOING); assertFalse(tested.accepts(RULE_IN_MAX_1, context)); when(context.getDirection()).thenReturn(EdgeCardinalityContext.Direction.INCOMING); assertTrue(tested.accepts(RULE_IN_MAX_1, context)); when(context.g... | @Override public boolean accepts(final EdgeOccurrences rule, final EdgeCardinalityContext context) { final EdgeCardinalityContext.Direction direction = rule.getDirection(); return context.getEdgeRole().equals(rule.getConnectorRole()) && direction.equals(context.getDirection()) && context.getRoles().contains(rule.getRol... | EdgeCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, EdgeCardinalityContext> { @Override public boolean accepts(final EdgeOccurrences rule, final EdgeCardinalityContext context) { final EdgeCardinalityContext.Direction direction = rule.getDirection(); return context.getEdgeRole().equals(ru... | EdgeCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, EdgeCardinalityContext> { @Override public boolean accepts(final EdgeOccurrences rule, final EdgeCardinalityContext context) { final EdgeCardinalityContext.Direction direction = rule.getDirection(); return context.getEdgeRole().equals(ru... | EdgeCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, EdgeCardinalityContext> { @Override public boolean accepts(final EdgeOccurrences rule, final EdgeCardinalityContext context) { final EdgeCardinalityContext.Direction direction = rule.getDirection(); return context.getEdgeRole().equals(ru... | EdgeCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, EdgeCardinalityContext> { @Override public boolean accepts(final EdgeOccurrences rule, final EdgeCardinalityContext context) { final EdgeCardinalityContext.Direction direction = rule.getDirection(); return context.getEdgeRole().equals(ru... |
@Test public void testEvaluateInNoLimit() { when(context.getCurrentCount()).thenReturn(0); when(context.getDirection()).thenReturn(EdgeCardinalityContext.Direction.INCOMING); when(context.getOperation()).thenReturn(Optional.of(CardinalityContext.Operation.ADD)); RuleViolations violations = tested.evaluate(RULE_IN_NO_LI... | @Override public RuleViolations evaluate(final EdgeOccurrences rule, final EdgeCardinalityContext context) { final DefaultRuleViolations results = new DefaultRuleViolations(); final int minOccurrences = rule.getMinOccurrences(); final int maxOccurrences = rule.getMaxOccurrences(); final int candidatesCount = context.ge... | EdgeCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, EdgeCardinalityContext> { @Override public RuleViolations evaluate(final EdgeOccurrences rule, final EdgeCardinalityContext context) { final DefaultRuleViolations results = new DefaultRuleViolations(); final int minOccurrences = rule.get... | EdgeCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, EdgeCardinalityContext> { @Override public RuleViolations evaluate(final EdgeOccurrences rule, final EdgeCardinalityContext context) { final DefaultRuleViolations results = new DefaultRuleViolations(); final int minOccurrences = rule.get... | EdgeCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, EdgeCardinalityContext> { @Override public RuleViolations evaluate(final EdgeOccurrences rule, final EdgeCardinalityContext context) { final DefaultRuleViolations results = new DefaultRuleViolations(); final int minOccurrences = rule.get... | EdgeCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, EdgeCardinalityContext> { @Override public RuleViolations evaluate(final EdgeOccurrences rule, final EdgeCardinalityContext context) { final DefaultRuleViolations results = new DefaultRuleViolations(); final int minOccurrences = rule.get... |
@Test public void testEvaluateInMaxOneSucess() { when(context.getCurrentCount()).thenReturn(0); when(context.getDirection()).thenReturn(EdgeCardinalityContext.Direction.INCOMING); when(context.getOperation()).thenReturn(Optional.of(CardinalityContext.Operation.ADD)); RuleViolations violations = tested.evaluate(RULE_IN_... | @Override public RuleViolations evaluate(final EdgeOccurrences rule, final EdgeCardinalityContext context) { final DefaultRuleViolations results = new DefaultRuleViolations(); final int minOccurrences = rule.getMinOccurrences(); final int maxOccurrences = rule.getMaxOccurrences(); final int candidatesCount = context.ge... | EdgeCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, EdgeCardinalityContext> { @Override public RuleViolations evaluate(final EdgeOccurrences rule, final EdgeCardinalityContext context) { final DefaultRuleViolations results = new DefaultRuleViolations(); final int minOccurrences = rule.get... | EdgeCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, EdgeCardinalityContext> { @Override public RuleViolations evaluate(final EdgeOccurrences rule, final EdgeCardinalityContext context) { final DefaultRuleViolations results = new DefaultRuleViolations(); final int minOccurrences = rule.get... | EdgeCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, EdgeCardinalityContext> { @Override public RuleViolations evaluate(final EdgeOccurrences rule, final EdgeCardinalityContext context) { final DefaultRuleViolations results = new DefaultRuleViolations(); final int minOccurrences = rule.get... | EdgeCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, EdgeCardinalityContext> { @Override public RuleViolations evaluate(final EdgeOccurrences rule, final EdgeCardinalityContext context) { final DefaultRuleViolations results = new DefaultRuleViolations(); final int minOccurrences = rule.get... |
@Test public void testEvaluateInMaxOneFailed() { when(context.getCurrentCount()).thenReturn(1); when(context.getDirection()).thenReturn(EdgeCardinalityContext.Direction.INCOMING); when(context.getOperation()).thenReturn(Optional.of(CardinalityContext.Operation.ADD)); RuleViolations violations = tested.evaluate(RULE_IN_... | @Override public RuleViolations evaluate(final EdgeOccurrences rule, final EdgeCardinalityContext context) { final DefaultRuleViolations results = new DefaultRuleViolations(); final int minOccurrences = rule.getMinOccurrences(); final int maxOccurrences = rule.getMaxOccurrences(); final int candidatesCount = context.ge... | EdgeCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, EdgeCardinalityContext> { @Override public RuleViolations evaluate(final EdgeOccurrences rule, final EdgeCardinalityContext context) { final DefaultRuleViolations results = new DefaultRuleViolations(); final int minOccurrences = rule.get... | EdgeCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, EdgeCardinalityContext> { @Override public RuleViolations evaluate(final EdgeOccurrences rule, final EdgeCardinalityContext context) { final DefaultRuleViolations results = new DefaultRuleViolations(); final int minOccurrences = rule.get... | EdgeCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, EdgeCardinalityContext> { @Override public RuleViolations evaluate(final EdgeOccurrences rule, final EdgeCardinalityContext context) { final DefaultRuleViolations results = new DefaultRuleViolations(); final int minOccurrences = rule.get... | EdgeCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, EdgeCardinalityContext> { @Override public RuleViolations evaluate(final EdgeOccurrences rule, final EdgeCardinalityContext context) { final DefaultRuleViolations results = new DefaultRuleViolations(); final int minOccurrences = rule.get... |
@Test public void testEvaluateInMinOneSucess() { when(context.getCurrentCount()).thenReturn(0); when(context.getDirection()).thenReturn(EdgeCardinalityContext.Direction.INCOMING); when(context.getOperation()).thenReturn(Optional.of(CardinalityContext.Operation.ADD)); RuleViolations violations = tested.evaluate(RULE_IN_... | @Override public RuleViolations evaluate(final EdgeOccurrences rule, final EdgeCardinalityContext context) { final DefaultRuleViolations results = new DefaultRuleViolations(); final int minOccurrences = rule.getMinOccurrences(); final int maxOccurrences = rule.getMaxOccurrences(); final int candidatesCount = context.ge... | EdgeCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, EdgeCardinalityContext> { @Override public RuleViolations evaluate(final EdgeOccurrences rule, final EdgeCardinalityContext context) { final DefaultRuleViolations results = new DefaultRuleViolations(); final int minOccurrences = rule.get... | EdgeCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, EdgeCardinalityContext> { @Override public RuleViolations evaluate(final EdgeOccurrences rule, final EdgeCardinalityContext context) { final DefaultRuleViolations results = new DefaultRuleViolations(); final int minOccurrences = rule.get... | EdgeCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, EdgeCardinalityContext> { @Override public RuleViolations evaluate(final EdgeOccurrences rule, final EdgeCardinalityContext context) { final DefaultRuleViolations results = new DefaultRuleViolations(); final int minOccurrences = rule.get... | EdgeCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, EdgeCardinalityContext> { @Override public RuleViolations evaluate(final EdgeOccurrences rule, final EdgeCardinalityContext context) { final DefaultRuleViolations results = new DefaultRuleViolations(); final int minOccurrences = rule.get... |
@Test public void testEvaluateInMinOneFailed() { when(context.getCurrentCount()).thenReturn(1); when(context.getDirection()).thenReturn(EdgeCardinalityContext.Direction.INCOMING); when(context.getOperation()).thenReturn(Optional.of(CardinalityContext.Operation.DELETE)); RuleViolations violations = tested.evaluate(RULE_... | @Override public RuleViolations evaluate(final EdgeOccurrences rule, final EdgeCardinalityContext context) { final DefaultRuleViolations results = new DefaultRuleViolations(); final int minOccurrences = rule.getMinOccurrences(); final int maxOccurrences = rule.getMaxOccurrences(); final int candidatesCount = context.ge... | EdgeCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, EdgeCardinalityContext> { @Override public RuleViolations evaluate(final EdgeOccurrences rule, final EdgeCardinalityContext context) { final DefaultRuleViolations results = new DefaultRuleViolations(); final int minOccurrences = rule.get... | EdgeCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, EdgeCardinalityContext> { @Override public RuleViolations evaluate(final EdgeOccurrences rule, final EdgeCardinalityContext context) { final DefaultRuleViolations results = new DefaultRuleViolations(); final int minOccurrences = rule.get... | EdgeCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, EdgeCardinalityContext> { @Override public RuleViolations evaluate(final EdgeOccurrences rule, final EdgeCardinalityContext context) { final DefaultRuleViolations results = new DefaultRuleViolations(); final int minOccurrences = rule.get... | EdgeCardinalityEvaluationHandler implements RuleEvaluationHandler<EdgeOccurrences, EdgeCardinalityContext> { @Override public RuleViolations evaluate(final EdgeOccurrences rule, final EdgeCardinalityContext context) { final DefaultRuleViolations results = new DefaultRuleViolations(); final int minOccurrences = rule.get... |
@Test public void testAccepts() { when(context.getConnectorRole()).thenReturn(EDGE_ID); assertTrue(tested.accepts(RULE, context)); when(context.getConnectorRole()).thenReturn("anotherEdgeId"); assertFalse(tested.accepts(RULE, context)); } | @Override public boolean accepts(final CanConnect rule, final ConnectionContext context) { return rule.getRole().equals(context.getConnectorRole()); } | ConnectionEvaluationHandler implements RuleEvaluationHandler<CanConnect, ConnectionContext> { @Override public boolean accepts(final CanConnect rule, final ConnectionContext context) { return rule.getRole().equals(context.getConnectorRole()); } } | ConnectionEvaluationHandler implements RuleEvaluationHandler<CanConnect, ConnectionContext> { @Override public boolean accepts(final CanConnect rule, final ConnectionContext context) { return rule.getRole().equals(context.getConnectorRole()); } } | ConnectionEvaluationHandler implements RuleEvaluationHandler<CanConnect, ConnectionContext> { @Override public boolean accepts(final CanConnect rule, final ConnectionContext context) { return rule.getRole().equals(context.getConnectorRole()); } @Override Class<CanConnect> getRuleType(); @Override Class<ConnectionConte... | ConnectionEvaluationHandler implements RuleEvaluationHandler<CanConnect, ConnectionContext> { @Override public boolean accepts(final CanConnect rule, final ConnectionContext context) { return rule.getRole().equals(context.getConnectorRole()); } @Override Class<CanConnect> getRuleType(); @Override Class<ConnectionConte... |
@Test public void testEvaluateSuccess1() { final Set<String> sourceRoles = new HashSet<String>(1) {{ add("r1"); }}; final Set<String> targetRoles = new HashSet<String>(1) {{ add("o1"); }}; when(context.getConnectorRole()).thenReturn(EDGE_ID); when(context.getSourceRoles()).thenReturn(Optional.of(sourceRoles)); when(con... | @Override public RuleViolations evaluate(final CanConnect rule, final ConnectionContext context) { final List<CanConnect.PermittedConnection> permittedConnections = rule.getPermittedConnections(); final String currentConnectorRole = context.getConnectorRole(); final Set<String> incomingLabels = context.getTargetRoles()... | ConnectionEvaluationHandler implements RuleEvaluationHandler<CanConnect, ConnectionContext> { @Override public RuleViolations evaluate(final CanConnect rule, final ConnectionContext context) { final List<CanConnect.PermittedConnection> permittedConnections = rule.getPermittedConnections(); final String currentConnector... | ConnectionEvaluationHandler implements RuleEvaluationHandler<CanConnect, ConnectionContext> { @Override public RuleViolations evaluate(final CanConnect rule, final ConnectionContext context) { final List<CanConnect.PermittedConnection> permittedConnections = rule.getPermittedConnections(); final String currentConnector... | ConnectionEvaluationHandler implements RuleEvaluationHandler<CanConnect, ConnectionContext> { @Override public RuleViolations evaluate(final CanConnect rule, final ConnectionContext context) { final List<CanConnect.PermittedConnection> permittedConnections = rule.getPermittedConnections(); final String currentConnector... | ConnectionEvaluationHandler implements RuleEvaluationHandler<CanConnect, ConnectionContext> { @Override public RuleViolations evaluate(final CanConnect rule, final ConnectionContext context) { final List<CanConnect.PermittedConnection> permittedConnections = rule.getPermittedConnections(); final String currentConnector... |
@Test public void testEvaluateFailed1() { final Set<String> sourceRoles = new HashSet<String>(1) {{ add("r1"); }}; final Set<String> targetRoles = new HashSet<String>(1) {{ add("o2"); }}; when(context.getConnectorRole()).thenReturn(EDGE_ID); when(context.getSourceRoles()).thenReturn(Optional.of(sourceRoles)); when(cont... | @Override public RuleViolations evaluate(final CanConnect rule, final ConnectionContext context) { final List<CanConnect.PermittedConnection> permittedConnections = rule.getPermittedConnections(); final String currentConnectorRole = context.getConnectorRole(); final Set<String> incomingLabels = context.getTargetRoles()... | ConnectionEvaluationHandler implements RuleEvaluationHandler<CanConnect, ConnectionContext> { @Override public RuleViolations evaluate(final CanConnect rule, final ConnectionContext context) { final List<CanConnect.PermittedConnection> permittedConnections = rule.getPermittedConnections(); final String currentConnector... | ConnectionEvaluationHandler implements RuleEvaluationHandler<CanConnect, ConnectionContext> { @Override public RuleViolations evaluate(final CanConnect rule, final ConnectionContext context) { final List<CanConnect.PermittedConnection> permittedConnections = rule.getPermittedConnections(); final String currentConnector... | ConnectionEvaluationHandler implements RuleEvaluationHandler<CanConnect, ConnectionContext> { @Override public RuleViolations evaluate(final CanConnect rule, final ConnectionContext context) { final List<CanConnect.PermittedConnection> permittedConnections = rule.getPermittedConnections(); final String currentConnector... | ConnectionEvaluationHandler implements RuleEvaluationHandler<CanConnect, ConnectionContext> { @Override public RuleViolations evaluate(final CanConnect rule, final ConnectionContext context) { final List<CanConnect.PermittedConnection> permittedConnections = rule.getPermittedConnections(); final String currentConnector... |
@Test public void testDelegateInsertColumn() { uiModel.insertColumn(0, gridColumn); verify(delegate).insertColumn(eq(0), eq(gridColumn)); } | @Override public void insertColumn(final int index, final GridColumn<?> column) { delegate.insertColumn(index, column); } | DelegatingGridData implements GridData { @Override public void insertColumn(final int index, final GridColumn<?> column) { delegate.insertColumn(index, column); } } | DelegatingGridData implements GridData { @Override public void insertColumn(final int index, final GridColumn<?> column) { delegate.insertColumn(index, column); } DelegatingGridData(final DMNGridData delegate); } | DelegatingGridData implements GridData { @Override public void insertColumn(final int index, final GridColumn<?> column) { delegate.insertColumn(index, column); } DelegatingGridData(final DMNGridData delegate); @Override void moveRowTo(final int index,
final GridRow row); @Override void moveRo... | DelegatingGridData implements GridData { @Override public void insertColumn(final int index, final GridColumn<?> column) { delegate.insertColumn(index, column); } DelegatingGridData(final DMNGridData delegate); @Override void moveRowTo(final int index,
final GridRow row); @Override void moveRo... |
@Test public void testGetDrgElementsWithNamespace() { final Definitions definitions = mock(Definitions.class); final Import anImport = mock(Import.class); final TDecision drgElement1 = new TDecision(); final TInputData drgElement2 = new TInputData(); final TDecisionService drgElement3 = new TDecisionService(); final In... | List<DRGElement> getDrgElementsWithNamespace(final Definitions definitions, final Import anImport) { return definitions .getDrgElement() .stream() .map(drgElement -> drgElementWithNamespace(drgElement, anImport)) .collect(Collectors.toList()); } | DMNMarshallerImportsHelperStandaloneImpl implements DMNMarshallerImportsHelperStandalone { List<DRGElement> getDrgElementsWithNamespace(final Definitions definitions, final Import anImport) { return definitions .getDrgElement() .stream() .map(drgElement -> drgElementWithNamespace(drgElement, anImport)) .collect(Collect... | DMNMarshallerImportsHelperStandaloneImpl implements DMNMarshallerImportsHelperStandalone { List<DRGElement> getDrgElementsWithNamespace(final Definitions definitions, final Import anImport) { return definitions .getDrgElement() .stream() .map(drgElement -> drgElementWithNamespace(drgElement, anImport)) .collect(Collect... | DMNMarshallerImportsHelperStandaloneImpl implements DMNMarshallerImportsHelperStandalone { List<DRGElement> getDrgElementsWithNamespace(final Definitions definitions, final Import anImport) { return definitions .getDrgElement() .stream() .map(drgElement -> drgElementWithNamespace(drgElement, anImport)) .collect(Collect... | DMNMarshallerImportsHelperStandaloneImpl implements DMNMarshallerImportsHelperStandalone { List<DRGElement> getDrgElementsWithNamespace(final Definitions definitions, final Import anImport) { return definitions .getDrgElement() .stream() .map(drgElement -> drgElementWithNamespace(drgElement, anImport)) .collect(Collect... |
@Test public void testEvaluateSuccess2() { final Set<String> sourceRoles = new HashSet<String>(1) {{ add("r2"); }}; final Set<String> targetRoles = new HashSet<String>(1) {{ add("o2"); }}; when(context.getConnectorRole()).thenReturn(EDGE_ID); when(context.getSourceRoles()).thenReturn(Optional.of(sourceRoles)); when(con... | @Override public RuleViolations evaluate(final CanConnect rule, final ConnectionContext context) { final List<CanConnect.PermittedConnection> permittedConnections = rule.getPermittedConnections(); final String currentConnectorRole = context.getConnectorRole(); final Set<String> incomingLabels = context.getTargetRoles()... | ConnectionEvaluationHandler implements RuleEvaluationHandler<CanConnect, ConnectionContext> { @Override public RuleViolations evaluate(final CanConnect rule, final ConnectionContext context) { final List<CanConnect.PermittedConnection> permittedConnections = rule.getPermittedConnections(); final String currentConnector... | ConnectionEvaluationHandler implements RuleEvaluationHandler<CanConnect, ConnectionContext> { @Override public RuleViolations evaluate(final CanConnect rule, final ConnectionContext context) { final List<CanConnect.PermittedConnection> permittedConnections = rule.getPermittedConnections(); final String currentConnector... | ConnectionEvaluationHandler implements RuleEvaluationHandler<CanConnect, ConnectionContext> { @Override public RuleViolations evaluate(final CanConnect rule, final ConnectionContext context) { final List<CanConnect.PermittedConnection> permittedConnections = rule.getPermittedConnections(); final String currentConnector... | ConnectionEvaluationHandler implements RuleEvaluationHandler<CanConnect, ConnectionContext> { @Override public RuleViolations evaluate(final CanConnect rule, final ConnectionContext context) { final List<CanConnect.PermittedConnection> permittedConnections = rule.getPermittedConnections(); final String currentConnector... |
@Test public void testEvaluateFailed2() { final Set<String> sourceRoles = new HashSet<String>(1) {{ add("r2"); }}; final Set<String> targetRoles = new HashSet<String>(1) {{ add("o1"); }}; when(context.getConnectorRole()).thenReturn(EDGE_ID); when(context.getSourceRoles()).thenReturn(Optional.of(sourceRoles)); when(cont... | @Override public RuleViolations evaluate(final CanConnect rule, final ConnectionContext context) { final List<CanConnect.PermittedConnection> permittedConnections = rule.getPermittedConnections(); final String currentConnectorRole = context.getConnectorRole(); final Set<String> incomingLabels = context.getTargetRoles()... | ConnectionEvaluationHandler implements RuleEvaluationHandler<CanConnect, ConnectionContext> { @Override public RuleViolations evaluate(final CanConnect rule, final ConnectionContext context) { final List<CanConnect.PermittedConnection> permittedConnections = rule.getPermittedConnections(); final String currentConnector... | ConnectionEvaluationHandler implements RuleEvaluationHandler<CanConnect, ConnectionContext> { @Override public RuleViolations evaluate(final CanConnect rule, final ConnectionContext context) { final List<CanConnect.PermittedConnection> permittedConnections = rule.getPermittedConnections(); final String currentConnector... | ConnectionEvaluationHandler implements RuleEvaluationHandler<CanConnect, ConnectionContext> { @Override public RuleViolations evaluate(final CanConnect rule, final ConnectionContext context) { final List<CanConnect.PermittedConnection> permittedConnections = rule.getPermittedConnections(); final String currentConnector... | ConnectionEvaluationHandler implements RuleEvaluationHandler<CanConnect, ConnectionContext> { @Override public RuleViolations evaluate(final CanConnect rule, final ConnectionContext context) { final List<CanConnect.PermittedConnection> permittedConnections = rule.getPermittedConnections(); final String currentConnector... |
@Test public void testEmptyRules() { ruleSet = new EmptyRuleSet(); final RuleViolations result = tested.evaluate(ruleSet, ruleEvaluationContext); assertNotNull(result); final Collection<RuleViolation> violations = (Collection<RuleViolation>) result.violations(); assertTrue(violations.isEmpty()); } | @Override public RuleViolations evaluate(final RuleSet ruleSet, final RuleEvaluationContext context) { final DefaultRuleViolations results = new DefaultRuleViolations(); final Collection<Rule> rules = rulesProvider.get(ruleSet, context); if (rules.isEmpty()) { return results; } final Collection<RuleEvaluationHandler> h... | RuleManagerImpl implements RuleManager { @Override public RuleViolations evaluate(final RuleSet ruleSet, final RuleEvaluationContext context) { final DefaultRuleViolations results = new DefaultRuleViolations(); final Collection<Rule> rules = rulesProvider.get(ruleSet, context); if (rules.isEmpty()) { return results; } ... | RuleManagerImpl implements RuleManager { @Override public RuleViolations evaluate(final RuleSet ruleSet, final RuleEvaluationContext context) { final DefaultRuleViolations results = new DefaultRuleViolations(); final Collection<Rule> rules = rulesProvider.get(ruleSet, context); if (rules.isEmpty()) { return results; } ... | RuleManagerImpl implements RuleManager { @Override public RuleViolations evaluate(final RuleSet ruleSet, final RuleEvaluationContext context) { final DefaultRuleViolations results = new DefaultRuleViolations(); final Collection<Rule> rules = rulesProvider.get(ruleSet, context); if (rules.isEmpty()) { return results; } ... | RuleManagerImpl implements RuleManager { @Override public RuleViolations evaluate(final RuleSet ruleSet, final RuleEvaluationContext context) { final DefaultRuleViolations results = new DefaultRuleViolations(); final Collection<Rule> rules = rulesProvider.get(ruleSet, context); if (rules.isEmpty()) { return results; } ... |
@Test public void testClear() { final DefaultRuleViolations violations = new DefaultRuleViolations() .addViolation(violationWarn) .addViolation(violationInfo) .addViolation(violationErr); violations.clear(); assertNotNull(violations); assertTrue(violations.isEmpty()); } | public DefaultRuleViolations clear() { violations.clear(); return this; } | DefaultRuleViolations implements RuleViolations { public DefaultRuleViolations clear() { violations.clear(); return this; } } | DefaultRuleViolations implements RuleViolations { public DefaultRuleViolations clear() { violations.clear(); return this; } } | DefaultRuleViolations implements RuleViolations { public DefaultRuleViolations clear() { violations.clear(); return this; } DefaultRuleViolations addViolations(final RuleViolations violations); DefaultRuleViolations addViolation(final RuleViolation violation); DefaultRuleViolations clear(); boolean isEmpty(); @Overrid... | DefaultRuleViolations implements RuleViolations { public DefaultRuleViolations clear() { violations.clear(); return this; } DefaultRuleViolations addViolations(final RuleViolations violations); DefaultRuleViolations addViolation(final RuleViolation violation); DefaultRuleViolations clear(); boolean isEmpty(); @Overrid... |
@Test public void testAllow() throws Exception { reverseCommand.allow(context); verify(command).allow(eq(context)); } | @Override public CommandResult<V> allow(T context) { return command.allow(context); } | ReverseCommand implements Command<T, V> { @Override public CommandResult<V> allow(T context) { return command.allow(context); } } | ReverseCommand implements Command<T, V> { @Override public CommandResult<V> allow(T context) { return command.allow(context); } ReverseCommand(Command<T, V> command); } | ReverseCommand implements Command<T, V> { @Override public CommandResult<V> allow(T context) { return command.allow(context); } ReverseCommand(Command<T, V> command); @Override CommandResult<V> allow(T context); @Override CommandResult<V> execute(T context); @Override CommandResult<V> undo(T context); } | ReverseCommand implements Command<T, V> { @Override public CommandResult<V> allow(T context) { return command.allow(context); } ReverseCommand(Command<T, V> command); @Override CommandResult<V> allow(T context); @Override CommandResult<V> execute(T context); @Override CommandResult<V> undo(T context); } |
@Test public void testExecute() throws Exception { reverseCommand.execute(context); verify(command).undo(eq(context)); } | @Override public CommandResult<V> execute(T context) { return command.undo(context); } | ReverseCommand implements Command<T, V> { @Override public CommandResult<V> execute(T context) { return command.undo(context); } } | ReverseCommand implements Command<T, V> { @Override public CommandResult<V> execute(T context) { return command.undo(context); } ReverseCommand(Command<T, V> command); } | ReverseCommand implements Command<T, V> { @Override public CommandResult<V> execute(T context) { return command.undo(context); } ReverseCommand(Command<T, V> command); @Override CommandResult<V> allow(T context); @Override CommandResult<V> execute(T context); @Override CommandResult<V> undo(T context); } | ReverseCommand implements Command<T, V> { @Override public CommandResult<V> execute(T context) { return command.undo(context); } ReverseCommand(Command<T, V> command); @Override CommandResult<V> allow(T context); @Override CommandResult<V> execute(T context); @Override CommandResult<V> undo(T context); } |
@Test public void testUndo() throws Exception { reverseCommand.undo(context); verify(command).execute(eq(context)); } | @Override public CommandResult<V> undo(T context) { return command.execute(context); } | ReverseCommand implements Command<T, V> { @Override public CommandResult<V> undo(T context) { return command.execute(context); } } | ReverseCommand implements Command<T, V> { @Override public CommandResult<V> undo(T context) { return command.execute(context); } ReverseCommand(Command<T, V> command); } | ReverseCommand implements Command<T, V> { @Override public CommandResult<V> undo(T context) { return command.execute(context); } ReverseCommand(Command<T, V> command); @Override CommandResult<V> allow(T context); @Override CommandResult<V> execute(T context); @Override CommandResult<V> undo(T context); } | ReverseCommand implements Command<T, V> { @Override public CommandResult<V> undo(T context) { return command.execute(context); } ReverseCommand(Command<T, V> command); @Override CommandResult<V> allow(T context); @Override CommandResult<V> execute(T context); @Override CommandResult<V> undo(T context); } |
@Test @SuppressWarnings("unchecked") public void testAllow() { compositeCommand = buildCompositeCommand(); expectedException.expectMessage(DeferredCompositeCommand.ILLEGAL_ALLOW_MESSAGE); compositeCommand.allow(commandExecutionContext); } | @Override public CommandResult<V> allow(final T context) { throw new IllegalStateException(ILLEGAL_ALLOW_MESSAGE); } | DeferredCompositeCommand extends AbstractCompositeCommand<T, V> { @Override public CommandResult<V> allow(final T context) { throw new IllegalStateException(ILLEGAL_ALLOW_MESSAGE); } } | DeferredCompositeCommand extends AbstractCompositeCommand<T, V> { @Override public CommandResult<V> allow(final T context) { throw new IllegalStateException(ILLEGAL_ALLOW_MESSAGE); } DeferredCompositeCommand(final @MapsTo("reverse") boolean reverse); } | DeferredCompositeCommand extends AbstractCompositeCommand<T, V> { @Override public CommandResult<V> allow(final T context) { throw new IllegalStateException(ILLEGAL_ALLOW_MESSAGE); } DeferredCompositeCommand(final @MapsTo("reverse") boolean reverse); @Override CommandResult<V> allow(final T context); @Override CommandR... | DeferredCompositeCommand extends AbstractCompositeCommand<T, V> { @Override public CommandResult<V> allow(final T context) { throw new IllegalStateException(ILLEGAL_ALLOW_MESSAGE); } DeferredCompositeCommand(final @MapsTo("reverse") boolean reverse); @Override CommandResult<V> allow(final T context); @Override CommandR... |
@Test @SuppressWarnings("unchecked") public void testExecuteSuccessful() { Command c1 = mockCommand(SUCCESS, SUCCESS); Command c2 = mockCommand(SUCCESS, SUCCESS); Command c3 = mockCommand(SUCCESS, SUCCESS); Command c4 = mockCommand(SUCCESS, SUCCESS); compositeCommand = buildCompositeCommand(c1, c2, c3, c4); compositeCo... | @Override public CommandResult<V> execute(final T context) { return executeCommands(context); } | DeferredCompositeCommand extends AbstractCompositeCommand<T, V> { @Override public CommandResult<V> execute(final T context) { return executeCommands(context); } } | DeferredCompositeCommand extends AbstractCompositeCommand<T, V> { @Override public CommandResult<V> execute(final T context) { return executeCommands(context); } DeferredCompositeCommand(final @MapsTo("reverse") boolean reverse); } | DeferredCompositeCommand extends AbstractCompositeCommand<T, V> { @Override public CommandResult<V> execute(final T context) { return executeCommands(context); } DeferredCompositeCommand(final @MapsTo("reverse") boolean reverse); @Override CommandResult<V> allow(final T context); @Override CommandResult<V> execute(fina... | DeferredCompositeCommand extends AbstractCompositeCommand<T, V> { @Override public CommandResult<V> execute(final T context) { return executeCommands(context); } DeferredCompositeCommand(final @MapsTo("reverse") boolean reverse); @Override CommandResult<V> allow(final T context); @Override CommandResult<V> execute(fina... |
@Test @SuppressWarnings("unchecked") public void testExecuteWithExecutionFailure() { Command c1 = mockCommand(SUCCESS, SUCCESS); Command c2 = mockCommand(SUCCESS, failed()); Command c3 = mockCommand(SUCCESS, SUCCESS); Command c4 = mockCommand(SUCCESS, SUCCESS); compositeCommand = buildCompositeCommand(c1, c2, c3, c4); ... | @Override public CommandResult<V> execute(final T context) { return executeCommands(context); } | DeferredCompositeCommand extends AbstractCompositeCommand<T, V> { @Override public CommandResult<V> execute(final T context) { return executeCommands(context); } } | DeferredCompositeCommand extends AbstractCompositeCommand<T, V> { @Override public CommandResult<V> execute(final T context) { return executeCommands(context); } DeferredCompositeCommand(final @MapsTo("reverse") boolean reverse); } | DeferredCompositeCommand extends AbstractCompositeCommand<T, V> { @Override public CommandResult<V> execute(final T context) { return executeCommands(context); } DeferredCompositeCommand(final @MapsTo("reverse") boolean reverse); @Override CommandResult<V> allow(final T context); @Override CommandResult<V> execute(fina... | DeferredCompositeCommand extends AbstractCompositeCommand<T, V> { @Override public CommandResult<V> execute(final T context) { return executeCommands(context); } DeferredCompositeCommand(final @MapsTo("reverse") boolean reverse); @Override CommandResult<V> allow(final T context); @Override CommandResult<V> execute(fina... |
@Test public void testDelegateDeleteColumn() { uiModel.deleteColumn(gridColumn); verify(delegate).deleteColumn(eq(gridColumn)); } | @Override public void deleteColumn(final GridColumn<?> column) { delegate.deleteColumn(column); } | DelegatingGridData implements GridData { @Override public void deleteColumn(final GridColumn<?> column) { delegate.deleteColumn(column); } } | DelegatingGridData implements GridData { @Override public void deleteColumn(final GridColumn<?> column) { delegate.deleteColumn(column); } DelegatingGridData(final DMNGridData delegate); } | DelegatingGridData implements GridData { @Override public void deleteColumn(final GridColumn<?> column) { delegate.deleteColumn(column); } DelegatingGridData(final DMNGridData delegate); @Override void moveRowTo(final int index,
final GridRow row); @Override void moveRowsTo(final int index,
... | DelegatingGridData implements GridData { @Override public void deleteColumn(final GridColumn<?> column) { delegate.deleteColumn(column); } DelegatingGridData(final DMNGridData delegate); @Override void moveRowTo(final int index,
final GridRow row); @Override void moveRowsTo(final int index,
... |
@Test public void testAllow() { when(command.allow(context)).thenReturn(commandResult); CommandResult<Object> result = tested.allow(context, command); verify(command, times(1)).allow(eq(context)); verify(command, times(0)).execute(anyObject()); verify(command, times(0)).undo(anyObject()); assertNotNull(result); assertE... | @Override public CommandResult<V> allow(final C context, final Command<C, V> command) { return command.allow(context); } | CommandManagerImpl implements CommandManager<C, V> { @Override public CommandResult<V> allow(final C context, final Command<C, V> command) { return command.allow(context); } } | CommandManagerImpl implements CommandManager<C, V> { @Override public CommandResult<V> allow(final C context, final Command<C, V> command) { return command.allow(context); } CommandManagerImpl(); } | CommandManagerImpl implements CommandManager<C, V> { @Override public CommandResult<V> allow(final C context, final Command<C, V> command) { return command.allow(context); } CommandManagerImpl(); @Override CommandResult<V> allow(final C context,
final Command<C, V> command); @Override ... | CommandManagerImpl implements CommandManager<C, V> { @Override public CommandResult<V> allow(final C context, final Command<C, V> command) { return command.allow(context); } CommandManagerImpl(); @Override CommandResult<V> allow(final C context,
final Command<C, V> command); @Override ... |
@Test public void testExecute() { when(command.execute(context)).thenReturn(commandResult); CommandResult<Object> result = tested.execute(context, command); verify(command, times(1)).execute(eq(context)); verify(command, times(0)).allow(anyObject()); verify(command, times(0)).undo(anyObject()); assertNotNull(result); a... | @Override public CommandResult<V> execute(final C context, final Command<C, V> command) { return command.execute(context); } | CommandManagerImpl implements CommandManager<C, V> { @Override public CommandResult<V> execute(final C context, final Command<C, V> command) { return command.execute(context); } } | CommandManagerImpl implements CommandManager<C, V> { @Override public CommandResult<V> execute(final C context, final Command<C, V> command) { return command.execute(context); } CommandManagerImpl(); } | CommandManagerImpl implements CommandManager<C, V> { @Override public CommandResult<V> execute(final C context, final Command<C, V> command) { return command.execute(context); } CommandManagerImpl(); @Override CommandResult<V> allow(final C context,
final Command<C, V> command); @Overr... | CommandManagerImpl implements CommandManager<C, V> { @Override public CommandResult<V> execute(final C context, final Command<C, V> command) { return command.execute(context); } CommandManagerImpl(); @Override CommandResult<V> allow(final C context,
final Command<C, V> command); @Overr... |
@Test public void testUndo() { when(command.undo(context)).thenReturn(commandResult); CommandResult<Object> result = tested.undo(context, command); verify(command, times(1)).undo(eq(context)); verify(command, times(0)).execute(anyObject()); verify(command, times(0)).allow(anyObject()); assertNotNull(result); assertEqua... | @Override public CommandResult<V> undo(final C context, final Command<C, V> command) { return command.undo(context); } | CommandManagerImpl implements CommandManager<C, V> { @Override public CommandResult<V> undo(final C context, final Command<C, V> command) { return command.undo(context); } } | CommandManagerImpl implements CommandManager<C, V> { @Override public CommandResult<V> undo(final C context, final Command<C, V> command) { return command.undo(context); } CommandManagerImpl(); } | CommandManagerImpl implements CommandManager<C, V> { @Override public CommandResult<V> undo(final C context, final Command<C, V> command) { return command.undo(context); } CommandManagerImpl(); @Override CommandResult<V> allow(final C context,
final Command<C, V> command); @Override Co... | CommandManagerImpl implements CommandManager<C, V> { @Override public CommandResult<V> undo(final C context, final Command<C, V> command) { return command.undo(context); } CommandManagerImpl(); @Override CommandResult<V> allow(final C context,
final Command<C, V> command); @Override Co... |
@Test public void testGetAllProfiles() { Collection<Profile> allProfiles = tested.getAllProfiles(); assertEquals(2, allProfiles.size()); assertTrue(allProfiles.contains(defaultProfile)); assertTrue(allProfiles.contains(domainProfile)); } | @Override public Collection<Profile> getAllProfiles() { final List<Profile> result = new ArrayList<>(); getAllProfileInstances().forEach(result::add); return result; } | AbstractProfileManager implements ProfileManager { @Override public Collection<Profile> getAllProfiles() { final List<Profile> result = new ArrayList<>(); getAllProfileInstances().forEach(result::add); return result; } } | AbstractProfileManager implements ProfileManager { @Override public Collection<Profile> getAllProfiles() { final List<Profile> result = new ArrayList<>(); getAllProfileInstances().forEach(result::add); return result; } } | AbstractProfileManager implements ProfileManager { @Override public Collection<Profile> getAllProfiles() { final List<Profile> result = new ArrayList<>(); getAllProfileInstances().forEach(result::add); return result; } @Override Collection<Profile> getAllProfiles(); @Override Profile getProfile(final String id); @Over... | AbstractProfileManager implements ProfileManager { @Override public Collection<Profile> getAllProfiles() { final List<Profile> result = new ArrayList<>(); getAllProfileInstances().forEach(result::add); return result; } @Override Collection<Profile> getAllProfiles(); @Override Profile getProfile(final String id); @Over... |
@Test public void testGetProfileById() { assertEquals(defaultProfile, tested.getProfile(PROFILE_DEFAULT_ID)); assertEquals(domainProfile, tested.getProfile(PROFILE_DOMAIN_ID)); assertNull(tested.getProfile("someOtherId")); } | @Override public Profile getProfile(final String id) { return null != id ? getAllProfiles().stream().filter(profile -> profile.getProfileId().equals(id)).findFirst().orElse(null) : null; } | AbstractProfileManager implements ProfileManager { @Override public Profile getProfile(final String id) { return null != id ? getAllProfiles().stream().filter(profile -> profile.getProfileId().equals(id)).findFirst().orElse(null) : null; } } | AbstractProfileManager implements ProfileManager { @Override public Profile getProfile(final String id) { return null != id ? getAllProfiles().stream().filter(profile -> profile.getProfileId().equals(id)).findFirst().orElse(null) : null; } } | AbstractProfileManager implements ProfileManager { @Override public Profile getProfile(final String id) { return null != id ? getAllProfiles().stream().filter(profile -> profile.getProfileId().equals(id)).findFirst().orElse(null) : null; } @Override Collection<Profile> getAllProfiles(); @Override Profile getProfile(fi... | AbstractProfileManager implements ProfileManager { @Override public Profile getProfile(final String id) { return null != id ? getAllProfiles().stream().filter(profile -> profile.getProfileId().equals(id)).findFirst().orElse(null) : null; } @Override Collection<Profile> getAllProfiles(); @Override Profile getProfile(fi... |
@Test public void testGetProfilesByDomain() { Collection<Profile> domainProfiles = tested.getProfiles(DEF_SET_ID); assertEquals(2, domainProfiles.size()); assertTrue(domainProfiles.contains(defaultProfile)); assertTrue(domainProfiles.contains(domainProfile)); } | @Override public Collection<Profile> getProfiles(final String definitionSetId) { final Annotation qualifier = getQualifier().apply(definitionSetId); final List<Profile> result = new ArrayList<>(); selectProfileInstances(qualifier).forEach(result::add); result.add(getDefaultProfileInstance()); return result; } | AbstractProfileManager implements ProfileManager { @Override public Collection<Profile> getProfiles(final String definitionSetId) { final Annotation qualifier = getQualifier().apply(definitionSetId); final List<Profile> result = new ArrayList<>(); selectProfileInstances(qualifier).forEach(result::add); result.add(getDe... | AbstractProfileManager implements ProfileManager { @Override public Collection<Profile> getProfiles(final String definitionSetId) { final Annotation qualifier = getQualifier().apply(definitionSetId); final List<Profile> result = new ArrayList<>(); selectProfileInstances(qualifier).forEach(result::add); result.add(getDe... | AbstractProfileManager implements ProfileManager { @Override public Collection<Profile> getProfiles(final String definitionSetId) { final Annotation qualifier = getQualifier().apply(definitionSetId); final List<Profile> result = new ArrayList<>(); selectProfileInstances(qualifier).forEach(result::add); result.add(getDe... | AbstractProfileManager implements ProfileManager { @Override public Collection<Profile> getProfiles(final String definitionSetId) { final Annotation qualifier = getQualifier().apply(definitionSetId); final List<Profile> result = new ArrayList<>(); selectProfileInstances(qualifier).forEach(result::add); result.add(getDe... |
@Test public void testGetProfileByDomainAndId() { assertEquals(defaultProfile, tested.getProfile(DEF_SET_ID, PROFILE_DEFAULT_ID)); assertEquals(domainProfile, tested.getProfile(DEF_SET_ID, PROFILE_DOMAIN_ID)); } | @Override public Profile getProfile(final String id) { return null != id ? getAllProfiles().stream().filter(profile -> profile.getProfileId().equals(id)).findFirst().orElse(null) : null; } | AbstractProfileManager implements ProfileManager { @Override public Profile getProfile(final String id) { return null != id ? getAllProfiles().stream().filter(profile -> profile.getProfileId().equals(id)).findFirst().orElse(null) : null; } } | AbstractProfileManager implements ProfileManager { @Override public Profile getProfile(final String id) { return null != id ? getAllProfiles().stream().filter(profile -> profile.getProfileId().equals(id)).findFirst().orElse(null) : null; } } | AbstractProfileManager implements ProfileManager { @Override public Profile getProfile(final String id) { return null != id ? getAllProfiles().stream().filter(profile -> profile.getProfileId().equals(id)).findFirst().orElse(null) : null; } @Override Collection<Profile> getAllProfiles(); @Override Profile getProfile(fi... | AbstractProfileManager implements ProfileManager { @Override public Profile getProfile(final String id) { return null != id ? getAllProfiles().stream().filter(profile -> profile.getProfileId().equals(id)).findFirst().orElse(null) : null; } @Override Collection<Profile> getAllProfiles(); @Override Profile getProfile(fi... |
@Test public void testGetAllDefinitions() { when(metadata.getProfileId()).thenReturn(DEFAULT_PROFILE.getProfileId()); List<String> allDefinitions = tested.getAllDefinitions(metadata); assertEquals(2, allDefinitions.size()); assertTrue(allDefinitions.contains(DEF1)); assertTrue(allDefinitions.contains(DEF2)); when(metad... | public List<String> getAllDefinitions(final Metadata metadata) { return getDefinitionsByProfile(metadata.getDefinitionSetId(), metadata.getProfileId()); } | DomainProfileManager { public List<String> getAllDefinitions(final Metadata metadata) { return getDefinitionsByProfile(metadata.getDefinitionSetId(), metadata.getProfileId()); } } | DomainProfileManager { public List<String> getAllDefinitions(final Metadata metadata) { return getDefinitionsByProfile(metadata.getDefinitionSetId(), metadata.getProfileId()); } @Inject DomainProfileManager(final DefinitionManager definitionManager,
final ProfileManager profileManager,
... | DomainProfileManager { public List<String> getAllDefinitions(final Metadata metadata) { return getDefinitionsByProfile(metadata.getDefinitionSetId(), metadata.getProfileId()); } @Inject DomainProfileManager(final DefinitionManager definitionManager,
final ProfileManager profileManager,
... | DomainProfileManager { public List<String> getAllDefinitions(final Metadata metadata) { return getDefinitionsByProfile(metadata.getDefinitionSetId(), metadata.getProfileId()); } @Inject DomainProfileManager(final DefinitionManager definitionManager,
final ProfileManager profileManager,
... |
@Test public void testIsDefinitionAllowed() { when(metadata.getProfileId()).thenReturn(DEFAULT_PROFILE.getProfileId()); assertTrue(tested.isDefinitionIdAllowed(metadata).test(DEF1)); assertTrue(tested.isDefinitionIdAllowed(metadata).test(DEF2)); when(metadata.getProfileId()).thenReturn(PROFILE_DOMAIN_ID); assertTrue(te... | public Predicate<String> isDefinitionIdAllowed(final Metadata metadata) { return getDefinitionProfile(metadata) .map(DomainProfile::definitionAllowedFilter) .orElse(defaultProfile.definitionAllowedFilter()); } | DomainProfileManager { public Predicate<String> isDefinitionIdAllowed(final Metadata metadata) { return getDefinitionProfile(metadata) .map(DomainProfile::definitionAllowedFilter) .orElse(defaultProfile.definitionAllowedFilter()); } } | DomainProfileManager { public Predicate<String> isDefinitionIdAllowed(final Metadata metadata) { return getDefinitionProfile(metadata) .map(DomainProfile::definitionAllowedFilter) .orElse(defaultProfile.definitionAllowedFilter()); } @Inject DomainProfileManager(final DefinitionManager definitionManager,
... | DomainProfileManager { public Predicate<String> isDefinitionIdAllowed(final Metadata metadata) { return getDefinitionProfile(metadata) .map(DomainProfile::definitionAllowedFilter) .orElse(defaultProfile.definitionAllowedFilter()); } @Inject DomainProfileManager(final DefinitionManager definitionManager,
... | DomainProfileManager { public Predicate<String> isDefinitionIdAllowed(final Metadata metadata) { return getDefinitionProfile(metadata) .map(DomainProfile::definitionAllowedFilter) .orElse(defaultProfile.definitionAllowedFilter()); } @Inject DomainProfileManager(final DefinitionManager definitionManager,
... |
@Test @SuppressWarnings("unchecked") public void hasChildrenTest() { boolean hasChildren = GraphUtils.hasChildren(graphInstance.parentNode); assertTrue(hasChildren); } | @SuppressWarnings("unchecked") public static boolean hasChildren(final Node<?, ? extends Edge> element) { return Objects.nonNull(element.getOutEdges()) ? element.getOutEdges().stream() .anyMatch(edge -> (edge.getContent() instanceof Child)) : false; } | GraphUtils { @SuppressWarnings("unchecked") public static boolean hasChildren(final Node<?, ? extends Edge> element) { return Objects.nonNull(element.getOutEdges()) ? element.getOutEdges().stream() .anyMatch(edge -> (edge.getContent() instanceof Child)) : false; } } | GraphUtils { @SuppressWarnings("unchecked") public static boolean hasChildren(final Node<?, ? extends Edge> element) { return Objects.nonNull(element.getOutEdges()) ? element.getOutEdges().stream() .anyMatch(edge -> (edge.getContent() instanceof Child)) : false; } } | GraphUtils { @SuppressWarnings("unchecked") public static boolean hasChildren(final Node<?, ? extends Edge> element) { return Objects.nonNull(element.getOutEdges()) ? element.getOutEdges().stream() .anyMatch(edge -> (edge.getContent() instanceof Child)) : false; } static int countEdges(final DefinitionManager definiti... | GraphUtils { @SuppressWarnings("unchecked") public static boolean hasChildren(final Node<?, ? extends Edge> element) { return Objects.nonNull(element.getOutEdges()) ? element.getOutEdges().stream() .anyMatch(edge -> (edge.getContent() instanceof Child)) : false; } static int countEdges(final DefinitionManager definiti... |
@Test public void testDelegateGetRows() { uiModel.getRows(); verify(delegate).getRows(); } | @Override public List<GridRow> getRows() { return delegate.getRows(); } | DelegatingGridData implements GridData { @Override public List<GridRow> getRows() { return delegate.getRows(); } } | DelegatingGridData implements GridData { @Override public List<GridRow> getRows() { return delegate.getRows(); } DelegatingGridData(final DMNGridData delegate); } | DelegatingGridData implements GridData { @Override public List<GridRow> getRows() { return delegate.getRows(); } DelegatingGridData(final DMNGridData delegate); @Override void moveRowTo(final int index,
final GridRow row); @Override void moveRowsTo(final int index,
f... | DelegatingGridData implements GridData { @Override public List<GridRow> getRows() { return delegate.getRows(); } DelegatingGridData(final DMNGridData delegate); @Override void moveRowTo(final int index,
final GridRow row); @Override void moveRowsTo(final int index,
f... |
@Test @SuppressWarnings("unchecked") public void notHasChildrenTest() { boolean hasChildren = GraphUtils.hasChildren(graphInstance.startNode); assertFalse(hasChildren); } | @SuppressWarnings("unchecked") public static boolean hasChildren(final Node<?, ? extends Edge> element) { return Objects.nonNull(element.getOutEdges()) ? element.getOutEdges().stream() .anyMatch(edge -> (edge.getContent() instanceof Child)) : false; } | GraphUtils { @SuppressWarnings("unchecked") public static boolean hasChildren(final Node<?, ? extends Edge> element) { return Objects.nonNull(element.getOutEdges()) ? element.getOutEdges().stream() .anyMatch(edge -> (edge.getContent() instanceof Child)) : false; } } | GraphUtils { @SuppressWarnings("unchecked") public static boolean hasChildren(final Node<?, ? extends Edge> element) { return Objects.nonNull(element.getOutEdges()) ? element.getOutEdges().stream() .anyMatch(edge -> (edge.getContent() instanceof Child)) : false; } } | GraphUtils { @SuppressWarnings("unchecked") public static boolean hasChildren(final Node<?, ? extends Edge> element) { return Objects.nonNull(element.getOutEdges()) ? element.getOutEdges().stream() .anyMatch(edge -> (edge.getContent() instanceof Child)) : false; } static int countEdges(final DefinitionManager definiti... | GraphUtils { @SuppressWarnings("unchecked") public static boolean hasChildren(final Node<?, ? extends Edge> element) { return Objects.nonNull(element.getOutEdges()) ? element.getOutEdges().stream() .anyMatch(edge -> (edge.getContent() instanceof Child)) : false; } static int countEdges(final DefinitionManager definiti... |
@Test @SuppressWarnings("unchecked") public void countChildrenTest() { Long countChildren = GraphUtils.countChildren(graphInstance.parentNode); assertEquals(Long.valueOf(4), countChildren); } | @SuppressWarnings("unchecked") public static Long countChildren(final Node<?, ? extends Edge> element) { return element.getOutEdges().stream() .filter(edge -> (edge.getContent() instanceof Child)).count(); } | GraphUtils { @SuppressWarnings("unchecked") public static Long countChildren(final Node<?, ? extends Edge> element) { return element.getOutEdges().stream() .filter(edge -> (edge.getContent() instanceof Child)).count(); } } | GraphUtils { @SuppressWarnings("unchecked") public static Long countChildren(final Node<?, ? extends Edge> element) { return element.getOutEdges().stream() .filter(edge -> (edge.getContent() instanceof Child)).count(); } } | GraphUtils { @SuppressWarnings("unchecked") public static Long countChildren(final Node<?, ? extends Edge> element) { return element.getOutEdges().stream() .filter(edge -> (edge.getContent() instanceof Child)).count(); } static int countEdges(final DefinitionManager definitionManager,
... | GraphUtils { @SuppressWarnings("unchecked") public static Long countChildren(final Node<?, ? extends Edge> element) { return element.getOutEdges().stream() .filter(edge -> (edge.getContent() instanceof Child)).count(); } static int countEdges(final DefinitionManager definitionManager,
... |
@Test public void checkBoundsExceededTest() { Bounds parentBounds = Bounds.create(50d, 50d, 200d, 200d); Bounds childBounds = Bounds.create(51d, 51d, 199d, 199d); assertTrue(GraphUtils.checkBoundsExceeded(parentBounds, childBounds)); childBounds = Bounds.create(51d, 51d, 200d, 200d); assertTrue(GraphUtils.checkBoundsEx... | public static boolean checkBoundsExceeded(final Bounds parentBounds, final Bounds bounds) { if (null == parentBounds) { return true; } if (parentBounds.hasUpperLeft()) { if ((bounds.getUpperLeft().getX() < parentBounds.getUpperLeft().getX()) || (bounds.getUpperLeft().getY() < parentBounds.getUpperLeft().getY())) { retu... | GraphUtils { public static boolean checkBoundsExceeded(final Bounds parentBounds, final Bounds bounds) { if (null == parentBounds) { return true; } if (parentBounds.hasUpperLeft()) { if ((bounds.getUpperLeft().getX() < parentBounds.getUpperLeft().getX()) || (bounds.getUpperLeft().getY() < parentBounds.getUpperLeft().ge... | GraphUtils { public static boolean checkBoundsExceeded(final Bounds parentBounds, final Bounds bounds) { if (null == parentBounds) { return true; } if (parentBounds.hasUpperLeft()) { if ((bounds.getUpperLeft().getX() < parentBounds.getUpperLeft().getX()) || (bounds.getUpperLeft().getY() < parentBounds.getUpperLeft().ge... | GraphUtils { public static boolean checkBoundsExceeded(final Bounds parentBounds, final Bounds bounds) { if (null == parentBounds) { return true; } if (parentBounds.hasUpperLeft()) { if ((bounds.getUpperLeft().getX() < parentBounds.getUpperLeft().getX()) || (bounds.getUpperLeft().getY() < parentBounds.getUpperLeft().ge... | GraphUtils { public static boolean checkBoundsExceeded(final Bounds parentBounds, final Bounds bounds) { if (null == parentBounds) { return true; } if (parentBounds.hasUpperLeft()) { if ((bounds.getUpperLeft().getX() < parentBounds.getUpperLeft().getX()) || (bounds.getUpperLeft().getY() < parentBounds.getUpperLeft().ge... |
@Test @SuppressWarnings("unchecked") public void isDockedNodeTest() { assertTrue(GraphUtils.isDockedNode(graphInstance.dockedNode)); assertFalse(GraphUtils.isDockedNode(graphInstance.startNode)); assertFalse(GraphUtils.isDockedNode(graphInstance.intermNode)); assertFalse(GraphUtils.isDockedNode(graphInstance.endNode));... | public static boolean isDockedNode(final Node<?, ? extends Edge> element) { return Objects.nonNull(element.getInEdges()) ? element.getInEdges() .stream() .anyMatch(edge -> edge.getContent() instanceof Dock) : false; } | GraphUtils { public static boolean isDockedNode(final Node<?, ? extends Edge> element) { return Objects.nonNull(element.getInEdges()) ? element.getInEdges() .stream() .anyMatch(edge -> edge.getContent() instanceof Dock) : false; } } | GraphUtils { public static boolean isDockedNode(final Node<?, ? extends Edge> element) { return Objects.nonNull(element.getInEdges()) ? element.getInEdges() .stream() .anyMatch(edge -> edge.getContent() instanceof Dock) : false; } } | GraphUtils { public static boolean isDockedNode(final Node<?, ? extends Edge> element) { return Objects.nonNull(element.getInEdges()) ? element.getInEdges() .stream() .anyMatch(edge -> edge.getContent() instanceof Dock) : false; } static int countEdges(final DefinitionManager definitionManager,
... | GraphUtils { public static boolean isDockedNode(final Node<?, ? extends Edge> element) { return Objects.nonNull(element.getInEdges()) ? element.getInEdges() .stream() .anyMatch(edge -> edge.getContent() instanceof Dock) : false; } static int countEdges(final DefinitionManager definitionManager,
... |
@Test @SuppressWarnings("unchecked") public void getDockedNodesTest() { List<Node> dockedNodes = GraphUtils.getDockedNodes(graphInstance.intermNode); assertEquals(dockedNodes.size(), 1); assertEquals(dockedNodes.get(0), graphInstance.dockedNode); } | public static List<Node> getDockedNodes(final Node<?, ? extends Edge> element) { return getNodesFromOutEdges(element, edge -> (edge.getContent() instanceof Dock)); } | GraphUtils { public static List<Node> getDockedNodes(final Node<?, ? extends Edge> element) { return getNodesFromOutEdges(element, edge -> (edge.getContent() instanceof Dock)); } } | GraphUtils { public static List<Node> getDockedNodes(final Node<?, ? extends Edge> element) { return getNodesFromOutEdges(element, edge -> (edge.getContent() instanceof Dock)); } } | GraphUtils { public static List<Node> getDockedNodes(final Node<?, ? extends Edge> element) { return getNodesFromOutEdges(element, edge -> (edge.getContent() instanceof Dock)); } static int countEdges(final DefinitionManager definitionManager,
final String edgeId,
... | GraphUtils { public static List<Node> getDockedNodes(final Node<?, ? extends Edge> element) { return getNodesFromOutEdges(element, edge -> (edge.getContent() instanceof Dock)); } static int countEdges(final DefinitionManager definitionManager,
final String edgeId,
... |
@Test @SuppressWarnings("unchecked") public void getChildNodesTest() { List<Node> dockedNodes = GraphUtils.getChildNodes(graphInstance.parentNode); assertEquals(dockedNodes.size(), 4); assertEquals(dockedNodes.get(0), graphInstance.startNode); assertEquals(dockedNodes.get(1), graphInstance.intermNode); assertEquals(doc... | public static List<Node> getChildNodes(final Node<?, ? extends Edge> element) { return getNodesFromOutEdges(element, edge -> (edge.getContent() instanceof Child)); } | GraphUtils { public static List<Node> getChildNodes(final Node<?, ? extends Edge> element) { return getNodesFromOutEdges(element, edge -> (edge.getContent() instanceof Child)); } } | GraphUtils { public static List<Node> getChildNodes(final Node<?, ? extends Edge> element) { return getNodesFromOutEdges(element, edge -> (edge.getContent() instanceof Child)); } } | GraphUtils { public static List<Node> getChildNodes(final Node<?, ? extends Edge> element) { return getNodesFromOutEdges(element, edge -> (edge.getContent() instanceof Child)); } static int countEdges(final DefinitionManager definitionManager,
final String edgeId,
... | GraphUtils { public static List<Node> getChildNodes(final Node<?, ? extends Edge> element) { return getNodesFromOutEdges(element, edge -> (edge.getContent() instanceof Child)); } static int countEdges(final DefinitionManager definitionManager,
final String edgeId,
... |
@Test @SuppressWarnings("unchecked") public void testGetChildIndex() { final OptionalInt index1 = GraphUtils.getChildIndex(graphInstance.parentNode, TestingGraphInstanceBuilder.START_NODE_UUID); assertTrue(index1.isPresent()); assertEquals(0, index1.getAsInt()); final OptionalInt index2 = GraphUtils.getChildIndex(graph... | public static OptionalInt getChildIndex(final Element element, final String uuid) { if (!(element instanceof Node)) { return OptionalInt.empty(); } final Node<?, ?> node = (Node<?, ? extends Edge>) element; return Objects.nonNull(node.getOutEdges()) ? IntStream.range(0, node.getOutEdges().size()) .filter(i -> uuid.equa... | GraphUtils { public static OptionalInt getChildIndex(final Element element, final String uuid) { if (!(element instanceof Node)) { return OptionalInt.empty(); } final Node<?, ?> node = (Node<?, ? extends Edge>) element; return Objects.nonNull(node.getOutEdges()) ? IntStream.range(0, node.getOutEdges().size()) .filter(i... | GraphUtils { public static OptionalInt getChildIndex(final Element element, final String uuid) { if (!(element instanceof Node)) { return OptionalInt.empty(); } final Node<?, ?> node = (Node<?, ? extends Edge>) element; return Objects.nonNull(node.getOutEdges()) ? IntStream.range(0, node.getOutEdges().size()) .filter(i... | GraphUtils { public static OptionalInt getChildIndex(final Element element, final String uuid) { if (!(element instanceof Node)) { return OptionalInt.empty(); } final Node<?, ?> node = (Node<?, ? extends Edge>) element; return Objects.nonNull(node.getOutEdges()) ? IntStream.range(0, node.getOutEdges().size()) .filter(i... | GraphUtils { public static OptionalInt getChildIndex(final Element element, final String uuid) { if (!(element instanceof Node)) { return OptionalInt.empty(); } final Node<?, ?> node = (Node<?, ? extends Edge>) element; return Objects.nonNull(node.getOutEdges()) ? IntStream.range(0, node.getOutEdges().size()) .filter(i... |
@SuppressWarnings("unchecked") @Test public void testComputeCardinalityState() { String canvasRootUUID = "rootUUID"; Node rootNode = new NodeImpl<>(canvasRootUUID); Node node1 = new NodeImpl<>("node1"); Node node2 = new NodeImpl<>("node2"); Node node3 = new NodeImpl<>("node3"); Metadata metadata = new MetadataImpl(); m... | public static CardinalityCountState computeCardinalityState(final Diagram diagram) { final String rootUUID = diagram.getMetadata().getCanvasRootUUID(); final Graph graph = diagram.getGraph(); final Iterator nodes = graph.nodes().iterator(); final Node firstElement = nodes.hasNext() ? ((Element) nodes.next()).asNode() :... | GraphUtils { public static CardinalityCountState computeCardinalityState(final Diagram diagram) { final String rootUUID = diagram.getMetadata().getCanvasRootUUID(); final Graph graph = diagram.getGraph(); final Iterator nodes = graph.nodes().iterator(); final Node firstElement = nodes.hasNext() ? ((Element) nodes.next(... | GraphUtils { public static CardinalityCountState computeCardinalityState(final Diagram diagram) { final String rootUUID = diagram.getMetadata().getCanvasRootUUID(); final Graph graph = diagram.getGraph(); final Iterator nodes = graph.nodes().iterator(); final Node firstElement = nodes.hasNext() ? ((Element) nodes.next(... | GraphUtils { public static CardinalityCountState computeCardinalityState(final Diagram diagram) { final String rootUUID = diagram.getMetadata().getCanvasRootUUID(); final Graph graph = diagram.getGraph(); final Iterator nodes = graph.nodes().iterator(); final Node firstElement = nodes.hasNext() ? ((Element) nodes.next(... | GraphUtils { public static CardinalityCountState computeCardinalityState(final Diagram diagram) { final String rootUUID = diagram.getMetadata().getCanvasRootUUID(); final Graph graph = diagram.getGraph(); final Iterator nodes = graph.nodes().iterator(); final Node firstElement = nodes.hasNext() ? ((Element) nodes.next(... |
@Test public void testValidCheckAddControlPoint() { ControlPoint cp = ControlPoint.build(1, 1); checkAddControlPoint(controlPoints, cp, 0); checkAddControlPoint(controlPoints, cp, 1); } | public static void checkAddControlPoint(final ControlPoint[] controlPoints, final ControlPoint controlPoint, final int index) { if (isControlPointIndexInvalid.test(index)) { throw new IllegalArgumentException("The given index [" + index + "] for the new CP is not valid."); } if (isAddingControlPointIndexForbidden.test(... | ControlPointValidations { public static void checkAddControlPoint(final ControlPoint[] controlPoints, final ControlPoint controlPoint, final int index) { if (isControlPointIndexInvalid.test(index)) { throw new IllegalArgumentException("The given index [" + index + "] for the new CP is not valid."); } if (isAddingContro... | ControlPointValidations { public static void checkAddControlPoint(final ControlPoint[] controlPoints, final ControlPoint controlPoint, final int index) { if (isControlPointIndexInvalid.test(index)) { throw new IllegalArgumentException("The given index [" + index + "] for the new CP is not valid."); } if (isAddingContro... | ControlPointValidations { public static void checkAddControlPoint(final ControlPoint[] controlPoints, final ControlPoint controlPoint, final int index) { if (isControlPointIndexInvalid.test(index)) { throw new IllegalArgumentException("The given index [" + index + "] for the new CP is not valid."); } if (isAddingContro... | ControlPointValidations { public static void checkAddControlPoint(final ControlPoint[] controlPoints, final ControlPoint controlPoint, final int index) { if (isControlPointIndexInvalid.test(index)) { throw new IllegalArgumentException("The given index [" + index + "] for the new CP is not valid."); } if (isAddingContro... |
@Test(expected = IllegalArgumentException.class) public void testInvalidCheckAddControlPoint() { ControlPoint cp = ControlPoint.build(1, 1); checkAddControlPoint(controlPoints, cp, 2); } | public static void checkAddControlPoint(final ControlPoint[] controlPoints, final ControlPoint controlPoint, final int index) { if (isControlPointIndexInvalid.test(index)) { throw new IllegalArgumentException("The given index [" + index + "] for the new CP is not valid."); } if (isAddingControlPointIndexForbidden.test(... | ControlPointValidations { public static void checkAddControlPoint(final ControlPoint[] controlPoints, final ControlPoint controlPoint, final int index) { if (isControlPointIndexInvalid.test(index)) { throw new IllegalArgumentException("The given index [" + index + "] for the new CP is not valid."); } if (isAddingContro... | ControlPointValidations { public static void checkAddControlPoint(final ControlPoint[] controlPoints, final ControlPoint controlPoint, final int index) { if (isControlPointIndexInvalid.test(index)) { throw new IllegalArgumentException("The given index [" + index + "] for the new CP is not valid."); } if (isAddingContro... | ControlPointValidations { public static void checkAddControlPoint(final ControlPoint[] controlPoints, final ControlPoint controlPoint, final int index) { if (isControlPointIndexInvalid.test(index)) { throw new IllegalArgumentException("The given index [" + index + "] for the new CP is not valid."); } if (isAddingContro... | ControlPointValidations { public static void checkAddControlPoint(final ControlPoint[] controlPoints, final ControlPoint controlPoint, final int index) { if (isControlPointIndexInvalid.test(index)) { throw new IllegalArgumentException("The given index [" + index + "] for the new CP is not valid."); } if (isAddingContro... |
@Test public void testDelegateExpandCell() { uiModel.expandCell(0, 1); verify(delegate).expandCell(eq(0), eq(1)); } | @Override public void expandCell(final int rowIndex, final int columnIndex) { delegate.expandCell(rowIndex, columnIndex); } | DelegatingGridData implements GridData { @Override public void expandCell(final int rowIndex, final int columnIndex) { delegate.expandCell(rowIndex, columnIndex); } } | DelegatingGridData implements GridData { @Override public void expandCell(final int rowIndex, final int columnIndex) { delegate.expandCell(rowIndex, columnIndex); } DelegatingGridData(final DMNGridData delegate); } | DelegatingGridData implements GridData { @Override public void expandCell(final int rowIndex, final int columnIndex) { delegate.expandCell(rowIndex, columnIndex); } DelegatingGridData(final DMNGridData delegate); @Override void moveRowTo(final int index,
final GridRow row); @Override void move... | DelegatingGridData implements GridData { @Override public void expandCell(final int rowIndex, final int columnIndex) { delegate.expandCell(rowIndex, columnIndex); } DelegatingGridData(final DMNGridData delegate); @Override void moveRowTo(final int index,
final GridRow row); @Override void move... |
@Test(expected = IllegalArgumentException.class) public void testInvalidCheckAddControlPoint2() { ControlPoint cp = ControlPoint.build(1, 1); checkAddControlPoint(controlPoints, cp, 3); } | public static void checkAddControlPoint(final ControlPoint[] controlPoints, final ControlPoint controlPoint, final int index) { if (isControlPointIndexInvalid.test(index)) { throw new IllegalArgumentException("The given index [" + index + "] for the new CP is not valid."); } if (isAddingControlPointIndexForbidden.test(... | ControlPointValidations { public static void checkAddControlPoint(final ControlPoint[] controlPoints, final ControlPoint controlPoint, final int index) { if (isControlPointIndexInvalid.test(index)) { throw new IllegalArgumentException("The given index [" + index + "] for the new CP is not valid."); } if (isAddingContro... | ControlPointValidations { public static void checkAddControlPoint(final ControlPoint[] controlPoints, final ControlPoint controlPoint, final int index) { if (isControlPointIndexInvalid.test(index)) { throw new IllegalArgumentException("The given index [" + index + "] for the new CP is not valid."); } if (isAddingContro... | ControlPointValidations { public static void checkAddControlPoint(final ControlPoint[] controlPoints, final ControlPoint controlPoint, final int index) { if (isControlPointIndexInvalid.test(index)) { throw new IllegalArgumentException("The given index [" + index + "] for the new CP is not valid."); } if (isAddingContro... | ControlPointValidations { public static void checkAddControlPoint(final ControlPoint[] controlPoints, final ControlPoint controlPoint, final int index) { if (isControlPointIndexInvalid.test(index)) { throw new IllegalArgumentException("The given index [" + index + "] for the new CP is not valid."); } if (isAddingContro... |
@Test public void testValidCheckDeleteControlPoint() { checkDeleteControlPoint(controlPoints, 0); } | public static void checkDeleteControlPoint(final ControlPoint[] controlPoints, final int index) { if (isControlPointIndexInvalid.test(index)) { throw new IllegalArgumentException("The given index [" + index + "] for the new CP is not valid."); } if (isDeletingControlPointIndexForbidden.test(controlPoints, index)) { thr... | ControlPointValidations { public static void checkDeleteControlPoint(final ControlPoint[] controlPoints, final int index) { if (isControlPointIndexInvalid.test(index)) { throw new IllegalArgumentException("The given index [" + index + "] for the new CP is not valid."); } if (isDeletingControlPointIndexForbidden.test(co... | ControlPointValidations { public static void checkDeleteControlPoint(final ControlPoint[] controlPoints, final int index) { if (isControlPointIndexInvalid.test(index)) { throw new IllegalArgumentException("The given index [" + index + "] for the new CP is not valid."); } if (isDeletingControlPointIndexForbidden.test(co... | ControlPointValidations { public static void checkDeleteControlPoint(final ControlPoint[] controlPoints, final int index) { if (isControlPointIndexInvalid.test(index)) { throw new IllegalArgumentException("The given index [" + index + "] for the new CP is not valid."); } if (isDeletingControlPointIndexForbidden.test(co... | ControlPointValidations { public static void checkDeleteControlPoint(final ControlPoint[] controlPoints, final int index) { if (isControlPointIndexInvalid.test(index)) { throw new IllegalArgumentException("The given index [" + index + "] for the new CP is not valid."); } if (isDeletingControlPointIndexForbidden.test(co... |
@Test(expected = IllegalArgumentException.class) public void testInvalidCheckDeleteControlPoint() { checkDeleteControlPoint(controlPoints, 1); } | public static void checkDeleteControlPoint(final ControlPoint[] controlPoints, final int index) { if (isControlPointIndexInvalid.test(index)) { throw new IllegalArgumentException("The given index [" + index + "] for the new CP is not valid."); } if (isDeletingControlPointIndexForbidden.test(controlPoints, index)) { thr... | ControlPointValidations { public static void checkDeleteControlPoint(final ControlPoint[] controlPoints, final int index) { if (isControlPointIndexInvalid.test(index)) { throw new IllegalArgumentException("The given index [" + index + "] for the new CP is not valid."); } if (isDeletingControlPointIndexForbidden.test(co... | ControlPointValidations { public static void checkDeleteControlPoint(final ControlPoint[] controlPoints, final int index) { if (isControlPointIndexInvalid.test(index)) { throw new IllegalArgumentException("The given index [" + index + "] for the new CP is not valid."); } if (isDeletingControlPointIndexForbidden.test(co... | ControlPointValidations { public static void checkDeleteControlPoint(final ControlPoint[] controlPoints, final int index) { if (isControlPointIndexInvalid.test(index)) { throw new IllegalArgumentException("The given index [" + index + "] for the new CP is not valid."); } if (isDeletingControlPointIndexForbidden.test(co... | ControlPointValidations { public static void checkDeleteControlPoint(final ControlPoint[] controlPoints, final int index) { if (isControlPointIndexInvalid.test(index)) { throw new IllegalArgumentException("The given index [" + index + "] for the new CP is not valid."); } if (isDeletingControlPointIndexForbidden.test(co... |
@Test(expected = IllegalArgumentException.class) public void testInvalidCheckDeleteControlPoint2() { checkDeleteControlPoint(controlPoints, 2); } | public static void checkDeleteControlPoint(final ControlPoint[] controlPoints, final int index) { if (isControlPointIndexInvalid.test(index)) { throw new IllegalArgumentException("The given index [" + index + "] for the new CP is not valid."); } if (isDeletingControlPointIndexForbidden.test(controlPoints, index)) { thr... | ControlPointValidations { public static void checkDeleteControlPoint(final ControlPoint[] controlPoints, final int index) { if (isControlPointIndexInvalid.test(index)) { throw new IllegalArgumentException("The given index [" + index + "] for the new CP is not valid."); } if (isDeletingControlPointIndexForbidden.test(co... | ControlPointValidations { public static void checkDeleteControlPoint(final ControlPoint[] controlPoints, final int index) { if (isControlPointIndexInvalid.test(index)) { throw new IllegalArgumentException("The given index [" + index + "] for the new CP is not valid."); } if (isDeletingControlPointIndexForbidden.test(co... | ControlPointValidations { public static void checkDeleteControlPoint(final ControlPoint[] controlPoints, final int index) { if (isControlPointIndexInvalid.test(index)) { throw new IllegalArgumentException("The given index [" + index + "] for the new CP is not valid."); } if (isDeletingControlPointIndexForbidden.test(co... | ControlPointValidations { public static void checkDeleteControlPoint(final ControlPoint[] controlPoints, final int index) { if (isControlPointIndexInvalid.test(index)) { throw new IllegalArgumentException("The given index [" + index + "] for the new CP is not valid."); } if (isDeletingControlPointIndexForbidden.test(co... |
@Test public void testValidCheckUpdateControlPoints() { ControlPoint controlPoint2 = ControlPoint.build(1, 1); ControlPoint[] controlPoints2 = new ControlPoint[]{controlPoint2}; checkUpdateControlPoint(controlPoints, controlPoints2); } | public static void checkUpdateControlPoint(final ControlPoint[] controlPoints1, final ControlPoint[] controlPoints2) { if (cannotControlPointsBeUpdated.test(controlPoints1, controlPoints2)) { throw new IllegalArgumentException("The control points cannot be updated, length differs " + "[" + length(controlPoints1) + ":" ... | ControlPointValidations { public static void checkUpdateControlPoint(final ControlPoint[] controlPoints1, final ControlPoint[] controlPoints2) { if (cannotControlPointsBeUpdated.test(controlPoints1, controlPoints2)) { throw new IllegalArgumentException("The control points cannot be updated, length differs " + "[" + len... | ControlPointValidations { public static void checkUpdateControlPoint(final ControlPoint[] controlPoints1, final ControlPoint[] controlPoints2) { if (cannotControlPointsBeUpdated.test(controlPoints1, controlPoints2)) { throw new IllegalArgumentException("The control points cannot be updated, length differs " + "[" + len... | ControlPointValidations { public static void checkUpdateControlPoint(final ControlPoint[] controlPoints1, final ControlPoint[] controlPoints2) { if (cannotControlPointsBeUpdated.test(controlPoints1, controlPoints2)) { throw new IllegalArgumentException("The control points cannot be updated, length differs " + "[" + len... | ControlPointValidations { public static void checkUpdateControlPoint(final ControlPoint[] controlPoints1, final ControlPoint[] controlPoints2) { if (cannotControlPointsBeUpdated.test(controlPoints1, controlPoints2)) { throw new IllegalArgumentException("The control points cannot be updated, length differs " + "[" + len... |
@Test(expected = IllegalArgumentException.class) public void testInvalidCheckUpdateControlPoints() { ControlPoint[] controlPoints2 = new ControlPoint[0]; checkUpdateControlPoint(controlPoints, controlPoints2); } | public static void checkUpdateControlPoint(final ControlPoint[] controlPoints1, final ControlPoint[] controlPoints2) { if (cannotControlPointsBeUpdated.test(controlPoints1, controlPoints2)) { throw new IllegalArgumentException("The control points cannot be updated, length differs " + "[" + length(controlPoints1) + ":" ... | ControlPointValidations { public static void checkUpdateControlPoint(final ControlPoint[] controlPoints1, final ControlPoint[] controlPoints2) { if (cannotControlPointsBeUpdated.test(controlPoints1, controlPoints2)) { throw new IllegalArgumentException("The control points cannot be updated, length differs " + "[" + len... | ControlPointValidations { public static void checkUpdateControlPoint(final ControlPoint[] controlPoints1, final ControlPoint[] controlPoints2) { if (cannotControlPointsBeUpdated.test(controlPoints1, controlPoints2)) { throw new IllegalArgumentException("The control points cannot be updated, length differs " + "[" + len... | ControlPointValidations { public static void checkUpdateControlPoint(final ControlPoint[] controlPoints1, final ControlPoint[] controlPoints2) { if (cannotControlPointsBeUpdated.test(controlPoints1, controlPoints2)) { throw new IllegalArgumentException("The control points cannot be updated, length differs " + "[" + len... | ControlPointValidations { public static void checkUpdateControlPoint(final ControlPoint[] controlPoints1, final ControlPoint[] controlPoints2) { if (cannotControlPointsBeUpdated.test(controlPoints1, controlPoints2)) { throw new IllegalArgumentException("The control points cannot be updated, length differs " + "[" + len... |
@Test public void swallowRuntimeException() { final String result = Exceptions.swallow(() -> methodThatThrowsRuntimeException(), DEFAULT_RESULT); assertEquals(result, DEFAULT_RESULT); } | public static <T> T swallow(final Supplier<T> supplier, final T defaultReturn) { try { return supplier.get(); } catch (Exception e) { LOGGER.debug("Exception swallowed", e.getMessage()); return defaultReturn; } } | Exceptions { public static <T> T swallow(final Supplier<T> supplier, final T defaultReturn) { try { return supplier.get(); } catch (Exception e) { LOGGER.debug("Exception swallowed", e.getMessage()); return defaultReturn; } } } | Exceptions { public static <T> T swallow(final Supplier<T> supplier, final T defaultReturn) { try { return supplier.get(); } catch (Exception e) { LOGGER.debug("Exception swallowed", e.getMessage()); return defaultReturn; } } } | Exceptions { public static <T> T swallow(final Supplier<T> supplier, final T defaultReturn) { try { return supplier.get(); } catch (Exception e) { LOGGER.debug("Exception swallowed", e.getMessage()); return defaultReturn; } } static T swallow(final Supplier<T> supplier, final T defaultReturn); } | Exceptions { public static <T> T swallow(final Supplier<T> supplier, final T defaultReturn) { try { return supplier.get(); } catch (Exception e) { LOGGER.debug("Exception swallowed", e.getMessage()); return defaultReturn; } } static T swallow(final Supplier<T> supplier, final T defaultReturn); } |
@Test public void swallowException() { final String result = Exceptions.swallow(() -> methodThatThrowsException(), DEFAULT_RESULT); assertEquals(result, DEFAULT_RESULT); } | public static <T> T swallow(final Supplier<T> supplier, final T defaultReturn) { try { return supplier.get(); } catch (Exception e) { LOGGER.debug("Exception swallowed", e.getMessage()); return defaultReturn; } } | Exceptions { public static <T> T swallow(final Supplier<T> supplier, final T defaultReturn) { try { return supplier.get(); } catch (Exception e) { LOGGER.debug("Exception swallowed", e.getMessage()); return defaultReturn; } } } | Exceptions { public static <T> T swallow(final Supplier<T> supplier, final T defaultReturn) { try { return supplier.get(); } catch (Exception e) { LOGGER.debug("Exception swallowed", e.getMessage()); return defaultReturn; } } } | Exceptions { public static <T> T swallow(final Supplier<T> supplier, final T defaultReturn) { try { return supplier.get(); } catch (Exception e) { LOGGER.debug("Exception swallowed", e.getMessage()); return defaultReturn; } } static T swallow(final Supplier<T> supplier, final T defaultReturn); } | Exceptions { public static <T> T swallow(final Supplier<T> supplier, final T defaultReturn) { try { return supplier.get(); } catch (Exception e) { LOGGER.debug("Exception swallowed", e.getMessage()); return defaultReturn; } } static T swallow(final Supplier<T> supplier, final T defaultReturn); } |
@Test public void swallowNoException() { final String result = Exceptions.swallow(() -> methodNoException(), DEFAULT_RESULT); assertEquals(result, RESULT); } | public static <T> T swallow(final Supplier<T> supplier, final T defaultReturn) { try { return supplier.get(); } catch (Exception e) { LOGGER.debug("Exception swallowed", e.getMessage()); return defaultReturn; } } | Exceptions { public static <T> T swallow(final Supplier<T> supplier, final T defaultReturn) { try { return supplier.get(); } catch (Exception e) { LOGGER.debug("Exception swallowed", e.getMessage()); return defaultReturn; } } } | Exceptions { public static <T> T swallow(final Supplier<T> supplier, final T defaultReturn) { try { return supplier.get(); } catch (Exception e) { LOGGER.debug("Exception swallowed", e.getMessage()); return defaultReturn; } } } | Exceptions { public static <T> T swallow(final Supplier<T> supplier, final T defaultReturn) { try { return supplier.get(); } catch (Exception e) { LOGGER.debug("Exception swallowed", e.getMessage()); return defaultReturn; } } static T swallow(final Supplier<T> supplier, final T defaultReturn); } | Exceptions { public static <T> T swallow(final Supplier<T> supplier, final T defaultReturn) { try { return supplier.get(); } catch (Exception e) { LOGGER.debug("Exception swallowed", e.getMessage()); return defaultReturn; } } static T swallow(final Supplier<T> supplier, final T defaultReturn); } |
@Test @SuppressWarnings("unchecked") public void testMatchParentTypeAsParentNodeBean() { ParentTypesMatcher tested = new ParentTypesMatcher(() -> graphTestHandler.getDefinitionManager(), GraphUtils::getParent, new Class[]{TestingGraphInstances.ParentNodeBean.class}); assertTrue(tested.matcher().test(graph.startNode, gr... | public BiPredicate<Node<? extends View<?>, ? extends Edge>, Node<? extends View<?>, ? extends Edge>> matcher() { return this::match; } | ParentTypesMatcher { public BiPredicate<Node<? extends View<?>, ? extends Edge>, Node<? extends View<?>, ? extends Edge>> matcher() { return this::match; } } | ParentTypesMatcher { public BiPredicate<Node<? extends View<?>, ? extends Edge>, Node<? extends View<?>, ? extends Edge>> matcher() { return this::match; } ParentTypesMatcher(final Supplier<DefinitionManager> definitionManagerSupplier,
final Function<Node, Element> parentSupplier,
... | ParentTypesMatcher { public BiPredicate<Node<? extends View<?>, ? extends Edge>, Node<? extends View<?>, ? extends Edge>> matcher() { return this::match; } ParentTypesMatcher(final Supplier<DefinitionManager> definitionManagerSupplier,
final Function<Node, Element> parentSupplier,
... | ParentTypesMatcher { public BiPredicate<Node<? extends View<?>, ? extends Edge>, Node<? extends View<?>, ? extends Edge>> matcher() { return this::match; } ParentTypesMatcher(final Supplier<DefinitionManager> definitionManagerSupplier,
final Function<Node, Element> parentSupplier,
... |
@Test public void testDelegateCollapseCell() { uiModel.collapseCell(0, 1); verify(delegate).collapseCell(eq(0), eq(1)); } | @Override public void collapseCell(final int rowIndex, final int columnIndex) { delegate.collapseCell(rowIndex, columnIndex); } | DelegatingGridData implements GridData { @Override public void collapseCell(final int rowIndex, final int columnIndex) { delegate.collapseCell(rowIndex, columnIndex); } } | DelegatingGridData implements GridData { @Override public void collapseCell(final int rowIndex, final int columnIndex) { delegate.collapseCell(rowIndex, columnIndex); } DelegatingGridData(final DMNGridData delegate); } | DelegatingGridData implements GridData { @Override public void collapseCell(final int rowIndex, final int columnIndex) { delegate.collapseCell(rowIndex, columnIndex); } DelegatingGridData(final DMNGridData delegate); @Override void moveRowTo(final int index,
final GridRow row); @Override void ... | DelegatingGridData implements GridData { @Override public void collapseCell(final int rowIndex, final int columnIndex) { delegate.collapseCell(rowIndex, columnIndex); } DelegatingGridData(final DMNGridData delegate); @Override void moveRowTo(final int index,
final GridRow row); @Override void ... |
@Test @SuppressWarnings("unchecked") public void testMatchParentTypeAsContainerNodeBean() { ParentTypesMatcher tested = new ParentTypesMatcher(() -> graphTestHandler.getDefinitionManager(), GraphUtils::getParent, new Class[]{TestingGraphInstances.ContainerNodeBean.class}); assertTrue(tested.matcher().test(graph.startNo... | public BiPredicate<Node<? extends View<?>, ? extends Edge>, Node<? extends View<?>, ? extends Edge>> matcher() { return this::match; } | ParentTypesMatcher { public BiPredicate<Node<? extends View<?>, ? extends Edge>, Node<? extends View<?>, ? extends Edge>> matcher() { return this::match; } } | ParentTypesMatcher { public BiPredicate<Node<? extends View<?>, ? extends Edge>, Node<? extends View<?>, ? extends Edge>> matcher() { return this::match; } ParentTypesMatcher(final Supplier<DefinitionManager> definitionManagerSupplier,
final Function<Node, Element> parentSupplier,
... | ParentTypesMatcher { public BiPredicate<Node<? extends View<?>, ? extends Edge>, Node<? extends View<?>, ? extends Edge>> matcher() { return this::match; } ParentTypesMatcher(final Supplier<DefinitionManager> definitionManagerSupplier,
final Function<Node, Element> parentSupplier,
... | ParentTypesMatcher { public BiPredicate<Node<? extends View<?>, ? extends Edge>, Node<? extends View<?>, ? extends Edge>> matcher() { return this::match; } ParentTypesMatcher(final Supplier<DefinitionManager> definitionManagerSupplier,
final Function<Node, Element> parentSupplier,
... |
@Test @SuppressWarnings("unchecked") public void testMatchParentTypeAsContainerNodeBeanButChangeIntermNode() { graphTestHandler .removeChild(graph.containerNode, graph.intermNode) .setChild(graph.parentNode, graph.intermNode); ParentTypesMatcher tested = new ParentTypesMatcher(() -> graphTestHandler.getDefinitionManage... | public BiPredicate<Node<? extends View<?>, ? extends Edge>, Node<? extends View<?>, ? extends Edge>> matcher() { return this::match; } | ParentTypesMatcher { public BiPredicate<Node<? extends View<?>, ? extends Edge>, Node<? extends View<?>, ? extends Edge>> matcher() { return this::match; } } | ParentTypesMatcher { public BiPredicate<Node<? extends View<?>, ? extends Edge>, Node<? extends View<?>, ? extends Edge>> matcher() { return this::match; } ParentTypesMatcher(final Supplier<DefinitionManager> definitionManagerSupplier,
final Function<Node, Element> parentSupplier,
... | ParentTypesMatcher { public BiPredicate<Node<? extends View<?>, ? extends Edge>, Node<? extends View<?>, ? extends Edge>> matcher() { return this::match; } ParentTypesMatcher(final Supplier<DefinitionManager> definitionManagerSupplier,
final Function<Node, Element> parentSupplier,
... | ParentTypesMatcher { public BiPredicate<Node<? extends View<?>, ? extends Edge>, Node<? extends View<?>, ? extends Edge>> matcher() { return this::match; } ParentTypesMatcher(final Supplier<DefinitionManager> definitionManagerSupplier,
final Function<Node, Element> parentSupplier,
... |
@Test public void testGetDiagram() { final String diagramId = "diagramId"; final Node node = createNode("id", diagramId); final String actual = getDiagramId(node); assertEquals(diagramId, actual); } | public static String getDiagramId(final Node node) { if (node.getContent() instanceof Definition) { final Object definition = ((Definition) node.getContent()).getDefinition(); if (definition instanceof HasContentDefinitionId) { return ((HasContentDefinitionId) definition).getDiagramId(); } } return null; } | NodeDefinitionHelper { public static String getDiagramId(final Node node) { if (node.getContent() instanceof Definition) { final Object definition = ((Definition) node.getContent()).getDefinition(); if (definition instanceof HasContentDefinitionId) { return ((HasContentDefinitionId) definition).getDiagramId(); } } retu... | NodeDefinitionHelper { public static String getDiagramId(final Node node) { if (node.getContent() instanceof Definition) { final Object definition = ((Definition) node.getContent()).getDefinition(); if (definition instanceof HasContentDefinitionId) { return ((HasContentDefinitionId) definition).getDiagramId(); } } retu... | NodeDefinitionHelper { public static String getDiagramId(final Node node) { if (node.getContent() instanceof Definition) { final Object definition = ((Definition) node.getContent()).getDefinition(); if (definition instanceof HasContentDefinitionId) { return ((HasContentDefinitionId) definition).getDiagramId(); } } retu... | NodeDefinitionHelper { public static String getDiagramId(final Node node) { if (node.getContent() instanceof Definition) { final Object definition = ((Definition) node.getContent()).getDefinition(); if (definition instanceof HasContentDefinitionId) { return ((HasContentDefinitionId) definition).getDiagramId(); } } retu... |
@Test public void testGetContentDefinitionId() { final String contentDefinitionId = "contentDefinitionId"; final Node node = createNode(contentDefinitionId, "id"); final String actual = getContentDefinitionId(node); assertEquals(contentDefinitionId, actual); } | public static String getContentDefinitionId(final Node node) { if (node.getContent() instanceof Definition) { final Object definition = ((Definition) node.getContent()).getDefinition(); if (definition instanceof HasContentDefinitionId) { return ((HasContentDefinitionId) definition).getContentDefinitionId(); } } return ... | NodeDefinitionHelper { public static String getContentDefinitionId(final Node node) { if (node.getContent() instanceof Definition) { final Object definition = ((Definition) node.getContent()).getDefinition(); if (definition instanceof HasContentDefinitionId) { return ((HasContentDefinitionId) definition).getContentDefi... | NodeDefinitionHelper { public static String getContentDefinitionId(final Node node) { if (node.getContent() instanceof Definition) { final Object definition = ((Definition) node.getContent()).getDefinition(); if (definition instanceof HasContentDefinitionId) { return ((HasContentDefinitionId) definition).getContentDefi... | NodeDefinitionHelper { public static String getContentDefinitionId(final Node node) { if (node.getContent() instanceof Definition) { final Object definition = ((Definition) node.getContent()).getDefinition(); if (definition instanceof HasContentDefinitionId) { return ((HasContentDefinitionId) definition).getContentDefi... | NodeDefinitionHelper { public static String getContentDefinitionId(final Node node) { if (node.getContent() instanceof Definition) { final Object definition = ((Definition) node.getContent()).getDefinition(); if (definition instanceof HasContentDefinitionId) { return ((HasContentDefinitionId) definition).getContentDefi... |
@Test @SuppressWarnings("unchecked") public void testDeleteStartNode() { this.tested = new SafeDeleteNodeProcessor(new ChildrenTraverseProcessorImpl(new TreeWalkTraverseProcessorImpl()), graphHolder.graph, graphHolder.startNode); tested.run(callback); verify(callback, times(1)).deleteCandidateConnector(eq(graphHolder.e... | @SuppressWarnings("unchecked") public void run(final Callback callback) { final Deque<Node<View, Edge>> nodes = createNodesDequeue(); processedConnectors.clear(); if (!keepChildren) { deleteChildren(callback, nodes); } processNode(candidate, callback, true); graphsProvider.ifPresent(selectedDiagram -> { if (selectedDia... | SafeDeleteNodeProcessor { @SuppressWarnings("unchecked") public void run(final Callback callback) { final Deque<Node<View, Edge>> nodes = createNodesDequeue(); processedConnectors.clear(); if (!keepChildren) { deleteChildren(callback, nodes); } processNode(candidate, callback, true); graphsProvider.ifPresent(selectedDi... | SafeDeleteNodeProcessor { @SuppressWarnings("unchecked") public void run(final Callback callback) { final Deque<Node<View, Edge>> nodes = createNodesDequeue(); processedConnectors.clear(); if (!keepChildren) { deleteChildren(callback, nodes); } processNode(candidate, callback, true); graphsProvider.ifPresent(selectedDi... | SafeDeleteNodeProcessor { @SuppressWarnings("unchecked") public void run(final Callback callback) { final Deque<Node<View, Edge>> nodes = createNodesDequeue(); processedConnectors.clear(); if (!keepChildren) { deleteChildren(callback, nodes); } processNode(candidate, callback, true); graphsProvider.ifPresent(selectedDi... | SafeDeleteNodeProcessor { @SuppressWarnings("unchecked") public void run(final Callback callback) { final Deque<Node<View, Edge>> nodes = createNodesDequeue(); processedConnectors.clear(); if (!keepChildren) { deleteChildren(callback, nodes); } processNode(candidate, callback, true); graphsProvider.ifPresent(selectedDi... |
@Test @SuppressWarnings("unchecked") public void testDeleteIntermediateNode() { this.tested = new SafeDeleteNodeProcessor(new ChildrenTraverseProcessorImpl(new TreeWalkTraverseProcessorImpl()), graphHolder.graph, graphHolder.intermNode); tested.run(callback); verify(callback, times(1)).deleteCandidateConnector(eq(graph... | @SuppressWarnings("unchecked") public void run(final Callback callback) { final Deque<Node<View, Edge>> nodes = createNodesDequeue(); processedConnectors.clear(); if (!keepChildren) { deleteChildren(callback, nodes); } processNode(candidate, callback, true); graphsProvider.ifPresent(selectedDiagram -> { if (selectedDia... | SafeDeleteNodeProcessor { @SuppressWarnings("unchecked") public void run(final Callback callback) { final Deque<Node<View, Edge>> nodes = createNodesDequeue(); processedConnectors.clear(); if (!keepChildren) { deleteChildren(callback, nodes); } processNode(candidate, callback, true); graphsProvider.ifPresent(selectedDi... | SafeDeleteNodeProcessor { @SuppressWarnings("unchecked") public void run(final Callback callback) { final Deque<Node<View, Edge>> nodes = createNodesDequeue(); processedConnectors.clear(); if (!keepChildren) { deleteChildren(callback, nodes); } processNode(candidate, callback, true); graphsProvider.ifPresent(selectedDi... | SafeDeleteNodeProcessor { @SuppressWarnings("unchecked") public void run(final Callback callback) { final Deque<Node<View, Edge>> nodes = createNodesDequeue(); processedConnectors.clear(); if (!keepChildren) { deleteChildren(callback, nodes); } processNode(candidate, callback, true); graphsProvider.ifPresent(selectedDi... | SafeDeleteNodeProcessor { @SuppressWarnings("unchecked") public void run(final Callback callback) { final Deque<Node<View, Edge>> nodes = createNodesDequeue(); processedConnectors.clear(); if (!keepChildren) { deleteChildren(callback, nodes); } processNode(candidate, callback, true); graphsProvider.ifPresent(selectedDi... |
@Test @SuppressWarnings("unchecked") public void testDeleteEndNode() { this.tested = new SafeDeleteNodeProcessor(new ChildrenTraverseProcessorImpl(new TreeWalkTraverseProcessorImpl()), graphHolder.graph, graphHolder.endNode); tested.run(callback); verify(callback, times(1)).deleteCandidateConnector(eq(graphHolder.edge2... | @SuppressWarnings("unchecked") public void run(final Callback callback) { final Deque<Node<View, Edge>> nodes = createNodesDequeue(); processedConnectors.clear(); if (!keepChildren) { deleteChildren(callback, nodes); } processNode(candidate, callback, true); graphsProvider.ifPresent(selectedDiagram -> { if (selectedDia... | SafeDeleteNodeProcessor { @SuppressWarnings("unchecked") public void run(final Callback callback) { final Deque<Node<View, Edge>> nodes = createNodesDequeue(); processedConnectors.clear(); if (!keepChildren) { deleteChildren(callback, nodes); } processNode(candidate, callback, true); graphsProvider.ifPresent(selectedDi... | SafeDeleteNodeProcessor { @SuppressWarnings("unchecked") public void run(final Callback callback) { final Deque<Node<View, Edge>> nodes = createNodesDequeue(); processedConnectors.clear(); if (!keepChildren) { deleteChildren(callback, nodes); } processNode(candidate, callback, true); graphsProvider.ifPresent(selectedDi... | SafeDeleteNodeProcessor { @SuppressWarnings("unchecked") public void run(final Callback callback) { final Deque<Node<View, Edge>> nodes = createNodesDequeue(); processedConnectors.clear(); if (!keepChildren) { deleteChildren(callback, nodes); } processNode(candidate, callback, true); graphsProvider.ifPresent(selectedDi... | SafeDeleteNodeProcessor { @SuppressWarnings("unchecked") public void run(final Callback callback) { final Deque<Node<View, Edge>> nodes = createNodesDequeue(); processedConnectors.clear(); if (!keepChildren) { deleteChildren(callback, nodes); } processNode(candidate, callback, true); graphsProvider.ifPresent(selectedDi... |
@Test @SuppressWarnings("unchecked") public void testDeleteDockParent() { this.tested = new SafeDeleteNodeProcessor(new ChildrenTraverseProcessorImpl(new TreeWalkTraverseProcessorImpl()), graphHolderDocked.graph, graphHolderDocked.intermNode); tested.run(callback); verify(callback, times(1)).deleteCandidateConnector(eq... | @SuppressWarnings("unchecked") public void run(final Callback callback) { final Deque<Node<View, Edge>> nodes = createNodesDequeue(); processedConnectors.clear(); if (!keepChildren) { deleteChildren(callback, nodes); } processNode(candidate, callback, true); graphsProvider.ifPresent(selectedDiagram -> { if (selectedDia... | SafeDeleteNodeProcessor { @SuppressWarnings("unchecked") public void run(final Callback callback) { final Deque<Node<View, Edge>> nodes = createNodesDequeue(); processedConnectors.clear(); if (!keepChildren) { deleteChildren(callback, nodes); } processNode(candidate, callback, true); graphsProvider.ifPresent(selectedDi... | SafeDeleteNodeProcessor { @SuppressWarnings("unchecked") public void run(final Callback callback) { final Deque<Node<View, Edge>> nodes = createNodesDequeue(); processedConnectors.clear(); if (!keepChildren) { deleteChildren(callback, nodes); } processNode(candidate, callback, true); graphsProvider.ifPresent(selectedDi... | SafeDeleteNodeProcessor { @SuppressWarnings("unchecked") public void run(final Callback callback) { final Deque<Node<View, Edge>> nodes = createNodesDequeue(); processedConnectors.clear(); if (!keepChildren) { deleteChildren(callback, nodes); } processNode(candidate, callback, true); graphsProvider.ifPresent(selectedDi... | SafeDeleteNodeProcessor { @SuppressWarnings("unchecked") public void run(final Callback callback) { final Deque<Node<View, Edge>> nodes = createNodesDequeue(); processedConnectors.clear(); if (!keepChildren) { deleteChildren(callback, nodes); } processNode(candidate, callback, true); graphsProvider.ifPresent(selectedDi... |
@Test @SuppressWarnings("unchecked") public void testDeleteDocked() { this.tested = new SafeDeleteNodeProcessor(new ChildrenTraverseProcessorImpl(new TreeWalkTraverseProcessorImpl()), graphHolderDocked.graph, graphHolderDocked.dockedNode); tested.run(callback); verify(callback, never()).deleteCandidateConnector(any(Edg... | @SuppressWarnings("unchecked") public void run(final Callback callback) { final Deque<Node<View, Edge>> nodes = createNodesDequeue(); processedConnectors.clear(); if (!keepChildren) { deleteChildren(callback, nodes); } processNode(candidate, callback, true); graphsProvider.ifPresent(selectedDiagram -> { if (selectedDia... | SafeDeleteNodeProcessor { @SuppressWarnings("unchecked") public void run(final Callback callback) { final Deque<Node<View, Edge>> nodes = createNodesDequeue(); processedConnectors.clear(); if (!keepChildren) { deleteChildren(callback, nodes); } processNode(candidate, callback, true); graphsProvider.ifPresent(selectedDi... | SafeDeleteNodeProcessor { @SuppressWarnings("unchecked") public void run(final Callback callback) { final Deque<Node<View, Edge>> nodes = createNodesDequeue(); processedConnectors.clear(); if (!keepChildren) { deleteChildren(callback, nodes); } processNode(candidate, callback, true); graphsProvider.ifPresent(selectedDi... | SafeDeleteNodeProcessor { @SuppressWarnings("unchecked") public void run(final Callback callback) { final Deque<Node<View, Edge>> nodes = createNodesDequeue(); processedConnectors.clear(); if (!keepChildren) { deleteChildren(callback, nodes); } processNode(candidate, callback, true); graphsProvider.ifPresent(selectedDi... | SafeDeleteNodeProcessor { @SuppressWarnings("unchecked") public void run(final Callback callback) { final Deque<Node<View, Edge>> nodes = createNodesDequeue(); processedConnectors.clear(); if (!keepChildren) { deleteChildren(callback, nodes); } processNode(candidate, callback, true); graphsProvider.ifPresent(selectedDi... |
@Test public void testRun() { final Graph graph = mock(Graph.class); final Node node = mock(Node.class); this.tested = spy(new SafeDeleteNodeProcessor(new ChildrenTraverseProcessorImpl(new TreeWalkTraverseProcessorImpl()), graph, node)); final ArrayDeque nodes = mock(ArrayDeque.class); doReturn(nodes).when(tested).crea... | @SuppressWarnings("unchecked") public void run(final Callback callback) { final Deque<Node<View, Edge>> nodes = createNodesDequeue(); processedConnectors.clear(); if (!keepChildren) { deleteChildren(callback, nodes); } processNode(candidate, callback, true); graphsProvider.ifPresent(selectedDiagram -> { if (selectedDia... | SafeDeleteNodeProcessor { @SuppressWarnings("unchecked") public void run(final Callback callback) { final Deque<Node<View, Edge>> nodes = createNodesDequeue(); processedConnectors.clear(); if (!keepChildren) { deleteChildren(callback, nodes); } processNode(candidate, callback, true); graphsProvider.ifPresent(selectedDi... | SafeDeleteNodeProcessor { @SuppressWarnings("unchecked") public void run(final Callback callback) { final Deque<Node<View, Edge>> nodes = createNodesDequeue(); processedConnectors.clear(); if (!keepChildren) { deleteChildren(callback, nodes); } processNode(candidate, callback, true); graphsProvider.ifPresent(selectedDi... | SafeDeleteNodeProcessor { @SuppressWarnings("unchecked") public void run(final Callback callback) { final Deque<Node<View, Edge>> nodes = createNodesDequeue(); processedConnectors.clear(); if (!keepChildren) { deleteChildren(callback, nodes); } processNode(candidate, callback, true); graphsProvider.ifPresent(selectedDi... | SafeDeleteNodeProcessor { @SuppressWarnings("unchecked") public void run(final Callback callback) { final Deque<Node<View, Edge>> nodes = createNodesDequeue(); processedConnectors.clear(); if (!keepChildren) { deleteChildren(callback, nodes); } processNode(candidate, callback, true); graphsProvider.ifPresent(selectedDi... |
@Test public void testDelegateSetColumnDraggingEnabled() { uiModel.setColumnDraggingEnabled(true); verify(delegate).setColumnDraggingEnabled(eq(true)); } | @Override public void setColumnDraggingEnabled(final boolean enabled) { delegate.setColumnDraggingEnabled(enabled); } | DelegatingGridData implements GridData { @Override public void setColumnDraggingEnabled(final boolean enabled) { delegate.setColumnDraggingEnabled(enabled); } } | DelegatingGridData implements GridData { @Override public void setColumnDraggingEnabled(final boolean enabled) { delegate.setColumnDraggingEnabled(enabled); } DelegatingGridData(final DMNGridData delegate); } | DelegatingGridData implements GridData { @Override public void setColumnDraggingEnabled(final boolean enabled) { delegate.setColumnDraggingEnabled(enabled); } DelegatingGridData(final DMNGridData delegate); @Override void moveRowTo(final int index,
final GridRow row); @Override void moveRowsTo... | DelegatingGridData implements GridData { @Override public void setColumnDraggingEnabled(final boolean enabled) { delegate.setColumnDraggingEnabled(enabled); } DelegatingGridData(final DMNGridData delegate); @Override void moveRowTo(final int index,
final GridRow row); @Override void moveRowsTo... |
@Test public void testInit() { final Graph graph = mock(Graph.class); final Node node = mock(Node.class); final Definition definition = mock(Definition.class); final HasContentDefinitionId hasContentDefinitionId = mock(HasContentDefinitionId.class); final String definitionId = "definition id"; final String dmnDiagramId... | void init() { this.candidateContentDefinitionId = getContentDefinitionId(candidate); this.candidateDiagramId = getDiagramId(candidate); } | SafeDeleteNodeProcessor { void init() { this.candidateContentDefinitionId = getContentDefinitionId(candidate); this.candidateDiagramId = getDiagramId(candidate); } } | SafeDeleteNodeProcessor { void init() { this.candidateContentDefinitionId = getContentDefinitionId(candidate); this.candidateDiagramId = getDiagramId(candidate); } SafeDeleteNodeProcessor(final ChildrenTraverseProcessor childrenTraverseProcessor,
final Graph graph,
... | SafeDeleteNodeProcessor { void init() { this.candidateContentDefinitionId = getContentDefinitionId(candidate); this.candidateDiagramId = getDiagramId(candidate); } SafeDeleteNodeProcessor(final ChildrenTraverseProcessor childrenTraverseProcessor,
final Graph graph,
... | SafeDeleteNodeProcessor { void init() { this.candidateContentDefinitionId = getContentDefinitionId(candidate); this.candidateDiagramId = getDiagramId(candidate); } SafeDeleteNodeProcessor(final ChildrenTraverseProcessor childrenTraverseProcessor,
final Graph graph,
... |
@Test public void testDeleteGlobalGraphNodes() { final Node node = mock(Node.class); final GraphsProvider graphsProvider = mock(GraphsProvider.class); final Deque nodes = new ArrayDeque(); final TreeWalkTraverseProcessor treeWalk = mock(TreeWalkTraverseProcessor.class); final List<Graph> graphs = Arrays.asList(graphHol... | protected void deleteGlobalGraphNodes(final Callback callback, final Deque<Node<View, Edge>> nodes) { treeWalkTraverseProcessor.ifPresent(treeWalk -> { graphsProvider.get().getGraphs().stream().forEach(existingGraph -> { treeWalk.traverse(existingGraph, new AbstractTreeTraverseCallback<Graph, Node, Edge>() { @Override ... | SafeDeleteNodeProcessor { protected void deleteGlobalGraphNodes(final Callback callback, final Deque<Node<View, Edge>> nodes) { treeWalkTraverseProcessor.ifPresent(treeWalk -> { graphsProvider.get().getGraphs().stream().forEach(existingGraph -> { treeWalk.traverse(existingGraph, new AbstractTreeTraverseCallback<Graph, ... | SafeDeleteNodeProcessor { protected void deleteGlobalGraphNodes(final Callback callback, final Deque<Node<View, Edge>> nodes) { treeWalkTraverseProcessor.ifPresent(treeWalk -> { graphsProvider.get().getGraphs().stream().forEach(existingGraph -> { treeWalk.traverse(existingGraph, new AbstractTreeTraverseCallback<Graph, ... | SafeDeleteNodeProcessor { protected void deleteGlobalGraphNodes(final Callback callback, final Deque<Node<View, Edge>> nodes) { treeWalkTraverseProcessor.ifPresent(treeWalk -> { graphsProvider.get().getGraphs().stream().forEach(existingGraph -> { treeWalk.traverse(existingGraph, new AbstractTreeTraverseCallback<Graph, ... | SafeDeleteNodeProcessor { protected void deleteGlobalGraphNodes(final Callback callback, final Deque<Node<View, Edge>> nodes) { treeWalkTraverseProcessor.ifPresent(treeWalk -> { graphsProvider.get().getGraphs().stream().forEach(existingGraph -> { treeWalk.traverse(existingGraph, new AbstractTreeTraverseCallback<Graph, ... |
@Test public void testProcessGlobalNodeForDeletion() { final Deque deque = mock(Deque.class); final String nodeId = "id"; final Node node = createNode(nodeId, "diagramId"); this.tested = mock(SafeDeleteNodeProcessor.class); when(tested.getCandidateContentDefinitionId()).thenReturn(nodeId); when(tested.isDuplicatedOnThe... | boolean processGlobalNodeForDeletion(final Node node, final Deque<Node<View, Edge>> nodes) { final String nodeId = getContentDefinitionId(node); final String diagramId = getDiagramId(node); if (isDuplicatedOnTheCurrentDiagram(node, nodeId, diagramId)) { nodes.clear(); return false; } if (Objects.equals(getCandidateCont... | SafeDeleteNodeProcessor { boolean processGlobalNodeForDeletion(final Node node, final Deque<Node<View, Edge>> nodes) { final String nodeId = getContentDefinitionId(node); final String diagramId = getDiagramId(node); if (isDuplicatedOnTheCurrentDiagram(node, nodeId, diagramId)) { nodes.clear(); return false; } if (Objec... | SafeDeleteNodeProcessor { boolean processGlobalNodeForDeletion(final Node node, final Deque<Node<View, Edge>> nodes) { final String nodeId = getContentDefinitionId(node); final String diagramId = getDiagramId(node); if (isDuplicatedOnTheCurrentDiagram(node, nodeId, diagramId)) { nodes.clear(); return false; } if (Objec... | SafeDeleteNodeProcessor { boolean processGlobalNodeForDeletion(final Node node, final Deque<Node<View, Edge>> nodes) { final String nodeId = getContentDefinitionId(node); final String diagramId = getDiagramId(node); if (isDuplicatedOnTheCurrentDiagram(node, nodeId, diagramId)) { nodes.clear(); return false; } if (Objec... | SafeDeleteNodeProcessor { boolean processGlobalNodeForDeletion(final Node node, final Deque<Node<View, Edge>> nodes) { final String nodeId = getContentDefinitionId(node); final String diagramId = getDiagramId(node); if (isDuplicatedOnTheCurrentDiagram(node, nodeId, diagramId)) { nodes.clear(); return false; } if (Objec... |
@Test public void testGetNodes() { final GraphProcessorImpl tested = new GraphProcessorImpl(); final Graph<?, ?> graph = mock(Graph.class); final Iterable nodes = mock(Iterable.class); when(graph.nodes()).thenReturn(nodes); final Iterable<? extends Node> actual = tested.getNodes(graph); assertEquals(nodes, actual); } | public Iterable<? extends Node> getNodes(final Graph<?, ?> graph) { return graph.nodes(); } | GraphProcessorImpl implements GraphProcessor { public Iterable<? extends Node> getNodes(final Graph<?, ?> graph) { return graph.nodes(); } } | GraphProcessorImpl implements GraphProcessor { public Iterable<? extends Node> getNodes(final Graph<?, ?> graph) { return graph.nodes(); } } | GraphProcessorImpl implements GraphProcessor { public Iterable<? extends Node> getNodes(final Graph<?, ?> graph) { return graph.nodes(); } Iterable<? extends Node> getNodes(final Graph<?, ?> graph); } | GraphProcessorImpl implements GraphProcessor { public Iterable<? extends Node> getNodes(final Graph<?, ?> graph) { return graph.nodes(); } Iterable<? extends Node> getNodes(final Graph<?, ?> graph); } |
@Test public void simple2LayersTest() { final LayeredGraph graph = new LayeredGraph(); graph.addEdge("A", "E"); graph.addEdge("A", "G"); graph.addEdge("A", "H"); graph.addEdge("B", "F"); graph.addEdge("C", "H"); graph.addEdge("D", "H"); final LongestPathVertexLayerer layerer = new LongestPathVertexLayerer(); layerer.cr... | @Override public void createLayers(final ReorderedGraph graph) { this.graph = (LayeredGraph) graph; this.vertices = new Vertex[this.graph.getVertices().size()]; for (int i = 0; i < this.graph.getVertices().size(); i++) { final String v = this.graph.getVertices().get(i); this.vertices[i] = new Vertex(v); this.vertexHeig... | LongestPathVertexLayerer implements VertexLayerer { @Override public void createLayers(final ReorderedGraph graph) { this.graph = (LayeredGraph) graph; this.vertices = new Vertex[this.graph.getVertices().size()]; for (int i = 0; i < this.graph.getVertices().size(); i++) { final String v = this.graph.getVertices().get(i... | LongestPathVertexLayerer implements VertexLayerer { @Override public void createLayers(final ReorderedGraph graph) { this.graph = (LayeredGraph) graph; this.vertices = new Vertex[this.graph.getVertices().size()]; for (int i = 0; i < this.graph.getVertices().size(); i++) { final String v = this.graph.getVertices().get(i... | LongestPathVertexLayerer implements VertexLayerer { @Override public void createLayers(final ReorderedGraph graph) { this.graph = (LayeredGraph) graph; this.vertices = new Vertex[this.graph.getVertices().size()]; for (int i = 0; i < this.graph.getVertices().size(); i++) { final String v = this.graph.getVertices().get(i... | LongestPathVertexLayerer implements VertexLayerer { @Override public void createLayers(final ReorderedGraph graph) { this.graph = (LayeredGraph) graph; this.vertices = new Vertex[this.graph.getVertices().size()]; for (int i = 0; i < this.graph.getVertices().size(); i++) { final String v = this.graph.getVertices().get(i... |
@Test public void simple3Layers() { final LayeredGraph graph = new LayeredGraph(); graph.addEdge("A", "B"); graph.addEdge("A", "C"); graph.addEdge("B", "F"); graph.addEdge("C", "E"); graph.addEdge("C", "G"); graph.addEdge("C", "H"); graph.addEdge("D", "F"); final LongestPathVertexLayerer layerer = new LongestPathVertex... | @Override public void createLayers(final ReorderedGraph graph) { this.graph = (LayeredGraph) graph; this.vertices = new Vertex[this.graph.getVertices().size()]; for (int i = 0; i < this.graph.getVertices().size(); i++) { final String v = this.graph.getVertices().get(i); this.vertices[i] = new Vertex(v); this.vertexHeig... | LongestPathVertexLayerer implements VertexLayerer { @Override public void createLayers(final ReorderedGraph graph) { this.graph = (LayeredGraph) graph; this.vertices = new Vertex[this.graph.getVertices().size()]; for (int i = 0; i < this.graph.getVertices().size(); i++) { final String v = this.graph.getVertices().get(i... | LongestPathVertexLayerer implements VertexLayerer { @Override public void createLayers(final ReorderedGraph graph) { this.graph = (LayeredGraph) graph; this.vertices = new Vertex[this.graph.getVertices().size()]; for (int i = 0; i < this.graph.getVertices().size(); i++) { final String v = this.graph.getVertices().get(i... | LongestPathVertexLayerer implements VertexLayerer { @Override public void createLayers(final ReorderedGraph graph) { this.graph = (LayeredGraph) graph; this.vertices = new Vertex[this.graph.getVertices().size()]; for (int i = 0; i < this.graph.getVertices().size(); i++) { final String v = this.graph.getVertices().get(i... | LongestPathVertexLayerer implements VertexLayerer { @Override public void createLayers(final ReorderedGraph graph) { this.graph = (LayeredGraph) graph; this.vertices = new Vertex[this.graph.getVertices().size()]; for (int i = 0; i < this.graph.getVertices().size(); i++) { final String v = this.graph.getVertices().get(i... |
@Test public void simple4Layers() { final LayeredGraph graph = new LayeredGraph(); graph.addEdge("A", "B"); graph.addEdge("A", "C"); graph.addEdge("B", "F"); graph.addEdge("C", "E"); graph.addEdge("C", "G"); graph.addEdge("C", "H"); graph.addEdge("B", "I"); graph.addEdge("H", "I"); graph.addEdge("G", "I"); final Longes... | @Override public void createLayers(final ReorderedGraph graph) { this.graph = (LayeredGraph) graph; this.vertices = new Vertex[this.graph.getVertices().size()]; for (int i = 0; i < this.graph.getVertices().size(); i++) { final String v = this.graph.getVertices().get(i); this.vertices[i] = new Vertex(v); this.vertexHeig... | LongestPathVertexLayerer implements VertexLayerer { @Override public void createLayers(final ReorderedGraph graph) { this.graph = (LayeredGraph) graph; this.vertices = new Vertex[this.graph.getVertices().size()]; for (int i = 0; i < this.graph.getVertices().size(); i++) { final String v = this.graph.getVertices().get(i... | LongestPathVertexLayerer implements VertexLayerer { @Override public void createLayers(final ReorderedGraph graph) { this.graph = (LayeredGraph) graph; this.vertices = new Vertex[this.graph.getVertices().size()]; for (int i = 0; i < this.graph.getVertices().size(); i++) { final String v = this.graph.getVertices().get(i... | LongestPathVertexLayerer implements VertexLayerer { @Override public void createLayers(final ReorderedGraph graph) { this.graph = (LayeredGraph) graph; this.vertices = new Vertex[this.graph.getVertices().size()]; for (int i = 0; i < this.graph.getVertices().size(); i++) { final String v = this.graph.getVertices().get(i... | LongestPathVertexLayerer implements VertexLayerer { @Override public void createLayers(final ReorderedGraph graph) { this.graph = (LayeredGraph) graph; this.vertices = new Vertex[this.graph.getVertices().size()]; for (int i = 0; i < this.graph.getVertices().size(); i++) { final String v = this.graph.getVertices().get(i... |
@Test public void singleLineLayered() { final LayeredGraph graph = new LayeredGraph(); graph.addEdge("A", "B"); graph.addEdge("B", "C"); graph.addEdge("C", "D"); final LongestPathVertexLayerer layerer = new LongestPathVertexLayerer(); layerer.createLayers(graph); final List<GraphLayer> result = graph.getLayers(); asser... | @Override public void createLayers(final ReorderedGraph graph) { this.graph = (LayeredGraph) graph; this.vertices = new Vertex[this.graph.getVertices().size()]; for (int i = 0; i < this.graph.getVertices().size(); i++) { final String v = this.graph.getVertices().get(i); this.vertices[i] = new Vertex(v); this.vertexHeig... | LongestPathVertexLayerer implements VertexLayerer { @Override public void createLayers(final ReorderedGraph graph) { this.graph = (LayeredGraph) graph; this.vertices = new Vertex[this.graph.getVertices().size()]; for (int i = 0; i < this.graph.getVertices().size(); i++) { final String v = this.graph.getVertices().get(i... | LongestPathVertexLayerer implements VertexLayerer { @Override public void createLayers(final ReorderedGraph graph) { this.graph = (LayeredGraph) graph; this.vertices = new Vertex[this.graph.getVertices().size()]; for (int i = 0; i < this.graph.getVertices().size(); i++) { final String v = this.graph.getVertices().get(i... | LongestPathVertexLayerer implements VertexLayerer { @Override public void createLayers(final ReorderedGraph graph) { this.graph = (LayeredGraph) graph; this.vertices = new Vertex[this.graph.getVertices().size()]; for (int i = 0; i < this.graph.getVertices().size(); i++) { final String v = this.graph.getVertices().get(i... | LongestPathVertexLayerer implements VertexLayerer { @Override public void createLayers(final ReorderedGraph graph) { this.graph = (LayeredGraph) graph; this.vertices = new Vertex[this.graph.getVertices().size()]; for (int i = 0; i < this.graph.getVertices().size(); i++) { final String v = this.graph.getVertices().get(i... |
@Test public void twoSeparateTreesFromRoots() { final LayeredGraph graph = new LayeredGraph(Graphs.TwoSeparateTreesFromRoots); final LongestPathVertexLayerer layerer = new LongestPathVertexLayerer(); layerer.createLayers(graph); final List<GraphLayer> result = graph.getLayers(); Assertions.assertThat(result.size()) .as... | @Override public void createLayers(final ReorderedGraph graph) { this.graph = (LayeredGraph) graph; this.vertices = new Vertex[this.graph.getVertices().size()]; for (int i = 0; i < this.graph.getVertices().size(); i++) { final String v = this.graph.getVertices().get(i); this.vertices[i] = new Vertex(v); this.vertexHeig... | LongestPathVertexLayerer implements VertexLayerer { @Override public void createLayers(final ReorderedGraph graph) { this.graph = (LayeredGraph) graph; this.vertices = new Vertex[this.graph.getVertices().size()]; for (int i = 0; i < this.graph.getVertices().size(); i++) { final String v = this.graph.getVertices().get(i... | LongestPathVertexLayerer implements VertexLayerer { @Override public void createLayers(final ReorderedGraph graph) { this.graph = (LayeredGraph) graph; this.vertices = new Vertex[this.graph.getVertices().size()]; for (int i = 0; i < this.graph.getVertices().size(); i++) { final String v = this.graph.getVertices().get(i... | LongestPathVertexLayerer implements VertexLayerer { @Override public void createLayers(final ReorderedGraph graph) { this.graph = (LayeredGraph) graph; this.vertices = new Vertex[this.graph.getVertices().size()]; for (int i = 0; i < this.graph.getVertices().size(); i++) { final String v = this.graph.getVertices().get(i... | LongestPathVertexLayerer implements VertexLayerer { @Override public void createLayers(final ReorderedGraph graph) { this.graph = (LayeredGraph) graph; this.vertices = new Vertex[this.graph.getVertices().size()]; for (int i = 0; i < this.graph.getVertices().size(); i++) { final String v = this.graph.getVertices().get(i... |
@Test public void twoSeparateTreesToRoots() { final LayeredGraph graph = new LayeredGraph(Graphs.TwoSeparateTreesToRoots); final LongestPathVertexLayerer layerer = new LongestPathVertexLayerer(); layerer.createLayers(graph); final List<GraphLayer> result = graph.getLayers(); Assertions.assertThat(result.size()) .as("Tw... | @Override public void createLayers(final ReorderedGraph graph) { this.graph = (LayeredGraph) graph; this.vertices = new Vertex[this.graph.getVertices().size()]; for (int i = 0; i < this.graph.getVertices().size(); i++) { final String v = this.graph.getVertices().get(i); this.vertices[i] = new Vertex(v); this.vertexHeig... | LongestPathVertexLayerer implements VertexLayerer { @Override public void createLayers(final ReorderedGraph graph) { this.graph = (LayeredGraph) graph; this.vertices = new Vertex[this.graph.getVertices().size()]; for (int i = 0; i < this.graph.getVertices().size(); i++) { final String v = this.graph.getVertices().get(i... | LongestPathVertexLayerer implements VertexLayerer { @Override public void createLayers(final ReorderedGraph graph) { this.graph = (LayeredGraph) graph; this.vertices = new Vertex[this.graph.getVertices().size()]; for (int i = 0; i < this.graph.getVertices().size(); i++) { final String v = this.graph.getVertices().get(i... | LongestPathVertexLayerer implements VertexLayerer { @Override public void createLayers(final ReorderedGraph graph) { this.graph = (LayeredGraph) graph; this.vertices = new Vertex[this.graph.getVertices().size()]; for (int i = 0; i < this.graph.getVertices().size(); i++) { final String v = this.graph.getVertices().get(i... | LongestPathVertexLayerer implements VertexLayerer { @Override public void createLayers(final ReorderedGraph graph) { this.graph = (LayeredGraph) graph; this.vertices = new Vertex[this.graph.getVertices().size()]; for (int i = 0; i < this.graph.getVertices().size(); i++) { final String v = this.graph.getVertices().get(i... |
@Test public void testDelegateIsColumnDraggingEnabled() { uiModel.isColumnDraggingEnabled(); verify(delegate).isColumnDraggingEnabled(); } | @Override public boolean isColumnDraggingEnabled() { return delegate.isColumnDraggingEnabled(); } | DelegatingGridData implements GridData { @Override public boolean isColumnDraggingEnabled() { return delegate.isColumnDraggingEnabled(); } } | DelegatingGridData implements GridData { @Override public boolean isColumnDraggingEnabled() { return delegate.isColumnDraggingEnabled(); } DelegatingGridData(final DMNGridData delegate); } | DelegatingGridData implements GridData { @Override public boolean isColumnDraggingEnabled() { return delegate.isColumnDraggingEnabled(); } DelegatingGridData(final DMNGridData delegate); @Override void moveRowTo(final int index,
final GridRow row); @Override void moveRowsTo(final int index,
... | DelegatingGridData implements GridData { @Override public boolean isColumnDraggingEnabled() { return delegate.isColumnDraggingEnabled(); } DelegatingGridData(final DMNGridData delegate); @Override void moveRowTo(final int index,
final GridRow row); @Override void moveRowsTo(final int index,
... |
@Test public void testArrangeVertices() { final GraphLayer layer1 = mock(GraphLayer.class); final GraphLayer layer2 = mock(GraphLayer.class); final List<GraphLayer> layers = Arrays.asList(layer1, layer2); final ReorderedGraph graph = mock(ReorderedGraph.class); final HashMap hash = mock(HashMap.class); final HashMap la... | void arrangeVertices(final List<GraphLayer> layers, final LayerArrangement arrangement, final ReorderedGraph graph) { final HashMap<Integer, Integer> layersWidth = createHashForLayersWidth(); int largestWidth = calculateLayersWidth(layers, layersWidth); final HashMap<Integer, Integer> layersStartX = getLayersStartX(lay... | DefaultVertexPositioning implements VertexPositioning { void arrangeVertices(final List<GraphLayer> layers, final LayerArrangement arrangement, final ReorderedGraph graph) { final HashMap<Integer, Integer> layersWidth = createHashForLayersWidth(); int largestWidth = calculateLayersWidth(layers, layersWidth); final Hash... | DefaultVertexPositioning implements VertexPositioning { void arrangeVertices(final List<GraphLayer> layers, final LayerArrangement arrangement, final ReorderedGraph graph) { final HashMap<Integer, Integer> layersWidth = createHashForLayersWidth(); int largestWidth = calculateLayersWidth(layers, layersWidth); final Hash... | DefaultVertexPositioning implements VertexPositioning { void arrangeVertices(final List<GraphLayer> layers, final LayerArrangement arrangement, final ReorderedGraph graph) { final HashMap<Integer, Integer> layersWidth = createHashForLayersWidth(); int largestWidth = calculateLayersWidth(layers, layersWidth); final Hash... | DefaultVertexPositioning implements VertexPositioning { void arrangeVertices(final List<GraphLayer> layers, final LayerArrangement arrangement, final ReorderedGraph graph) { final HashMap<Integer, Integer> layersWidth = createHashForLayersWidth(); int largestWidth = calculateLayersWidth(layers, layersWidth); final Hash... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.