use of org.kie.workbench.common.stunner.cm.client.shape.ActivityShape in project kie-wb-common by kiegroup.
the class CaseManagementCanvasHandlerTest method checkAddShapeRenderableShapes.
@Test
public void checkAddShapeRenderableShapes() {
final ActivityShape shape = makeShape();
handler.addShape(shape);
verify(canvas, times(1)).addShape(eq(shape));
}
use of org.kie.workbench.common.stunner.cm.client.shape.ActivityShape in project kie-wb-common by kiegroup.
the class CaseManagementCanvasHandlerTest method checkRemoveChildRenderableShapes.
@Test
@SuppressWarnings("unchecked")
public void checkRemoveChildRenderableShapes() {
final ActivityShape parentShape = makeShape();
final ActivityShape childShape = makeShape();
final Node<View<BPMNViewDefinition>, Edge> parentNode = makeNode("parent", parentShape);
final Node<View<BPMNViewDefinition>, Edge> childNode = makeNode("child", childShape);
handler.register(parentShape, parentNode, true);
handler.register(childShape, childNode, true);
handler.addChild(parentNode, childNode);
handler.removeChild(parentNode, childNode);
verify(canvas, times(1)).deleteChildShape(parentShape, childShape);
verify(layer, never()).removeShape(childShape);
}
use of org.kie.workbench.common.stunner.cm.client.shape.ActivityShape in project kie-wb-common by kiegroup.
the class CaseManagementCanvasHandlerTest method checkRegisterRenderableShapes.
@Test
@SuppressWarnings("unchecked")
public void checkRegisterRenderableShapes() {
final ActivityShape shape = makeShape();
final Node<View<BPMNViewDefinition>, Edge> node = makeNode("uuid", shape);
handler.register(shape, node, true);
verify(canvas, times(1)).addShape(eq(shape));
verify(canvas, times(1)).draw();
}
use of org.kie.workbench.common.stunner.cm.client.shape.ActivityShape in project kie-wb-common by kiegroup.
the class CaseManagementCanvasHandlerTest method checkDeregisterRenderableShapes.
@Test
public void checkDeregisterRenderableShapes() {
final ActivityShape shape = makeShape();
final Node<View<BPMNViewDefinition>, Edge> node = makeNode("uuid", shape);
handler.deregister(shape, node, true);
verify(canvas, times(1)).deleteShape(eq(shape));
verify(canvas, times(1)).draw();
}
use of org.kie.workbench.common.stunner.cm.client.shape.ActivityShape in project kie-wb-common by kiegroup.
the class CaseManagementCanvasHandlerTest method checkApplyElementMutationRenderableShapes.
@Test
@SuppressWarnings("unchecked")
public void checkApplyElementMutationRenderableShapes() {
final ActivityShape shape = spy(makeShape());
final Node<View<BPMNViewDefinition>, Edge> node = makeNode("uuid", shape);
final MutationContext mutationContext = mock(MutationContext.class);
doNothing().when(shape).applyPosition(eq(node), eq(mutationContext));
doNothing().when(shape).applyProperties(eq(node), eq(mutationContext));
doNothing().when(shape).applyTitle(anyString(), any(Node.class), eq(mutationContext));
handler.applyElementMutation(shape, node, true, true, mutationContext);
verify(shape, times(1)).applyPosition(eq(node), eq(mutationContext));
verify(shape, times(1)).applyProperties(eq(node), eq(mutationContext));
verify(canvas, times(1)).draw();
}
Aggregations