Search in sources :

Example 1 with NFastArrayList

use of com.ait.tooling.nativetools.client.collection.NFastArrayList in project kie-wb-common by kiegroup.

the class CaseManagementContainmentControlTest method setup.

@Before
public void setup() {
    layer = spy(new Layer());
    shape = spy(new MockCaseManagementShape());
    final Group shapeGroup = mock(Group.class);
    when(shapeGroup.getLayer()).thenReturn(layer);
    when(shape.getGroup()).thenReturn(shapeGroup);
    when(shape.getWiresManager()).thenReturn(wiresManager);
    when(shape.getGhost()).thenReturn(ghost);
    when(wiresManager.getContainmentAcceptor()).thenReturn(containmentAcceptor);
    when(parentPickerControl.getPickerOptions()).thenReturn(PICKER_OPTIONS);
    when(parentPickerControl.getShapeLocationControl()).thenReturn(shapeLocationControl);
    when(containmentControl.getParentPickerControl()).thenReturn(parentPickerControl);
    when(containmentControl.getShape()).thenReturn(shape);
    when(containmentControl.getParent()).thenReturn(parent);
    final NFastArrayList<WiresShape> children = new NFastArrayList<>();
    children.add(shape);
    children.add(ghost);
    when(parent.getChildShapes()).thenReturn(children);
    when(parent.getLayoutHandler()).thenReturn(parentLayoutHandler);
    when(parent.getIndex(eq(shape))).thenReturn(0);
    when(parent.getGroup()).thenReturn(new Group());
    when(state.getGhost()).thenReturn(Optional.of(ghost));
    when(state.getOriginalParent()).thenReturn(Optional.of(parent));
    when(state.getOriginalIndex()).thenReturn(Optional.of(0));
    control = new CaseManagementContainmentControl(containmentControl, state);
}
Also used : Group(com.ait.lienzo.client.core.shape.Group) WiresShape(com.ait.lienzo.client.core.shape.wires.WiresShape) NFastArrayList(com.ait.tooling.nativetools.client.collection.NFastArrayList) Layer(com.ait.lienzo.client.core.shape.Layer) Before(org.junit.Before)

Aggregations

Group (com.ait.lienzo.client.core.shape.Group)1 Layer (com.ait.lienzo.client.core.shape.Layer)1 WiresShape (com.ait.lienzo.client.core.shape.wires.WiresShape)1 NFastArrayList (com.ait.tooling.nativetools.client.collection.NFastArrayList)1 Before (org.junit.Before)1