use of org.kie.workbench.common.dmn.api.definition.v1_1.Context in project kie-wb-common by kiegroup.
the class JavaFunctionEditorDefinitionTest method testEditor.
@Test
public void testEditor() {
final Optional<Context> expression = definition.getModelClass();
final Optional<BaseExpressionGrid> oEditor = definition.getEditor(parent, Optional.empty(), hasExpression, expression, hasName, 0);
assertTrue(oEditor.isPresent());
final GridWidget editor = oEditor.get();
assertTrue(editor instanceof FunctionSupplementaryGrid);
}
use of org.kie.workbench.common.dmn.api.definition.v1_1.Context in project kie-wb-common by kiegroup.
the class PMMLFunctionEditorDefinitionTest method testModelDefinition.
@Test
public void testModelDefinition() {
final Optional<Context> oModel = definition.getModelClass();
assertTrue(oModel.isPresent());
final Context model = oModel.get();
assertEquals(2, model.getContextEntry().size());
assertEquals(PMMLFunctionEditorDefinition.VARIABLE_DOCUMENT, model.getContextEntry().get(0).getVariable().getName().getValue());
assertTrue(model.getContextEntry().get(0).getExpression() instanceof LiteralExpression);
assertEquals(PMMLFunctionEditorDefinition.VARIABLE_MODEL, model.getContextEntry().get(1).getVariable().getName().getValue());
assertTrue(model.getContextEntry().get(1).getExpression() instanceof LiteralExpression);
}
use of org.kie.workbench.common.dmn.api.definition.v1_1.Context in project kie-wb-common by kiegroup.
the class PMMLFunctionEditorDefinitionTest method testEditor.
@Test
public void testEditor() {
final Optional<Context> expression = definition.getModelClass();
final Optional<BaseExpressionGrid> oEditor = definition.getEditor(parent, Optional.empty(), hasExpression, expression, hasName, 0);
assertTrue(oEditor.isPresent());
final GridWidget editor = oEditor.get();
assertTrue(editor instanceof FunctionSupplementaryGrid);
}
use of org.kie.workbench.common.dmn.api.definition.v1_1.Context in project kie-wb-common by kiegroup.
the class JavaFunctionEditorDefinition method getModelClass.
@Override
public Optional<Context> getModelClass() {
final Context context = new Context();
final ContextEntry classEntry = new ContextEntry();
final InformationItem classEntryVariable = new InformationItem();
classEntryVariable.setName(new Name(VARIABLE_CLASS));
classEntry.setVariable(classEntryVariable);
classEntry.setExpression(new LiteralExpression());
context.getContextEntry().add(classEntry);
final ContextEntry methodSignatureEntry = new ContextEntry();
final InformationItem methodSignatureEntryVariable = new InformationItem();
methodSignatureEntryVariable.setName(new Name(VARIABLE_METHOD_SIGNATURE));
methodSignatureEntry.setVariable(methodSignatureEntryVariable);
methodSignatureEntry.setExpression(new LiteralExpression());
context.getContextEntry().add(methodSignatureEntry);
return Optional.of(context);
}
use of org.kie.workbench.common.dmn.api.definition.v1_1.Context in project kie-wb-common by kiegroup.
the class MoveRowsCommandTest method setup.
@Before
public void setup() {
this.context = new Context();
this.uiModel = new DMNGridData();
doReturn(ruleManager).when(handler).getRuleManager();
doReturn(0).when(uiRowNumberColumn).getIndex();
doReturn(1).when(uiNameColumn).getIndex();
doReturn(2).when(uiExpressionEditorColumn).getIndex();
addContextEntry(II1);
addContextEntry(II2);
addUiModelColumn(uiRowNumberColumn);
addUiModelColumn(uiNameColumn);
addUiModelColumn(uiExpressionEditorColumn);
addUiModelRow(0);
addUiModelRow(1);
}
Aggregations