use of org.drools.workbench.models.guided.dtable.shared.model.RowNumberCol52 in project drools-wb by kiegroup.
the class ConditionColumnSynchronizerTest method checkConditionCannotBeDeletedWithSingleChildColumnWithAction.
@Test
public void checkConditionCannotBeDeletedWithSingleChildColumnWithAction() throws VetoException {
final Pattern52 pattern = boundApplicantPattern("$a");
final ConditionCol52 condition = ageEqualsCondition();
final ActionCol52 action = actionUpdatePattern("$a");
modelSynchronizer.appendColumn(pattern, condition);
modelSynchronizer.appendColumn(action);
try {
modelSynchronizer.deleteColumn(condition);
fail("Deletion of the column should have been vetoed.");
} catch (VetoDeletePatternInUseException veto) {
// This is expected
} catch (VetoException veto) {
fail("VetoDeletePatternInUseException was expected.");
}
assertEquals(4, model.getExpandedColumns().size());
assertTrue(model.getExpandedColumns().get(0) instanceof RowNumberCol52);
assertTrue(model.getExpandedColumns().get(1) instanceof DescriptionCol52);
assertEquals(condition, model.getExpandedColumns().get(2));
assertEquals(action, model.getExpandedColumns().get(3));
}
use of org.drools.workbench.models.guided.dtable.shared.model.RowNumberCol52 in project drools-wb by kiegroup.
the class ConditionColumnSynchronizerTest method checkConditionCanBeDeletedWithSingleChildColumnWithNoAction.
@Test
public void checkConditionCanBeDeletedWithSingleChildColumnWithNoAction() throws VetoException {
final Pattern52 pattern = boundApplicantPattern("$a");
final ConditionCol52 condition = ageEqualsCondition();
modelSynchronizer.appendColumn(pattern, condition);
try {
modelSynchronizer.deleteColumn(condition);
} catch (VetoException veto) {
fail("Deletion should have been permitted.");
}
assertEquals(2, model.getExpandedColumns().size());
assertTrue(model.getExpandedColumns().get(0) instanceof RowNumberCol52);
assertTrue(model.getExpandedColumns().get(1) instanceof DescriptionCol52);
}
use of org.drools.workbench.models.guided.dtable.shared.model.RowNumberCol52 in project drools-wb by kiegroup.
the class BRLConditionColumnDefinitionBuilderTest method unknownColumnTypeDoesNotTriggerBuilder.
@Test
public void unknownColumnTypeDoesNotTriggerBuilder() {
final BaseColumn column = new RowNumberCol52();
builder.generateDefinition(dtPresenter, column, (String definition) -> {
fail("RowNumberCol52 should not be handled by ConditionCol52DefinitionBuilder");
});
}
use of org.drools.workbench.models.guided.dtable.shared.model.RowNumberCol52 in project drools-wb by kiegroup.
the class BRLActionColumnDefinitionBuilderTest method unknownColumnTypeDoesNotTriggerBuilder.
@Test
public void unknownColumnTypeDoesNotTriggerBuilder() {
final BaseColumn column = new RowNumberCol52();
builder.generateDefinition(dtPresenter, column, (String definition) -> {
fail("RowNumberCol52 should not be handled by ConditionCol52DefinitionBuilder");
});
}
use of org.drools.workbench.models.guided.dtable.shared.model.RowNumberCol52 in project drools-wb by kiegroup.
the class ColumnDefinitionFactoryTest method unknownColumnTypeDoesNotTriggerBuilder.
@Test
@SuppressWarnings("unchecked")
public void unknownColumnTypeDoesNotTriggerBuilder() {
final Callback<String> callback = mock(Callback.class);
columnDefinitionFactory.generateColumnDefinition(dtPresenter, new RowNumberCol52(), callback);
verify(callback, never()).callback(any(String.class));
}
Aggregations