Search in sources :

Example 26 with DecisionTableSelectedEvent

use of org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectedEvent in project drools-wb by kiegroup.

the class RadarMenuBuilderTest method testOnDecisionTableSelectedEventNoTableSelected.

@Test
public void testOnDecisionTableSelectedEventNoTableSelected() {
    final DecisionTableSelectedEvent event = DecisionTableSelectedEvent.NONE;
    builder.onDecisionTableSelectedEvent(event);
    verify(view, times(1)).setEnabled(false);
}
Also used : DecisionTableSelectedEvent(org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectedEvent) Test(org.junit.Test)

Example 27 with DecisionTableSelectedEvent

use of org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectedEvent in project drools-wb by kiegroup.

the class ViewMenuBuilderTest method testOnDecisionTableSelectedEventReadOnly.

@Test
public void testOnDecisionTableSelectedEventReadOnly() {
    // ViewMenuBuilder.setup() called in @Setup disables view by default
    assertFalse(builder.miToggleMergeState.getMenuItem().isEnabled());
    assertFalse(builder.miViewAuditLog.getMenuItem().isEnabled());
    dtPresenter.getAccess().setReadOnly(true);
    builder.onDecisionTableSelectedEvent(new DecisionTableSelectedEvent(dtPresenter));
    // Verify selecting a read-only Decision Table also disables view
    assertFalse(builder.miToggleMergeState.getMenuItem().isEnabled());
    assertFalse(builder.miViewAuditLog.getMenuItem().isEnabled());
}
Also used : DecisionTableSelectedEvent(org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectedEvent) Test(org.junit.Test)

Example 28 with DecisionTableSelectedEvent

use of org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectedEvent in project drools-wb by kiegroup.

the class ViewMenuBuilderTest method testOnDecisionTableSelectedEventWithNonOtherwiseColumnSelected.

@Test
public void testOnDecisionTableSelectedEventWithNonOtherwiseColumnSelected() {
    builder.onDecisionTableSelectedEvent(new DecisionTableSelectedEvent(dtPresenter));
    assertTrue(builder.miToggleMergeState.getMenuItem().isEnabled());
    assertTrue(builder.miViewAuditLog.getMenuItem().isEnabled());
}
Also used : DecisionTableSelectedEvent(org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectedEvent) Test(org.junit.Test)

Example 29 with DecisionTableSelectedEvent

use of org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectedEvent in project drools-wb by kiegroup.

the class ColumnsPagePresenterTest method testOnDecisionTableSelectedWhenEventDoesNotHaveActiveDecisionTable.

@Test
public void testOnDecisionTableSelectedWhenEventDoesNotHaveActiveDecisionTable() {
    final DecisionTableSelectedEvent event = mock(DecisionTableSelectedEvent.class);
    doReturn(true).when(presenter).hasActiveDecisionTable();
    doReturn(Optional.empty()).when(event).getPresenter();
    presenter.onDecisionTableSelected(event);
    verify(presenter, never()).setupRuleSelector(any());
}
Also used : DecisionTableSelectedEvent(org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectedEvent) Test(org.junit.Test)

Example 30 with DecisionTableSelectedEvent

use of org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectedEvent in project drools-wb by kiegroup.

the class ColumnsPagePresenterTest method testOnDecisionTableSelectedWhenEventAndActiveDecisionTableAreEqual.

@Test
public void testOnDecisionTableSelectedWhenEventAndActiveDecisionTableAreEqual() {
    final DecisionTableSelectedEvent event = mock(DecisionTableSelectedEvent.class);
    final GuidedDecisionTableView.Presenter presenterDecisionTable = mock(GuidedDecisionTableView.Presenter.class);
    doReturn(true).when(presenter).hasActiveDecisionTable();
    doReturn(Optional.of(presenterDecisionTable)).when(modeller).getActiveDecisionTable();
    doReturn(Optional.of(presenterDecisionTable)).when(event).getPresenter();
    presenter.onDecisionTableSelected(event);
    verify(presenter, never()).setupRuleSelector(any());
}
Also used : GuidedDecisionTableView(org.drools.workbench.screens.guided.dtable.client.widget.table.GuidedDecisionTableView) DecisionTableSelectedEvent(org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectedEvent) Test(org.junit.Test)

Aggregations

DecisionTableSelectedEvent (org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectedEvent)58 Test (org.junit.Test)54 GuidedDecisionTableView (org.drools.workbench.screens.guided.dtable.client.widget.table.GuidedDecisionTableView)14 ObservablePath (org.uberfire.backend.vfs.ObservablePath)10 PlaceRequest (org.uberfire.mvp.PlaceRequest)10 GuidedDecisionTablePresenter (org.drools.workbench.screens.guided.dtable.client.widget.table.GuidedDecisionTablePresenter)9 GuidedDecisionTableEditorContent (org.drools.workbench.screens.guided.dtable.model.GuidedDecisionTableEditorContent)9 MetadataCol52 (org.drools.workbench.models.guided.dtable.shared.model.MetadataCol52)7 DTCellValue52 (org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52)5 GuidedDecisionTableEditorGraphContent (org.drools.workbench.screens.guided.dtable.model.GuidedDecisionTableEditorGraphContent)2 GuidedDecisionTableGraphEntry (org.drools.workbench.screens.guided.dtable.model.GuidedDecisionTableEditorGraphModel.GuidedDecisionTableGraphEntry)2 OverviewWidgetPresenter (org.kie.workbench.common.widgets.metadata.client.widget.OverviewWidgetPresenter)2 Matchers.anyBoolean (org.mockito.Matchers.anyBoolean)2 MultiPageEditor (org.uberfire.client.workbench.widgets.multipage.MultiPageEditor)2 PathPlaceRequest (org.uberfire.mvp.impl.PathPlaceRequest)2 PostConstruct (javax.annotation.PostConstruct)1 GuidedDecisionTable52 (org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52)1 Overview (org.guvnor.common.services.shared.metadata.model.Overview)1 AsyncPackageDataModelOracle (org.kie.workbench.common.widgets.client.datamodel.AsyncPackageDataModelOracle)1 ImportsWidgetPresenter (org.kie.workbench.common.widgets.configresource.client.widget.bound.ImportsWidgetPresenter)1