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));
}
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()));
}
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);
}
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;
}
Aggregations