use of org.kie.workbench.common.dmn.api.definition.model.InformationItem in project kie-wb-common by kiegroup.
the class InvocationDefaultValueUtilitiesTest method testGetNewParameterNameWithDeletion.
@Test
public void testGetNewParameterNameWithDeletion() {
final Binding binding1 = new Binding() {
{
setParameter(new InformationItem());
}
};
invocation.getBinding().add(binding1);
binding1.getParameter().getName().setValue(InvocationDefaultValueUtilities.getNewParameterName(invocation));
assertThat(binding1.getParameter().getName().getValue()).isEqualTo(InvocationDefaultValueUtilities.PREFIX + "1");
final Binding binding2 = new Binding() {
{
setParameter(new InformationItem());
}
};
invocation.getBinding().add(binding2);
binding2.getParameter().getName().setValue(InvocationDefaultValueUtilities.getNewParameterName(invocation));
assertThat(binding2.getParameter().getName().getValue()).isEqualTo(InvocationDefaultValueUtilities.PREFIX + "2");
invocation.getBinding().remove(binding1);
final Binding binding3 = new Binding() {
{
setParameter(new InformationItem());
}
};
invocation.getBinding().add(binding3);
binding3.getParameter().getName().setValue(InvocationDefaultValueUtilities.getNewParameterName(invocation));
assertThat(binding3.getParameter().getName().getValue()).isEqualTo(InvocationDefaultValueUtilities.PREFIX + "3");
}
use of org.kie.workbench.common.dmn.api.definition.model.InformationItem in project kie-wb-common by kiegroup.
the class PMMLIncludedModelHandlerTest method makeNestedPMMLFunctionDefinition.
private Context makeNestedPMMLFunctionDefinition(final String documentName, final String modelName) {
final Context context = new Context();
final ContextEntry contextEntry = new ContextEntry();
final InformationItem variable = new InformationItem();
variable.getName().setValue("variable");
contextEntry.setVariable(variable);
contextEntry.setExpression(makeTopLevelPMMLFunctionDefinition(documentName, modelName));
context.getContextEntry().add(contextEntry);
return context;
}
use of org.kie.workbench.common.dmn.api.definition.model.InformationItem in project kie-wb-common by kiegroup.
the class RelationGridTest method testOnItemSelectedDeleteColumn.
@Test
public void testOnItemSelectedDeleteColumn() {
relation.getColumn().add(new InformationItem());
setupGrid(0);
// Cannot delete column 0 since it is the RowNumber column. The first Relation column is 1.
final java.util.List<HasListSelectorControl.ListSelectorItem> items = grid.getItems(0, RelationUIModelMapperHelper.ROW_INDEX_COLUMN_COUNT);
final HasListSelectorControl.ListSelectorTextItem ti = (HasListSelectorControl.ListSelectorTextItem) items.get(DELETE_COLUMN);
grid.onItemSelected(ti);
verify(cellEditorControls).hide();
verify(grid).deleteColumn(eq(1));
}
use of org.kie.workbench.common.dmn.api.definition.model.InformationItem in project kie-wb-common by kiegroup.
the class RelationGridTest method testOnHeaderItemSelectedDeleteColumn.
@Test
public void testOnHeaderItemSelectedDeleteColumn() {
relation.getColumn().add(new InformationItem());
setupGrid(0);
// Cannot delete column 0 since it is the RowNumber column. The first Relation column is 1.
final java.util.List<HasListSelectorControl.ListSelectorItem> items = grid.getHeaderItems(0, RelationUIModelMapperHelper.ROW_INDEX_COLUMN_COUNT);
final HasListSelectorControl.ListSelectorTextItem ti = (HasListSelectorControl.ListSelectorTextItem) items.get(DELETE_COLUMN);
grid.onItemSelected(ti);
verify(cellEditorControls).hide();
verify(grid).deleteColumn(eq(1));
}
use of org.kie.workbench.common.dmn.api.definition.model.InformationItem in project kie-wb-common by kiegroup.
the class RelationGridTest method testDeleteColumn.
@Test
public void testDeleteColumn() {
relation.getColumn().add(new InformationItem());
setupGrid(0);
// Cannot delete column 0 since it is the RowNumber column. The first Relation column is 1.
grid.deleteColumn(RelationUIModelMapperHelper.ROW_INDEX_COLUMN_COUNT);
verify(sessionCommandManager).execute(eq(canvasHandler), deleteColumnCommand.capture());
deleteColumnCommand.getValue().execute(canvasHandler);
verifyCommandExecuteOperation(BaseExpressionGrid.RESIZE_EXISTING_MINIMUM);
// Check undo operation
reset(gridPanel, gridLayer, grid, parentGridColumn);
verify(sessionCommandManager).execute(eq(canvasHandler), deleteColumnCommand.capture());
deleteColumnCommand.getValue().undo(canvasHandler);
verifyCommandUndoOperation(BaseExpressionGrid.RESIZE_EXISTING);
}
Aggregations