Search in sources :

Example 1 with MockCaseManagementShape

use of org.kie.workbench.common.stunner.cm.client.wires.MockCaseManagementShape in project kie-wb-common by kiegroup.

the class CaseManagementCanvasViewTest method addChildShape.

@Test
public void addChildShape() {
    final MockCaseManagementShape parent = new MockCaseManagementShape();
    final MockCaseManagementShape child = new MockCaseManagementShape();
    view.addChildShape(parent, child, 0);
    assertEquals(1, parent.getChildShapes().size());
    assertEquals(child, parent.getChildShapes().get(0));
}
Also used : MockCaseManagementShape(org.kie.workbench.common.stunner.cm.client.wires.MockCaseManagementShape) Test(org.junit.Test)

Example 2 with MockCaseManagementShape

use of org.kie.workbench.common.stunner.cm.client.wires.MockCaseManagementShape in project kie-wb-common by kiegroup.

the class CaseManagementContainmentAcceptorControlImplTest method testAcceptContainment.

@Test
public void testAcceptContainment() {
    control.enable(canvasHandler);
    final WiresShape parentShape = makeWiresShape(PARENT_UUID);
    final WiresShape childShape = makeWiresShape(CANDIDATE_UUID);
    final MockCaseManagementShape ghost = makeWiresShape(CANDIDATE_UUID);
    state.setGhost(Optional.of(ghost));
    final boolean isAccept = control.CONTAINMENT_ACCEPTOR.acceptContainment(parentShape, new WiresShape[] { childShape });
    assertTrue(isAccept);
    verify(canvasCommandFactory, times(1)).setChildNode(any(Node.class), any(Node.class), eq(Optional.of(0)), eq(Optional.empty()), eq(Optional.empty()));
}
Also used : WiresShape(com.ait.lienzo.client.core.shape.wires.WiresShape) Node(org.kie.workbench.common.stunner.core.graph.Node) MockCaseManagementShape(org.kie.workbench.common.stunner.cm.client.wires.MockCaseManagementShape) Test(org.junit.Test)

Example 3 with MockCaseManagementShape

use of org.kie.workbench.common.stunner.cm.client.wires.MockCaseManagementShape in project kie-wb-common by kiegroup.

the class CaseManagementCanvasViewTest method addWiresShape.

@Test
public void addWiresShape() {
    final MockCaseManagementShape shape = new MockCaseManagementShape();
    final String uuid = shape.uuid();
    shape.setUUID(uuid);
    view.addShape(shape);
    final WiresShape registeredShape = view.getWiresManager().getShape(uuid);
    assertNotNull(registeredShape);
    assertEquals(shape, registeredShape);
}
Also used : WiresShape(com.ait.lienzo.client.core.shape.wires.WiresShape) MockCaseManagementShape(org.kie.workbench.common.stunner.cm.client.wires.MockCaseManagementShape) Test(org.junit.Test)

Example 4 with MockCaseManagementShape

use of org.kie.workbench.common.stunner.cm.client.wires.MockCaseManagementShape in project kie-wb-common by kiegroup.

the class CaseManagementContainmentAcceptorControlImplTest method makeWiresShape.

private MockCaseManagementShape makeWiresShape(Optional<String> uuid) {
    final MockCaseManagementShape shape = new MockCaseManagementShape();
    uuid.ifPresent(shape::setUUID);
    WiresUtils.assertShapeGroup(shape.getGroup(), WiresCanvas.WIRES_CANVAS_GROUP_ID);
    return shape;
}
Also used : MockCaseManagementShape(org.kie.workbench.common.stunner.cm.client.wires.MockCaseManagementShape)

Aggregations

MockCaseManagementShape (org.kie.workbench.common.stunner.cm.client.wires.MockCaseManagementShape)4 Test (org.junit.Test)3 WiresShape (com.ait.lienzo.client.core.shape.wires.WiresShape)2 Node (org.kie.workbench.common.stunner.core.graph.Node)1