Search in sources :

Example 36 with PlaceRequest

use of org.uberfire.mvp.PlaceRequest in project drools-wb by kiegroup.

the class GuidedDecisionTableGraphEditorPresenterTest method checkDoSaveWithGraphEntry.

private void checkDoSaveWithGraphEntry(final ParameterizedCommand<OnSaveSetupDataHolder> setup, final Command assertion) {
    final ObservablePath dtGraphPath = mock(ObservablePath.class);
    final PathPlaceRequest dtGraphPlaceRequest = mock(PathPlaceRequest.class);
    final GuidedDecisionTableEditorGraphContent dtGraphContent = makeDecisionTableGraphContent();
    final ObservablePath dtPath = mock(ObservablePath.class);
    final PlaceRequest dtPlaceRequest = mock(PlaceRequest.class);
    final GuidedDecisionTableEditorContent dtContent = makeDecisionTableContent(0);
    final GuidedDecisionTableView.Presenter dtPresenter = makeDecisionTable(dtPath, dtPath, dtPlaceRequest, dtContent);
    final GuidedDecisionTableGraphEntry dtGraphEntry = new GuidedDecisionTableGraphEntry(dtPath, dtPath);
    dtGraphContent.getModel().getEntries().add(dtGraphEntry);
    when(dtPath.toURI()).thenReturn("dtPath");
    when(dtGraphPath.toURI()).thenReturn("dtGraphPath");
    when(dtGraphPath.getFileName()).thenReturn("filename");
    when(dtService.loadContent(eq(dtPath))).thenReturn(dtContent);
    when(dtGraphService.loadContent(eq(dtGraphPath))).thenReturn(dtGraphContent);
    when(versionRecordManager.getCurrentPath()).thenReturn(dtGraphPath);
    when(modeller.addDecisionTable(any(ObservablePath.class), any(PlaceRequest.class), any(GuidedDecisionTableEditorContent.class), any(Boolean.class), any(Double.class), any(Double.class))).thenReturn(dtPresenter);
    when(modeller.getAvailableDecisionTables()).thenReturn(new HashSet<GuidedDecisionTableView.Presenter>() {

        {
            add(dtPresenter);
        }
    });
    setup.execute(new OnSaveSetupDataHolder(dtGraphPath, dtGraphPlaceRequest, dtPresenter));
    presenter.doSave();
    assertion.execute();
}
Also used : PathPlaceRequest(org.uberfire.mvp.impl.PathPlaceRequest) PlaceRequest(org.uberfire.mvp.PlaceRequest) GuidedDecisionTableEditorContent(org.drools.workbench.screens.guided.dtable.model.GuidedDecisionTableEditorContent) GuidedDecisionTableView(org.drools.workbench.screens.guided.dtable.client.widget.table.GuidedDecisionTableView) GuidedDecisionTableGraphEntry(org.drools.workbench.screens.guided.dtable.model.GuidedDecisionTableEditorGraphModel.GuidedDecisionTableGraphEntry) GuidedDecisionTableEditorGraphContent(org.drools.workbench.screens.guided.dtable.model.GuidedDecisionTableEditorGraphContent) GuidedDecisionTablePresenter(org.drools.workbench.screens.guided.dtable.client.widget.table.GuidedDecisionTablePresenter) OverviewWidgetPresenter(org.kie.workbench.common.widgets.metadata.client.widget.OverviewWidgetPresenter) PathPlaceRequest(org.uberfire.mvp.impl.PathPlaceRequest) ObservablePath(org.uberfire.backend.vfs.ObservablePath)

Aggregations

PlaceRequest (org.uberfire.mvp.PlaceRequest)36 ObservablePath (org.uberfire.backend.vfs.ObservablePath)33 Test (org.junit.Test)29 GuidedDecisionTableEditorContent (org.drools.workbench.screens.guided.dtable.model.GuidedDecisionTableEditorContent)26 GuidedDecisionTableView (org.drools.workbench.screens.guided.dtable.client.widget.table.GuidedDecisionTableView)25 PathPlaceRequest (org.uberfire.mvp.impl.PathPlaceRequest)13 GuidedDecisionTablePresenter (org.drools.workbench.screens.guided.dtable.client.widget.table.GuidedDecisionTablePresenter)12 DecisionTableSelectedEvent (org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectedEvent)10 GuidedDecisionTableEditorGraphContent (org.drools.workbench.screens.guided.dtable.model.GuidedDecisionTableEditorGraphContent)10 OverviewWidgetPresenter (org.kie.workbench.common.widgets.metadata.client.widget.OverviewWidgetPresenter)7 GuidedDecisionTable52 (org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52)6 Path (org.uberfire.backend.vfs.Path)6 GuidedDecisionTableGraphEntry (org.drools.workbench.screens.guided.dtable.model.GuidedDecisionTableEditorGraphModel.GuidedDecisionTableGraphEntry)5 Metadata (org.guvnor.common.services.shared.metadata.model.Metadata)4 NotificationEvent (org.uberfire.workbench.events.NotificationEvent)4 MultiPageEditor (org.uberfire.client.workbench.widgets.multipage.MultiPageEditor)3 Scheduler (com.google.gwt.core.client.Scheduler)2 Command (com.google.gwt.user.client.Command)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2