Search in sources :

Example 76 with Element

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

the class SessionPreviewCanvasHandlerProxyTest method checkRemoveChildDelegatesToWrapped.

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

Example 77 with Element

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

the class SessionPreviewCanvasHandlerProxyTest method updateElementPropertiesDelegatesToWrapped.

@Test
public void updateElementPropertiesDelegatesToWrapped() {
    final Element candidate = mock(Element.class);
    final MutationContext mutationContext = mock(MutationContext.class);
    proxy.updateElementProperties(candidate, mutationContext);
    verify(wrapped).updateElementProperties(eq(candidate), eq(mutationContext));
}
Also used : Element(org.kie.workbench.common.stunner.core.graph.Element) MutationContext(org.kie.workbench.common.stunner.core.client.shape.MutationContext) Test(org.junit.Test)

Example 78 with Element

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

the class SessionPreviewCanvasHandlerProxyTest method checkUpdateElementPositionDelegatesToWrapped.

@Test
public void checkUpdateElementPositionDelegatesToWrapped() {
    final Element candidate = mock(Element.class);
    final MutationContext mutationContext = mock(MutationContext.class);
    proxy.updateElementPosition(candidate, mutationContext);
    verify(wrapped).updateElementPosition(eq(candidate), eq(mutationContext));
}
Also used : Element(org.kie.workbench.common.stunner.core.graph.Element) MutationContext(org.kie.workbench.common.stunner.core.client.shape.MutationContext) Test(org.junit.Test)

Example 79 with Element

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

the class SessionPreviewCanvasHandlerProxyTest method checkNotifyCanvasElementRemovedDelegatesToWrapped.

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

Example 80 with Element

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

the class SessionPreviewCanvasHandlerProxyTest method checkRegisterDelegatesToWrapped.

@Test
@SuppressWarnings("unchecked")
public void checkRegisterDelegatesToWrapped() {
    final Shape shape = mock(Shape.class);
    final Element candidate = mock(Element.class);
    final boolean fireEvents = true;
    proxy.register(shape, candidate, fireEvents);
    verify(wrapped).register(eq(shape), eq(candidate), eq(fireEvents));
    final String shapeSetId = "ShapeSetId";
    proxy.register(shapeSetId, candidate);
    verify(wrapped).register(eq(shapeSetId), eq(candidate));
    final ShapeFactory factory = mock(ShapeFactory.class);
    proxy.register(factory, candidate, fireEvents);
    verify(wrapped).register(eq(factory), eq(candidate), eq(fireEvents));
}
Also used : Shape(org.kie.workbench.common.stunner.core.client.shape.Shape) Element(org.kie.workbench.common.stunner.core.graph.Element) ShapeFactory(org.kie.workbench.common.stunner.core.client.shape.factory.ShapeFactory) 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