Search in sources :

Example 1 with SaveAndRenameCommandBuilder

use of org.uberfire.ext.editor.commons.client.menu.common.SaveAndRenameCommandBuilder in project kie-wb-common by kiegroup.

the class AbstractProjectDiagramEditor method initialiseKieEditorForSession.

public void initialiseKieEditorForSession(final ProjectDiagram diagram) {
    resetEditorPages(diagram.getMetadata().getOverview());
    updateTitle(diagram.getName());
    addDocumentationPage(diagram);
    hideLoadingViews();
    menuSessionItems.bind(getSession());
    SaveAndRenameCommandBuilder saveAndRenameCommandBuilder = getSaveAndRenameCommandBuilder();
    saveAndRenameCommandBuilder.addContentSupplier(getContentSupplier());
}
Also used : SaveAndRenameCommandBuilder(org.uberfire.ext.editor.commons.client.menu.common.SaveAndRenameCommandBuilder)

Example 2 with SaveAndRenameCommandBuilder

use of org.uberfire.ext.editor.commons.client.menu.common.SaveAndRenameCommandBuilder in project drools-wb by kiegroup.

the class ScenarioSimulationEditorBusinessCentralWrapperTest method setup.

@Before
public void setup() {
    super.setup();
    promises = new SyncPromises();
    scenarioSimulationCaller = spy(new CallerMock<>(scenarioSimulationServiceMock));
    importExportCaller = spy(new CallerMock<>(importExportServiceMock));
    runnerReportServiceCaller = spy(new CallerMock<>(runnerReportServiceMock));
    dmnTypeServiceCaller = spy(new CallerMock<>(dmnTypeServiceMock));
    saveAndRenameCommandBuilderMock = spy(new SaveAndRenameCommandBuilder<>(null, null, null, null));
    scenarioSimulationEditorBusinessClientWrapper = spy(new ScenarioSimulationEditorBusinessCentralWrapper(scenarioSimulationCaller, scenarioSimulationEditorPresenterMock, importsWidgetPresenterMock, oracleFactoryMock, placeManagerMock, dmnTypeServiceCaller, importExportCaller, runnerReportServiceCaller, sessionInfoMock, unpublishMessagesEventMock, scenarioSimulationBusinessCentralDocksHandlerMock) {

        {
            this.kieView = kieViewMock;
            this.overviewWidget = overviewWidgetPresenterMock;
            this.fileMenuBuilder = fileMenuBuilderMock;
            this.fileNameValidator = fileNameValidatorMock;
            this.versionRecordManager = versionRecordManagerMock;
            this.notification = notificationMock;
            this.workbenchContext = workbenchContextMock;
            this.alertsButtonMenuItemBuilder = alertsButtonMenuItemBuilderMock;
            this.docks = docksMock;
            this.perspectiveManager = perspectiveManagerMock;
            this.baseView = scenarioSimulationViewMock;
            this.promises = ScenarioSimulationEditorBusinessCentralWrapperTest.this.promises;
            this.metadata = metaDataMock;
            this.saveAndRenameCommandBuilder = saveAndRenameCommandBuilderMock;
            this.assetUpdateValidator = assetUpdateValidatorMock;
            this.projectController = projectControllerMock;
            this.place = placeRequestMock;
        }
    });
    when(placeRequestMock.getPath()).thenReturn(observablePathMock);
    when(scenarioSimulationEditorPresenterMock.getType()).thenReturn(scenarioSimulationResourceType);
    when(scenarioSimulationEditorPresenterMock.getPopulateTestToolsCommand()).thenReturn(populateTestToolsCommand);
    when(scenarioSimulationEditorPresenterMock.getJsonModel(any())).thenReturn("");
    when(scenarioSimulationEditorPresenterMock.getView()).thenReturn(scenarioSimulationViewMock);
    when(scenarioSimulationEditorPresenterMock.getModel()).thenReturn(scenarioSimulationModelMock);
    when(scenarioSimulationEditorPresenterMock.getContext()).thenReturn(scenarioSimulationContextLocal);
    when(scenarioSimulationEditorPresenterMock.getExportCallBack()).thenReturn(exportCallBackMock);
    when(scenarioSimulationEditorPresenterMock.getPath()).thenReturn(pathMock);
    when(alertsButtonMenuItemBuilderMock.build()).thenReturn(alertsButtonMenuItemMock);
    when(versionRecordManagerMock.buildMenu()).thenReturn(versionRecordMenuItemMock);
    when(scenarioGridWidgetSpy.getScenarioSimulationContext()).thenReturn(scenarioSimulationContextLocal);
    when(kieViewMock.getMultiPage()).thenReturn(multiPageEditorMock);
    when(multiPageEditorMock.getView()).thenReturn(multiPageEditorViewMock);
    when(multiPageEditorViewMock.getTabBar()).thenReturn(navTabsMock);
    when(multiPageEditorViewMock.getPageIndex(CommonConstants.INSTANCE.EditTabTitle())).thenReturn(SIMULATION_TAB_INDEX);
    when(multiPageEditorViewMock.getPageIndex(ScenarioSimulationEditorConstants.INSTANCE.backgroundTabTitle())).thenReturn(BACKGROUND_TAB_INDEX);
    when(navTabsMock.getWidget(SIMULATION_TAB_INDEX)).thenReturn(simulationTabListItemMock);
    when(navTabsMock.getWidget(BACKGROUND_TAB_INDEX)).thenReturn(backgroundTabListItemMock);
    when(scenarioSimulationBusinessCentralDocksHandlerMock.getCoverageReportPresenter()).thenReturn(coverageReportPresenterMock);
    when(scenarioSimulationBusinessCentralDocksHandlerMock.getTestRunnerReportingPanelWidget()).thenReturn(testRunnerReportingPanelWidgetMock);
    when(simulationRunResultMock.getTestResultMessage()).thenReturn(testResultMessageMock);
    when(simulationRunResultMock.getSimulationRunMetadata()).thenReturn(simulationRunMetadataMock);
    when(sessionInfoMock.getId()).thenReturn(SESSION_ID);
}
Also used : SyncPromises(org.uberfire.promise.SyncPromises) SaveAndRenameCommandBuilder(org.uberfire.ext.editor.commons.client.menu.common.SaveAndRenameCommandBuilder) CallerMock(org.uberfire.mocks.CallerMock) Before(org.junit.Before)

Aggregations

SaveAndRenameCommandBuilder (org.uberfire.ext.editor.commons.client.menu.common.SaveAndRenameCommandBuilder)2 Before (org.junit.Before)1 CallerMock (org.uberfire.mocks.CallerMock)1 SyncPromises (org.uberfire.promise.SyncPromises)1