use of org.kie.workbench.common.dmn.api.definition.model.Expression in project kie-wb-common by kiegroup.
the class CommandUtilsTest method setUp.
@Before
public void setUp() {
decisionRuleOne = new DecisionRule();
decisionRuleTwo = new DecisionRule();
decisionRuleThree = new DecisionRule();
decisionRuleOne.setId(new Id("1"));
decisionRuleTwo.setId(new Id("2"));
decisionRuleThree.setId(new Id("3"));
allRows.clear();
allRows.add(decisionRuleOne);
allRows.add(decisionRuleTwo);
allRows.add(decisionRuleThree);
rowsToMove.clear();
gridData = new DMNGridData();
gridWidget = new BaseGrid<Expression>(gridLayer, gridData, renderer, sessionManager, sessionCommandManager, canvasCommandFactory, refreshFormPropertiesEvent, domainObjectSelectionEvent, cellEditorControls, translationService) {
};
}
use of org.kie.workbench.common.dmn.api.definition.model.Expression in project kie-wb-common by kiegroup.
the class RegisterNodeCommandTest method testExecuteWithBusinessKnowledgeModelNode.
@Test
public void testExecuteWithBusinessKnowledgeModelNode() {
when(candidateContent.getDefinition()).thenReturn(businessKnowledgeModel);
assertThat(command.execute(graphCommandExecutionContext).getType()).isEqualTo(CommandResult.Type.INFO);
final FunctionDefinition encapsulatedLogic = businessKnowledgeModel.getEncapsulatedLogic();
final Expression expression = encapsulatedLogic.getExpression();
assertThat(expression).isInstanceOf(LiteralExpression.class);
assertThat(expression.getParent()).isEqualTo(encapsulatedLogic);
assertThat(KindUtilities.getKind(encapsulatedLogic)).isEqualTo(FunctionDefinition.Kind.FEEL);
}
use of org.kie.workbench.common.dmn.api.definition.model.Expression in project kie-wb-common by kiegroup.
the class ListEditorDefinitionTest method testEditor.
@Test
public void testEditor() {
when(hasExpression.getExpression()).thenReturn(definition.getModelClass().get());
final Optional<BaseExpressionGrid<? extends Expression, ? extends GridData, ? extends BaseUIModelMapper>> oEditor = definition.getEditor(parent, Optional.empty(), hasExpression, hasName, false, 0);
assertThat(oEditor).isPresent();
final GridWidget editor = oEditor.get();
assertThat(editor).isInstanceOf(ListGrid.class);
}
use of org.kie.workbench.common.dmn.api.definition.model.Expression in project kie-wb-common by kiegroup.
the class JavaFunctionEditorDefinitionTest method testEditor.
@Test
public void testEditor() {
when(hasExpression.getExpression()).thenReturn(definition.getModelClass().get());
final Optional<BaseExpressionGrid<? extends Expression, ? extends GridData, ? extends BaseUIModelMapper>> oEditor = definition.getEditor(parent, Optional.empty(), hasExpression, hasName, false, 0);
assertTrue(oEditor.isPresent());
final GridWidget editor = oEditor.get();
assertTrue(editor instanceof FunctionSupplementaryGrid);
}
use of org.kie.workbench.common.dmn.api.definition.model.Expression in project kie-wb-common by kiegroup.
the class PMMLFunctionEditorDefinitionTest method testEditor.
@Test
public void testEditor() {
when(hasExpression.getExpression()).thenReturn(definition.getModelClass().get());
final Optional<BaseExpressionGrid<? extends Expression, ? extends GridData, ? extends BaseUIModelMapper>> oEditor = definition.getEditor(parent, Optional.empty(), hasExpression, hasName, false, 0);
assertTrue(oEditor.isPresent());
final GridWidget editor = oEditor.get();
assertTrue(editor instanceof FunctionSupplementaryGrid);
}
Aggregations