use of org.drools.workbench.models.guided.dtable.shared.model.ActionInsertFactCol52 in project drools-wb by kiegroup.
the class GuidedDecisionTablePresenterTest method addActionInsertFactToModel.
private void addActionInsertFactToModel(final GuidedDecisionTable52 model, final String factType, final String fieldName) {
final ActionInsertFactCol52 aif = new ActionInsertFactCol52();
aif.setFactType(factType);
aif.setFactField(fieldName);
model.getActionCols().add(aif);
}
use of org.drools.workbench.models.guided.dtable.shared.model.ActionInsertFactCol52 in project drools-wb by kiegroup.
the class GuidedDecisionTablePresenterTest method hasColumnDefinitionsWithActionColumn.
@Test
public void hasColumnDefinitionsWithActionColumn() {
final ActionInsertFactCol52 action = new ActionInsertFactCol52();
action.setFactType("FactType");
action.setFactField("field");
dtPresenter.getModel().getActionCols().add(action);
assertTrue(dtPresenter.hasColumnDefinitions());
}
use of org.drools.workbench.models.guided.dtable.shared.model.ActionInsertFactCol52 in project drools-wb by kiegroup.
the class GuidedDecisionTablePresenterTest method appendActionColumn.
@Test
public void appendActionColumn() throws VetoException {
reset(modellerPresenter);
final ActionInsertFactCol52 action = new ActionInsertFactCol52();
action.setFactType("FactType");
action.setFactField("field");
action.setHeader("header");
when(oracle.getFieldType(eq("FactType"), eq("field"))).thenReturn(DataType.TYPE_STRING);
dtPresenter.appendColumn(action);
verify(synchronizer, times(1)).appendColumn(eq(action));
verify(refreshActionsPanelEvent, times(1)).fire(any(RefreshActionsPanelEvent.class));
verify(modellerPresenter, times(1)).updateLinks();
}
use of org.drools.workbench.models.guided.dtable.shared.model.ActionInsertFactCol52 in project drools-wb by kiegroup.
the class AuditLogEntryCellHelperTest method getSafeHtml_ActionInsert.
@Test
public void getSafeHtml_ActionInsert() {
// hide, insert, value list, default value, field, header
ActionInsertFactCol52 originalColumn = new ActionInsertFactCol52();
originalColumn.setFactField("field1");
originalColumn.setInsertLogical(false);
originalColumn.setValueList("q,w,e");
originalColumn.setHeader("action1");
originalColumn.setHideColumn(false);
originalColumn.setDefaultValue(new DTCellValue52("def1"));
ActionInsertFactCol52 newColumn = new ActionInsertFactCol52();
newColumn.setFactField("field2");
newColumn.setInsertLogical(true);
newColumn.setValueList("a,s,d");
newColumn.setHeader("action2");
newColumn.setHideColumn(true);
newColumn.setDefaultValue(new DTCellValue52("def2"));
List<BaseColumnFieldDiff> diffs = originalColumn.diff(newColumn);
SafeHtml result = helper.getSafeHtml(new UpdateColumnAuditLogEntry("mock user", originalColumn, newColumn, diffs));
assertEquals(getActionHeaderRepre(newColumn.getHeader()) + getDiffRepre(diffs), result.asString());
}
use of org.drools.workbench.models.guided.dtable.shared.model.ActionInsertFactCol52 in project drools-wb by kiegroup.
the class GuidedDecisionTablePresenterTest method deleteActionColumn.
@Test
public void deleteActionColumn() throws VetoException {
final ActionInsertFactCol52 column = new ActionInsertFactCol52();
column.setFactType("FactType");
column.setFactField("field");
column.setHeader("header");
when(oracle.getFieldType(eq("FactType"), eq("field"))).thenReturn(DataType.TYPE_STRING);
dtPresenter.appendColumn(column);
reset(modellerPresenter);
dtPresenter.deleteColumn(column);
verify(synchronizer, times(1)).deleteColumn(eq(column));
verify(modellerPresenter, times(1)).updateLinks();
checkDTSelectionsChangedEventFired(1);
}
Aggregations