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);
}
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());
}
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());
}
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());
}
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());
}
Aggregations