use of org.drools.workbench.models.guided.dtable.shared.model.AttributeCol52 in project drools-wb by kiegroup.
the class AuditLogEntryCellHelperTest method getSafeHtml_Attribute.
@Test
public void getSafeHtml_Attribute() {
AttributeCol52 originalColumn = new AttributeCol52();
originalColumn.setReverseOrder(false);
originalColumn.setUseRowNumber(false);
originalColumn.setHideColumn(false);
originalColumn.setDefaultValue(new DTCellValue52("def1"));
// header & attribute name of an attribute column cannot be updated in the ui
originalColumn.setAttribute("attr");
originalColumn.setHeader("attr");
AttributeCol52 newColumn = new AttributeCol52();
newColumn.setReverseOrder(true);
newColumn.setUseRowNumber(true);
newColumn.setHideColumn(true);
newColumn.setDefaultValue(new DTCellValue52("def2"));
// header & attribute name of an attribute column cannot be updated in the ui
newColumn.setAttribute("attr");
newColumn.setHeader("attr");
List<BaseColumnFieldDiff> diffs = originalColumn.diff(newColumn);
SafeHtml result = helper.getSafeHtml(new UpdateColumnAuditLogEntry("mock user", originalColumn, newColumn, diffs));
assertEquals(getAttributeHeaderRepre(newColumn.getAttribute()) + getDiffRepre(diffs), result.asString());
}
use of org.drools.workbench.models.guided.dtable.shared.model.AttributeCol52 in project drools-wb by kiegroup.
the class GuidedDecisionTablePresenterAttributesAndMetadataTest method updateAttributeColumn.
@Test
public void updateAttributeColumn() throws VetoException {
final AttributeCol52 column = new AttributeCol52();
column.setAttribute(RuleAttributeWidget.AUTO_FOCUS_ATTR);
dtPresenter.appendColumn(column);
reset(modellerPresenter);
final AttributeCol52 update = new AttributeCol52();
update.setAttribute(RuleAttributeWidget.ENABLED_ATTR);
dtPresenter.updateColumn(column, update);
verify(synchronizer, times(1)).updateColumn(eq(column), eq(update));
verify(modellerPresenter, times(1)).updateLinks();
}
use of org.drools.workbench.models.guided.dtable.shared.model.AttributeCol52 in project drools-wb by kiegroup.
the class GuidedDecisionTablePresenterAttributesAndMetadataTest method deleteAttributeColumn.
@Test
public void deleteAttributeColumn() throws VetoException {
final AttributeCol52 column = new AttributeCol52();
column.setAttribute(RuleAttributeWidget.AUTO_FOCUS_ATTR);
dtPresenter.appendColumn(column);
reset(modellerPresenter);
dtPresenter.deleteColumn(column);
verify(synchronizer, times(1)).deleteColumn(eq(column));
verify(modellerPresenter, times(1)).updateLinks();
}
use of org.drools.workbench.models.guided.dtable.shared.model.AttributeCol52 in project drools-wb by kiegroup.
the class GuidedDecisionTablePresenterTest method deleteAttributeColumn.
@Test
public void deleteAttributeColumn() throws Exception {
final AttributeCol52 column = new AttributeCol52();
column.setAttribute("salience");
dtPresenter.appendColumn(column);
reset(modellerPresenter);
dtPresenter.deleteColumn(column);
verify(synchronizer, times(1)).deleteColumn(eq(column));
verify(modellerPresenter, times(1)).updateLinks();
verify(refreshAttributesPanelEvent, times(2)).fire(any(RefreshAttributesPanelEvent.class));
checkDTSelectionsChangedEventFired(1);
}
use of org.drools.workbench.models.guided.dtable.shared.model.AttributeCol52 in project drools-wb by kiegroup.
the class GuidedDecisionTablePresenterTest method getValueListLookups.
@Test
public void getValueListLookups() {
final AttributeCol52 attribute = new AttributeCol52();
attribute.setAttribute(RuleAttributeWidget.ENABLED_ATTR);
final Map<String, String> valueList = dtPresenter.getValueListLookups(attribute);
assertNotNull(valueList);
assertEquals(2, valueList.size());
assertTrue(valueList.containsKey("true"));
assertTrue(valueList.containsKey("false"));
}
Aggregations