Search in sources :

Example 1 with LimitedEntryBRLActionColumnSynchronizer

use of org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.LimitedEntryBRLActionColumnSynchronizer in project drools-wb by kiegroup.

the class BaseGuidedDecisionTablePresenterTest method setupPresenter.

protected GuidedDecisionTablePresenter setupPresenter() {
    final GuidedDecisionTablePresenter wrapped = new GuidedDecisionTablePresenter(identity, resourceType, ruleNameServiceCaller, decisionTableSelectedEvent, decisionTableColumnSelectedEvent, decisionTableSelectionsChangedEvent, refreshAttributesPanelEvent, refreshMetaDataPanelEvent, refreshConditionsPanelEvent, refreshActionsPanelEvent, refreshMenusEvent, notificationEvent, gridWidgetCellFactory, gridWidgetColumnFactory, oracleFactory, synchronizer, beanManager, lockManager, linkManager, clipboard, decisionTableAnalyzerProvider, enumLoaderUtilities, pluginHandler, authorizationManager, sessionInfo) {

        @Override
        void initialiseLockManager() {
        // Do nothing for tests
        }

        @Override
        GuidedDecisionTableRenderer makeViewRenderer() {
            return renderer;
        }

        @Override
        GuidedDecisionTableView makeView(final Set<PortableWorkDefinition> workItemDefinitions) {
            return view;
        }

        @Override
        void initialiseAuditLog() {
        // Do nothing for tests
        }

        @Override
        List<BaseColumnConverter> getConverters() {
            final List<BaseColumnConverter> converters = new ArrayList<BaseColumnConverter>();
            converters.add(new ActionInsertFactColumnConverter());
            converters.add(new ActionRetractFactColumnConverter());
            converters.add(new ActionSetFieldColumnConverter());
            converters.add(new ActionWorkItemExecuteColumnConverter());
            converters.add(new ActionWorkItemInsertFactColumnConverter());
            converters.add(new ActionWorkItemSetFieldColumnConverter());
            converters.add(new AttributeColumnConverter());
            converters.add(new BRLActionVariableColumnConverter());
            converters.add(new BRLConditionVariableColumnConverter());
            converters.add(new ConditionColumnConverter());
            converters.add(new DescriptionColumnConverter());
            converters.add(new LimitedEntryColumnConverter());
            converters.add(new MetaDataColumnConverter());
            converters.add(new RowNumberColumnConverter());
            return converters;
        }

        @Override
        List<Synchronizer<? extends Synchronizer.MetaData, ? extends Synchronizer.MetaData, ? extends Synchronizer.MetaData, ? extends Synchronizer.MetaData, ? extends Synchronizer.MetaData>> getSynchronizers() {
            final List<Synchronizer<? extends Synchronizer.MetaData, ? extends Synchronizer.MetaData, ? extends Synchronizer.MetaData, ? extends Synchronizer.MetaData, ? extends Synchronizer.MetaData>> synchronizers = new ArrayList<>();
            synchronizers.add(new ActionColumnSynchronizer());
            synchronizers.add(new ActionInsertFactColumnSynchronizer());
            synchronizers.add(new ActionRetractFactColumnSynchronizer());
            synchronizers.add(new ActionSetFieldColumnSynchronizer());
            synchronizers.add(new ActionWorkItemExecuteColumnSynchronizer());
            synchronizers.add(new ActionWorkItemInsertFactColumnSynchronizer());
            synchronizers.add(new ActionWorkItemSetFieldColumnSynchronizer());
            synchronizers.add(new AttributeColumnSynchronizer());
            synchronizers.add(new BRLActionColumnSynchronizer());
            synchronizers.add(new BRLConditionColumnSynchronizer());
            synchronizers.add(new ConditionColumnSynchronizer());
            synchronizers.add(new LimitedEntryBRLActionColumnSynchronizer());
            synchronizers.add(new LimitedEntryBRLConditionColumnSynchronizer());
            synchronizers.add(new MetaDataColumnSynchronizer());
            synchronizers.add(new RowSynchronizer());
            return synchronizers;
        }
    };
    GuidedDecisionTablePresenter presenter = spy(wrapped);
    model = new GuidedDecisionTable52();
    final PackageDataModelOracleBaselinePayload dmoBaseline = mock(PackageDataModelOracleBaselinePayload.class);
    final Set<PortableWorkDefinition> workItemDefinitions = Collections.emptySet();
    final Overview overview = mock(Overview.class);
    dtContent = new GuidedDecisionTableEditorContent(model, workItemDefinitions, overview, dmoBaseline);
    when(oracleFactory.makeAsyncPackageDataModelOracle(any(Path.class), any(GuidedDecisionTable52.class), eq(dmoBaseline))).thenReturn(oracle);
    when(view.getLayer()).thenReturn(gridLayer);
    when(modellerPresenter.getView()).thenReturn(modellerView);
    when(modellerView.getGridLayerView()).thenReturn(gridLayer);
    when(presenter.getModellerPresenter()).thenReturn(modellerPresenter);
    presenter.setContent(dtPath, dtPlaceRequest, dtContent, modellerPresenter, false);
    return presenter;
}
Also used : Set(java.util.Set) LimitedEntryBRLActionColumnSynchronizer(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.LimitedEntryBRLActionColumnSynchronizer) BRLActionColumnSynchronizer(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.BRLActionColumnSynchronizer) ActionColumnSynchronizer(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.ActionColumnSynchronizer) GuidedDecisionTable52(org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52) ActionWorkItemInsertFactColumnConverter(org.drools.workbench.screens.guided.dtable.client.widget.table.model.converters.column.impl.ActionWorkItemInsertFactColumnConverter) RowSynchronizer(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.RowSynchronizer) ArrayList(java.util.ArrayList) ActionRetractFactColumnConverter(org.drools.workbench.screens.guided.dtable.client.widget.table.model.converters.column.impl.ActionRetractFactColumnConverter) ActionRetractFactColumnSynchronizer(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.ActionRetractFactColumnSynchronizer) AttributeColumnSynchronizer(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.AttributeColumnSynchronizer) ConditionColumnSynchronizer(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.ConditionColumnSynchronizer) BRLConditionColumnSynchronizer(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.BRLConditionColumnSynchronizer) LimitedEntryBRLConditionColumnSynchronizer(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.LimitedEntryBRLConditionColumnSynchronizer) LimitedEntryBRLActionColumnSynchronizer(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.LimitedEntryBRLActionColumnSynchronizer) LimitedEntryBRLConditionColumnSynchronizer(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.LimitedEntryBRLConditionColumnSynchronizer) ActionInsertFactColumnSynchronizer(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.ActionInsertFactColumnSynchronizer) MetaDataColumnConverter(org.drools.workbench.screens.guided.dtable.client.widget.table.model.converters.column.impl.MetaDataColumnConverter) ActionWorkItemExecuteColumnConverter(org.drools.workbench.screens.guided.dtable.client.widget.table.model.converters.column.impl.ActionWorkItemExecuteColumnConverter) ActionWorkItemInsertFactColumnSynchronizer(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.ActionWorkItemInsertFactColumnSynchronizer) PortableWorkDefinition(org.drools.workbench.models.datamodel.workitems.PortableWorkDefinition) ConditionColumnConverter(org.drools.workbench.screens.guided.dtable.client.widget.table.model.converters.column.impl.ConditionColumnConverter) DescriptionColumnConverter(org.drools.workbench.screens.guided.dtable.client.widget.table.model.converters.column.impl.DescriptionColumnConverter) ActionWorkItemSetFieldColumnConverter(org.drools.workbench.screens.guided.dtable.client.widget.table.model.converters.column.impl.ActionWorkItemSetFieldColumnConverter) BaseColumnConverter(org.drools.workbench.screens.guided.dtable.client.widget.table.model.converters.column.BaseColumnConverter) BRLConditionVariableColumnConverter(org.drools.workbench.screens.guided.dtable.client.widget.table.model.converters.column.impl.BRLConditionVariableColumnConverter) ObservablePath(org.uberfire.backend.vfs.ObservablePath) Path(org.uberfire.backend.vfs.Path) LimitedEntryBRLActionColumnSynchronizer(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.LimitedEntryBRLActionColumnSynchronizer) ActionWorkItemSetFieldColumnSynchronizer(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.ActionWorkItemSetFieldColumnSynchronizer) ActionRetractFactColumnSynchronizer(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.ActionRetractFactColumnSynchronizer) BRLActionColumnSynchronizer(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.BRLActionColumnSynchronizer) ConditionColumnSynchronizer(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.ConditionColumnSynchronizer) ModelSynchronizer(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.ModelSynchronizer) ActionWorkItemInsertFactColumnSynchronizer(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.ActionWorkItemInsertFactColumnSynchronizer) MetaDataColumnSynchronizer(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.MetaDataColumnSynchronizer) BRLConditionColumnSynchronizer(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.BRLConditionColumnSynchronizer) ActionInsertFactColumnSynchronizer(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.ActionInsertFactColumnSynchronizer) AttributeColumnSynchronizer(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.AttributeColumnSynchronizer) ActionSetFieldColumnSynchronizer(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.ActionSetFieldColumnSynchronizer) Synchronizer(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.Synchronizer) LimitedEntryBRLConditionColumnSynchronizer(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.LimitedEntryBRLConditionColumnSynchronizer) ActionColumnSynchronizer(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.ActionColumnSynchronizer) ActionWorkItemExecuteColumnSynchronizer(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.ActionWorkItemExecuteColumnSynchronizer) RowSynchronizer(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.RowSynchronizer) ActionWorkItemSetFieldColumnSynchronizer(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.ActionWorkItemSetFieldColumnSynchronizer) GuidedDecisionTableEditorContent(org.drools.workbench.screens.guided.dtable.model.GuidedDecisionTableEditorContent) MetaDataColumnSynchronizer(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.MetaDataColumnSynchronizer) Overview(org.guvnor.common.services.shared.metadata.model.Overview) ActionInsertFactColumnConverter(org.drools.workbench.screens.guided.dtable.client.widget.table.model.converters.column.impl.ActionInsertFactColumnConverter) LimitedEntryBRLActionColumnSynchronizer(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.LimitedEntryBRLActionColumnSynchronizer) BRLActionColumnSynchronizer(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.BRLActionColumnSynchronizer) ActionWorkItemExecuteColumnSynchronizer(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.ActionWorkItemExecuteColumnSynchronizer) ActionSetFieldColumnConverter(org.drools.workbench.screens.guided.dtable.client.widget.table.model.converters.column.impl.ActionSetFieldColumnConverter) LimitedEntryColumnConverter(org.drools.workbench.screens.guided.dtable.client.widget.table.model.converters.column.impl.LimitedEntryColumnConverter) ActionSetFieldColumnSynchronizer(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.ActionSetFieldColumnSynchronizer) PackageDataModelOracleBaselinePayload(org.kie.workbench.common.services.datamodel.model.PackageDataModelOracleBaselinePayload) RowNumberColumnConverter(org.drools.workbench.screens.guided.dtable.client.widget.table.model.converters.column.impl.RowNumberColumnConverter) AttributeColumnConverter(org.drools.workbench.screens.guided.dtable.client.widget.table.model.converters.column.impl.AttributeColumnConverter) BRLActionVariableColumnConverter(org.drools.workbench.screens.guided.dtable.client.widget.table.model.converters.column.impl.BRLActionVariableColumnConverter) BRLConditionColumnSynchronizer(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.BRLConditionColumnSynchronizer) LimitedEntryBRLConditionColumnSynchronizer(org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.impl.LimitedEntryBRLConditionColumnSynchronizer)

Aggregations

ArrayList (java.util.ArrayList)1 Set (java.util.Set)1 PortableWorkDefinition (org.drools.workbench.models.datamodel.workitems.PortableWorkDefinition)1 GuidedDecisionTable52 (org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52)1 BaseColumnConverter (org.drools.workbench.screens.guided.dtable.client.widget.table.model.converters.column.BaseColumnConverter)1 ActionInsertFactColumnConverter (org.drools.workbench.screens.guided.dtable.client.widget.table.model.converters.column.impl.ActionInsertFactColumnConverter)1 ActionRetractFactColumnConverter (org.drools.workbench.screens.guided.dtable.client.widget.table.model.converters.column.impl.ActionRetractFactColumnConverter)1 ActionSetFieldColumnConverter (org.drools.workbench.screens.guided.dtable.client.widget.table.model.converters.column.impl.ActionSetFieldColumnConverter)1 ActionWorkItemExecuteColumnConverter (org.drools.workbench.screens.guided.dtable.client.widget.table.model.converters.column.impl.ActionWorkItemExecuteColumnConverter)1 ActionWorkItemInsertFactColumnConverter (org.drools.workbench.screens.guided.dtable.client.widget.table.model.converters.column.impl.ActionWorkItemInsertFactColumnConverter)1 ActionWorkItemSetFieldColumnConverter (org.drools.workbench.screens.guided.dtable.client.widget.table.model.converters.column.impl.ActionWorkItemSetFieldColumnConverter)1 AttributeColumnConverter (org.drools.workbench.screens.guided.dtable.client.widget.table.model.converters.column.impl.AttributeColumnConverter)1 BRLActionVariableColumnConverter (org.drools.workbench.screens.guided.dtable.client.widget.table.model.converters.column.impl.BRLActionVariableColumnConverter)1 BRLConditionVariableColumnConverter (org.drools.workbench.screens.guided.dtable.client.widget.table.model.converters.column.impl.BRLConditionVariableColumnConverter)1 ConditionColumnConverter (org.drools.workbench.screens.guided.dtable.client.widget.table.model.converters.column.impl.ConditionColumnConverter)1 DescriptionColumnConverter (org.drools.workbench.screens.guided.dtable.client.widget.table.model.converters.column.impl.DescriptionColumnConverter)1 LimitedEntryColumnConverter (org.drools.workbench.screens.guided.dtable.client.widget.table.model.converters.column.impl.LimitedEntryColumnConverter)1 MetaDataColumnConverter (org.drools.workbench.screens.guided.dtable.client.widget.table.model.converters.column.impl.MetaDataColumnConverter)1 RowNumberColumnConverter (org.drools.workbench.screens.guided.dtable.client.widget.table.model.converters.column.impl.RowNumberColumnConverter)1 ModelSynchronizer (org.drools.workbench.screens.guided.dtable.client.widget.table.model.synchronizers.ModelSynchronizer)1