Search in sources :

Example 11 with Element

use of org.kie.workbench.common.stunner.core.graph.Element in project kie-wb-common by kiegroup.

the class SessionPreviewCanvasHandlerProxyTest method checkNotifyCanvasElementUpdatedDelegatesToWrapped.

@Test
public void checkNotifyCanvasElementUpdatedDelegatesToWrapped() {
    final Element candidate = mock(Element.class);
    proxy.notifyCanvasElementUpdated(candidate);
    verify(wrapped).notifyCanvasElementUpdated(eq(candidate));
}
Also used : Element(org.kie.workbench.common.stunner.core.graph.Element) Test(org.junit.Test)

Example 12 with Element

use of org.kie.workbench.common.stunner.core.graph.Element in project kie-wb-common by kiegroup.

the class SessionPreviewCanvasHandlerProxyTest method checkDockDelegatesToWrapped.

@Test
public void checkDockDelegatesToWrapped() {
    final Element parent = mock(Element.class);
    final Element child = mock(Element.class);
    proxy.dock(parent, child);
    verify(wrapped).dock(eq(parent), eq(child));
}
Also used : Element(org.kie.workbench.common.stunner.core.graph.Element) Test(org.junit.Test)

Example 13 with Element

use of org.kie.workbench.common.stunner.core.graph.Element in project kie-wb-common by kiegroup.

the class SessionPreviewCanvasHandlerProxyTest method checkUndockDelegatesToWrapped.

@Test
public void checkUndockDelegatesToWrapped() {
    final Element parent = mock(Element.class);
    final Element child = mock(Element.class);
    proxy.undock(parent, child);
    verify(wrapped).undock(eq(parent), eq(child));
}
Also used : Element(org.kie.workbench.common.stunner.core.graph.Element) Test(org.junit.Test)

Example 14 with Element

use of org.kie.workbench.common.stunner.core.graph.Element in project kie-wb-common by kiegroup.

the class SessionPreviewCanvasHandlerProxyTest method checkAddChildWithIndexDelegatesToWrapped.

@Test
public void checkAddChildWithIndexDelegatesToWrapped() {
    final Element parent = mock(Element.class);
    final Element child = mock(Element.class);
    final int index = 0;
    proxy.addChild(parent, child, index);
    verify(wrapped).addChild(eq(parent), eq(child), eq(index));
}
Also used : Element(org.kie.workbench.common.stunner.core.graph.Element) Test(org.junit.Test)

Example 15 with Element

use of org.kie.workbench.common.stunner.core.graph.Element in project kie-wb-common by kiegroup.

the class SessionPreviewCanvasHandlerProxyTest method checkApplyElementMutationDelegatesToWrapped.

@Test
public void checkApplyElementMutationDelegatesToWrapped() {
    final Shape shape = mock(Shape.class);
    final Element candidate = mock(Element.class);
    final boolean applyPosition = true;
    final boolean applyProperties = false;
    final MutationContext mutationContext = mock(MutationContext.class);
    proxy.applyElementMutation(shape, candidate, applyPosition, applyProperties, mutationContext);
    verify(wrapped).applyElementMutation(eq(shape), eq(candidate), eq(applyPosition), eq(applyProperties), eq(mutationContext));
    proxy.applyElementMutation(candidate, mutationContext);
    verify(wrapped).applyElementMutation(eq(candidate), eq(mutationContext));
    proxy.applyElementMutation(candidate, applyPosition, applyProperties, mutationContext);
    verify(wrapped).applyElementMutation(eq(candidate), eq(applyPosition), eq(applyProperties), eq(mutationContext));
}
Also used : Shape(org.kie.workbench.common.stunner.core.client.shape.Shape) Element(org.kie.workbench.common.stunner.core.graph.Element) MutationContext(org.kie.workbench.common.stunner.core.client.shape.MutationContext) Test(org.junit.Test)

Aggregations

Element (org.kie.workbench.common.stunner.core.graph.Element)85 Test (org.junit.Test)55 View (org.kie.workbench.common.stunner.core.graph.content.view.View)34 Graph (org.kie.workbench.common.stunner.core.graph.Graph)27 FlowElement (org.eclipse.bpmn2.FlowElement)24 ItemAwareElement (org.eclipse.bpmn2.ItemAwareElement)24 RootElement (org.eclipse.bpmn2.RootElement)24 Metadata (org.kie.workbench.common.stunner.core.diagram.Metadata)24 Definition (org.kie.workbench.common.stunner.core.graph.content.definition.Definition)14 Edge (org.kie.workbench.common.stunner.core.graph.Edge)12 Node (org.kie.workbench.common.stunner.core.graph.Node)11 Map (java.util.Map)7 Optional (java.util.Optional)6 Before (org.junit.Before)6 Collection (java.util.Collection)5 AbstractCanvasHandler (org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler)5 Shape (org.kie.workbench.common.stunner.core.client.shape.Shape)5 Matchers.anyString (org.mockito.Matchers.anyString)5 Logger (java.util.logging.Logger)4 BPMNDiagram (org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagram)4