use of org.drools.workbench.models.guided.dtable.shared.model.AttributeCol52 in project drools-wb by kiegroup.
the class GuidedDecisionTablePresenterTest method onDeleteSelectedCellsWithSelectionWithBooleanColumn.
@Test
public void onDeleteSelectedCellsWithSelectionWithBooleanColumn() {
final AttributeCol52 column = new AttributeCol52() {
{
setAttribute(RuleAttributeWidget.ENABLED_ATTR);
}
};
dtPresenter.appendColumn(column);
final GridData uiModel = dtPresenter.getUiModel();
uiModel.selectCell(0, 2);
dtPresenter.onDeleteSelectedCells();
verify(synchronizer, never()).deleteCell(any(GridData.Range.class), any(Integer.class));
checkDTSelectionsChangedEventFired(1);
}
use of org.drools.workbench.models.guided.dtable.shared.model.AttributeCol52 in project drools-wb by kiegroup.
the class GuidedDecisionTablePresenterTest method onDeleteSelectedColumnsWithSelections.
@Test
public void onDeleteSelectedColumnsWithSelections() throws VetoException {
final AttributeCol52 column = new AttributeCol52() {
{
setAttribute("attribute1");
}
};
dtPresenter.appendColumn(column);
final GridData uiModel = dtPresenter.getUiModel();
uiModel.selectCell(0, 2);
dtPresenter.onDeleteSelectedColumns();
verify(synchronizer, times(1)).deleteColumn(eq(column));
checkDTSelectionsChangedEventFired(2);
}
use of org.drools.workbench.models.guided.dtable.shared.model.AttributeCol52 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.AttributeCol52 in project drools-wb by kiegroup.
the class ModelSynchronizerTest method setupBooleanColumn.
private void setupBooleanColumn(final ParameterizedCommand<AttributeCol52> cmdInit) throws VetoException {
final AttributeCol52 booleanColumn = new AttributeCol52();
booleanColumn.setAttribute(GuidedDecisionTable52.ENABLED_ATTR);
cmdInit.execute(booleanColumn);
modelSynchronizer.appendColumn(booleanColumn);
}
use of org.drools.workbench.models.guided.dtable.shared.model.AttributeCol52 in project drools-wb by kiegroup.
the class RowSynchronizerTest method checkBooleanDefaultValueNotSet.
@Test
public void checkBooleanDefaultValueNotSet() throws VetoException {
final AttributeCol52 column = new AttributeCol52();
column.setAttribute(RuleAttributeWidget.ENABLED_ATTR);
modelSynchronizer.appendColumn(column);
modelSynchronizer.appendRow();
assertFalse((Boolean) uiModel.getRow(0).getCells().get(2).getValue().getValue());
assertFalse(model.getData().get(0).get(2).getBooleanValue());
}
Aggregations