Search in sources :

Example 1 with ManagedInstanceStub

use of org.kie.workbench.common.stunner.core.client.ManagedInstanceStub in project kie-wb-common by kiegroup.

the class StunnerEditorTest method setup.

@Before
@SuppressWarnings("unchecked")
public void setup() {
    sessionEditorPresenters = spy(new ManagedInstanceStub<>(sessionEditorPresenter));
    sessionViewerPresenters = spy(new ManagedInstanceStub<>(sessionViewerPresenter));
    when(sessionEditorPresenter.getView()).thenReturn(sessionPresenterView);
    when(sessionViewerPresenter.getView()).thenReturn(sessionPresenterView);
    when(sessionEditorPresenter.getInstance()).thenReturn(editorSession);
    when(sessionViewerPresenter.getInstance()).thenReturn(viewerSession);
    when(sessionEditorPresenter.getHandler()).thenReturn(canvasHandler);
    when(sessionViewerPresenter.getHandler()).thenReturn(canvasHandler);
    xmlEditorViews = spy(new ManagedInstanceStub<>(xmlEditorView));
    when(xmlEditorView.asWidget()).thenReturn(xmlEditorViewWidget);
    Metadata metadata = new MetadataImpl.MetadataImplBuilder("testSet").build();
    diagram = new DiagramImpl("testDiagram", mock(Graph.class), metadata);
    when(editorSession.getCanvasHandler()).thenReturn(canvasHandler);
    when(viewerSession.getCanvasHandler()).thenReturn(canvasHandler);
    when(canvasHandler.getDiagram()).thenReturn(diagram);
    tested = new StunnerEditor(sessionEditorPresenters, sessionViewerPresenters, translationService, xmlEditorViews, errorPopupPresenter, view);
}
Also used : ManagedInstanceStub(org.kie.workbench.common.stunner.core.client.ManagedInstanceStub) MetadataImpl(org.kie.workbench.common.stunner.core.diagram.MetadataImpl) DiagramImpl(org.kie.workbench.common.stunner.core.diagram.DiagramImpl) Metadata(org.kie.workbench.common.stunner.core.diagram.Metadata) Before(org.junit.Before)

Example 2 with ManagedInstanceStub

use of org.kie.workbench.common.stunner.core.client.ManagedInstanceStub in project kie-wb-common by kiegroup.

the class StunnerBPMNEntryPointTest method setUp.

@Before
public void setUp() throws Exception {
    diagramDef = new BPMNDiagramImpl();
    when(bpmnDiagramFilterProvider.getDefinitionType()).thenReturn((Class) BPMNDiagramImpl.class);
    intermediateEventDef = new IntermediateTimerEvent();
    when(catchingIntermediateEventFilterProvider.getDefinitionType()).thenReturn((Class) IntermediateTimerEvent.class);
    startEventDef = new StartNoneEvent();
    when(startEventFilterProvider.getDefinitionType()).thenReturn((Class) StartNoneEvent.class);
    managedFilters = new ManagedInstanceStub(bpmnDiagramFilterProvider, startEventFilterProvider, catchingIntermediateEventFilterProvider);
    tested = new StunnerBPMNEntryPoint(sessionManager, managedFilters);
}
Also used : ManagedInstanceStub(org.kie.workbench.common.stunner.core.client.ManagedInstanceStub) IntermediateTimerEvent(org.kie.workbench.common.stunner.bpmn.definition.IntermediateTimerEvent) BPMNDiagramImpl(org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl) StartNoneEvent(org.kie.workbench.common.stunner.bpmn.definition.StartNoneEvent) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)2 ManagedInstanceStub (org.kie.workbench.common.stunner.core.client.ManagedInstanceStub)2 BPMNDiagramImpl (org.kie.workbench.common.stunner.bpmn.definition.BPMNDiagramImpl)1 IntermediateTimerEvent (org.kie.workbench.common.stunner.bpmn.definition.IntermediateTimerEvent)1 StartNoneEvent (org.kie.workbench.common.stunner.bpmn.definition.StartNoneEvent)1 DiagramImpl (org.kie.workbench.common.stunner.core.diagram.DiagramImpl)1 Metadata (org.kie.workbench.common.stunner.core.diagram.Metadata)1 MetadataImpl (org.kie.workbench.common.stunner.core.diagram.MetadataImpl)1