use of org.drools.workbench.models.guided.dtable.shared.model.ActionCol52 in project drools-wb by kiegroup.
the class ColumnsPagePresenterTest method testRefresh.
@Test
public void testRefresh() {
final GuidedDecisionTable52 guidedDecisionTable52 = mock(GuidedDecisionTable52.class);
doReturn(Optional.of(guidedDecisionTable52)).when(presenter).getGuidedDecisionTable52();
doNothing().when(presenter).refreshAttributeWidget(any());
doNothing().when(presenter).refreshMetaDataWidget(any());
doNothing().when(presenter).refreshConditionsWidget(any());
doNothing().when(presenter).refreshActionsWidget(any());
final List<AttributeCol52> attributeCol52s = new ArrayList<>();
final List<MetadataCol52> metadataCol52s = new ArrayList<>();
final List<CompositeColumn<? extends BaseColumn>> compositeColumns = new ArrayList<>();
final List<ActionCol52> actionCol52s = new ArrayList<>();
doReturn(attributeCol52s).when(guidedDecisionTable52).getAttributeCols();
doReturn(metadataCol52s).when(guidedDecisionTable52).getAttributeCols();
doReturn(compositeColumns).when(guidedDecisionTable52).getAttributeCols();
doReturn(actionCol52s).when(guidedDecisionTable52).getAttributeCols();
presenter.refresh();
verify(presenter).refreshAttributeWidget(attributeCol52s);
verify(presenter).refreshMetaDataWidget(metadataCol52s);
verify(presenter).refreshConditionsWidget(compositeColumns);
verify(presenter).refreshActionsWidget(actionCol52s);
}
use of org.drools.workbench.models.guided.dtable.shared.model.ActionCol52 in project drools-wb by kiegroup.
the class ColumnsPagePresenterTest method testRefreshActionsWidgetWhenActionColumnsIsEmpty.
@Test
public void testRefreshActionsWidgetWhenActionColumnsIsEmpty() {
final List<ActionCol52> actionColumns = new ArrayList<>();
final ColumnManagementView columnManagementView = mock(ColumnManagementView.class);
final GuidedDecisionTableAccordionItem item = mock(GuidedDecisionTableAccordionItem.class);
final Label blankSlate = mock(Label.class);
doReturn(verticalPanel).when(presenter).getActionsWidget();
doReturn(columnManagementView).when(presenter).getActionsPanel();
doReturn(blankSlate).when(presenter).blankSlate();
doReturn(item).when(accordion).getItem(ACTION);
presenter.refreshActionsWidget(actionColumns);
verify(item).setOpen(false);
verify(verticalPanel).add(blankSlate);
verify(verticalPanel, never()).add(columnManagementView);
verify(columnManagementView, never()).renderColumns(any());
}
use of org.drools.workbench.models.guided.dtable.shared.model.ActionCol52 in project drools-wb by kiegroup.
the class DecisionTableAnalyzerTest method testInsertActionColumn.
@Test
public void testInsertActionColumn() throws Exception {
ActionCol52 a = new ActionCol52();
ActionCol52 b = new ActionCol52();
actionColumns.add(a);
actionColumns.add(b);
model.setActionCols(actionColumns);
decisionTableAnalyzer.insertColumn(b);
verify(updateManager).newColumn(model, 3);
}
use of org.drools.workbench.models.guided.dtable.shared.model.ActionCol52 in project drools-wb by kiegroup.
the class GuidedDecisionTablePresenter_AuditLogTest method updateColumnAddsToLog.
@Test
public void updateColumnAddsToLog() throws VetoException {
dtPresenter.updateColumn(new ActionCol52(), new ActionCol52());
dtPresenter.updateColumn(new AttributeCol52(), new AttributeCol52());
dtPresenter.updateColumn(new ConditionCol52(), new ConditionCol52());
dtPresenter.updateColumn(new MetadataCol52(), new MetadataCol52());
dtPresenter.updateColumn(new Pattern52(), new ConditionCol52(), new Pattern52(), new ConditionCol52());
verify(synchronizer, times(4)).updateColumn(any(BaseColumn.class), any(BaseColumn.class));
verify(synchronizer).updateColumn(any(Pattern52.class), any(ConditionCol52.class), any(Pattern52.class), any(ConditionCol52.class));
verify(model, times(5)).getAuditLog();
assertEquals(5, model.getAuditLog().size());
for (UpdateColumnAuditLogEntry entry : model.getAuditLog().toArray(new UpdateColumnAuditLogEntry[0])) {
assertEquals(diffs, entry.getDiffs());
}
}
use of org.drools.workbench.models.guided.dtable.shared.model.ActionCol52 in project drools-wb by kiegroup.
the class BaseActionWorkItemConverterTest method checkConvertColumn.
@Test
public void checkConvertColumn() {
final BaseColumn column = getColumn();
final GridColumn<?> uiColumn = converter.convertColumn(column, access, gridWidget);
assertTrue(uiColumn.isResizable());
assertTrue(uiColumn.isVisible());
assertEquals(WIDTH, uiColumn.getWidth(), 0.0);
assertEquals(2, uiColumn.getHeaderMetaData().size());
final GridColumn.HeaderMetaData row0 = uiColumn.getHeaderMetaData().get(0);
assertEquals(WID_NAME, row0.getTitle());
assertEquals(ActionCol52.class.getName(), row0.getColumnGroup());
final GridColumn.HeaderMetaData row1 = uiColumn.getHeaderMetaData().get(1);
assertEquals(HEADER, row1.getTitle());
assertEquals(getExpectedColumnGroup(), row1.getColumnGroup());
}
Aggregations