Search in sources :

Example 11 with InformationItem

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();
}
Also used : InformationItem(org.kie.workbench.common.dmn.api.definition.model.InformationItem) Test(org.junit.Test)

Example 12 with InformationItem

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());
}
Also used : InformationItem(org.kie.workbench.common.dmn.api.definition.model.InformationItem) Test(org.junit.Test)

Example 13 with InformationItem

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);
}
Also used : InformationItem(org.kie.workbench.common.dmn.api.definition.model.InformationItem) Test(org.junit.Test)

Example 14 with InformationItem

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");
}
Also used : InformationItem(org.kie.workbench.common.dmn.api.definition.model.InformationItem) Test(org.junit.Test)

Example 15 with InformationItem

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");
}
Also used : InformationItem(org.kie.workbench.common.dmn.api.definition.model.InformationItem) Test(org.junit.Test)

Aggregations

InformationItem (org.kie.workbench.common.dmn.api.definition.model.InformationItem)110 Test (org.junit.Test)61 LiteralExpression (org.kie.workbench.common.dmn.api.definition.model.LiteralExpression)24 ContextEntry (org.kie.workbench.common.dmn.api.definition.model.ContextEntry)22 GraphCommandExecutionContext (org.kie.workbench.common.stunner.core.graph.command.GraphCommandExecutionContext)22 RuleViolation (org.kie.workbench.common.stunner.core.rule.RuleViolation)20 Name (org.kie.workbench.common.dmn.api.property.dmn.Name)19 Binding (org.kie.workbench.common.dmn.api.definition.model.Binding)13 Context (org.kie.workbench.common.dmn.api.definition.model.Context)11 Expression (org.kie.workbench.common.dmn.api.definition.model.Expression)11 Before (org.junit.Before)10 List (org.kie.workbench.common.dmn.api.definition.model.List)10 QName (org.kie.workbench.common.dmn.api.property.dmn.QName)10 BaseGridRow (org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridRow)10 Description (org.kie.workbench.common.dmn.api.property.dmn.Description)9 Id (org.kie.workbench.common.dmn.api.property.dmn.Id)9 CanvasViolation (org.kie.workbench.common.stunner.core.client.command.CanvasViolation)9 HasName (org.kie.workbench.common.dmn.api.definition.HasName)7 Relation (org.kie.workbench.common.dmn.api.definition.model.Relation)7 JSITInformationItem (org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITInformationItem)7