use of org.kie.workbench.common.dmn.api.definition.model.InformationItem in project kie-wb-common by kiegroup.
the class ParametersPopoverViewImplTest method testFocusParameter.
@Test
public void testFocusParameter() {
final InformationItem parameter1 = new InformationItem();
final InformationItem parameter2 = new InformationItem();
view.setParameters(Arrays.asList(parameter1, parameter2));
view.focusParameter(0);
verify(parameterView1).focus();
view.focusParameter(1);
verify(parameterView2).focus();
reset(parameterView1, parameterView2);
view.focusParameter(-1);
verify(parameterView1, never()).focus();
verify(parameterView2, never()).focus();
reset(parameterView1, parameterView2);
view.focusParameter(2);
verify(parameterView1, never()).focus();
verify(parameterView2, never()).focus();
}
use of org.kie.workbench.common.dmn.api.definition.model.InformationItem in project kie-wb-common by kiegroup.
the class BaseSupplementaryFunctionEditorDefinitionTest method testDefaultVariableType.
@Test
public void testDefaultVariableType() {
final InformationItem variable = baseSupplementaryFunctionEditorDefinition.createVariable("variable");
assertEquals(variable.getTypeRef().getLocalPart(), BuiltInType.STRING.getName());
}
use of org.kie.workbench.common.dmn.api.definition.model.InformationItem in project kie-wb-common by kiegroup.
the class ParametersPopoverImplTest method testRemoveParameterNonNullControl.
@Test
public void testRemoveParameterNonNullControl() {
parameters.add(new InformationItem());
parameters.add(parameter);
presenter.bind(control, ROW_INDEX, COLUMN_INDEX);
// Binding sets the parameters, so reset
reset(view);
presenter.removeParameter(parameter);
verify(control).removeParameter(eq(parameter), commandCaptor.capture());
commandCaptor.getValue().execute();
verify(view).setParameters(eq(parameters));
verify(view).focusParameter(0);
}
use of org.kie.workbench.common.dmn.api.definition.model.InformationItem in project kie-wb-common by kiegroup.
the class RelationDefaultValueUtilitiesTest method testGetNewColumnNameWithExistingColumns.
@Test
public void testGetNewColumnNameWithExistingColumns() {
final InformationItem informationItem1 = new InformationItem();
relation.getColumn().add(informationItem1);
informationItem1.getName().setValue("column");
final InformationItem informationItem2 = new InformationItem();
relation.getColumn().add(informationItem2);
informationItem2.getName().setValue(RelationDefaultValueUtilities.getNewColumnName(relation));
assertThat(informationItem2.getName().getValue()).isEqualTo(RelationDefaultValueUtilities.PREFIX + "1");
}
use of org.kie.workbench.common.dmn.api.definition.model.InformationItem in project kie-wb-common by kiegroup.
the class RelationDefaultValueUtilitiesTest method testGetNewColumnName.
@Test
public void testGetNewColumnName() {
final InformationItem informationItem1 = new InformationItem();
relation.getColumn().add(informationItem1);
informationItem1.getName().setValue(RelationDefaultValueUtilities.getNewColumnName(relation));
assertThat(informationItem1.getName().getValue()).isEqualTo(RelationDefaultValueUtilities.PREFIX + "1");
final InformationItem informationItem2 = new InformationItem();
relation.getColumn().add(informationItem2);
informationItem2.getName().setValue(RelationDefaultValueUtilities.getNewColumnName(relation));
assertThat(informationItem2.getName().getValue()).isEqualTo(RelationDefaultValueUtilities.PREFIX + "2");
}
Aggregations