use of org.kie.workbench.common.dmn.api.definition.v1_1.DecisionTable in project kie-wb-common by kiegroup.
the class DeleteOutputClauseCommandTest method setup.
@Before
public void setup() {
this.dtable = new DecisionTable();
this.outputClause = new OutputClause();
this.dtable.getOutput().add(outputClause);
this.uiModel = new DMNGridData();
this.uiModel.appendColumn(uiRowNumberColumn);
this.uiModel.appendColumn(uiOutputClauseColumn);
this.uiModel.appendColumn(uiDescriptionColumn);
this.uiModelMapper = new DecisionTableUIModelMapper(() -> uiModel, () -> Optional.of(dtable), listSelector);
this.command = spy(new DeleteOutputClauseCommand(dtable, uiModel, DecisionTableUIModelMapperHelper.ROW_INDEX_COLUMN_COUNT + dtable.getInput().size(), uiModelMapper, canvasOperation));
doReturn(0).when(uiRowNumberColumn).getIndex();
doReturn(1).when(uiOutputClauseColumn).getIndex();
doReturn(2).when(uiDescriptionColumn).getIndex();
}
use of org.kie.workbench.common.dmn.api.definition.v1_1.DecisionTable in project kie-wb-common by kiegroup.
the class MoveColumnsCommandTest method setUp.
@Before
public void setUp() throws Exception {
this.dtable = new DecisionTable();
this.uiModel = new DMNGridData();
dtable.getInput().add(inputClauseOne);
dtable.getInput().add(inputClauseTwo);
dtable.getInput().add(inputClauseThree);
dtable.getOutput().add(outputClauseOne);
dtable.getOutput().add(outputClauseTwo);
dtable.getOutput().add(outputClauseThree);
dtable.getRule().add(new DecisionRule() {
{
getInputEntry().add(new UnaryTests());
getInputEntry().add(new UnaryTests());
getInputEntry().add(new UnaryTests());
getOutputEntry().add(new LiteralExpression());
getOutputEntry().add(new LiteralExpression());
getOutputEntry().add(new LiteralExpression());
}
});
uiModel.appendColumn(uiRowNumberColumn);
uiModel.appendColumn(uiInputClauseColumnOne);
uiModel.appendColumn(uiInputClauseColumnTwo);
uiModel.appendColumn(uiInputClauseColumnThree);
uiModel.appendColumn(uiOutputClauseColumnOne);
uiModel.appendColumn(uiOutputClauseColumnTwo);
uiModel.appendColumn(uiOutputClauseColumnThree);
doReturn(0).when(uiRowNumberColumn).getIndex();
doReturn(1).when(uiInputClauseColumnOne).getIndex();
doReturn(2).when(uiInputClauseColumnTwo).getIndex();
doReturn(3).when(uiInputClauseColumnThree).getIndex();
doReturn(4).when(uiOutputClauseColumnOne).getIndex();
doReturn(5).when(uiOutputClauseColumnTwo).getIndex();
doReturn(6).when(uiOutputClauseColumnThree).getIndex();
}
use of org.kie.workbench.common.dmn.api.definition.v1_1.DecisionTable in project kie-wb-common by kiegroup.
the class MoveRowsCommandTest method setUp.
@Before
public void setUp() throws Exception {
this.dtable = new DecisionTable();
this.uiModel = new DMNGridData();
dtable.getInput().add(inputClause);
dtable.getOutput().add(outputClause);
uiModel.appendColumn(uiRowNumberColumn);
uiModel.appendColumn(uiInputClauseColumn);
uiModel.appendColumn(uiOutputClauseColumn);
doReturn(0).when(uiRowNumberColumn).getIndex();
doReturn(1).when(uiInputClauseColumn).getIndex();
doReturn(2).when(uiOutputClauseColumn).getIndex();
rowsUnderTest.clear();
appendRow(0, "a");
appendRow(1, "b");
appendRow(2, "c");
}
use of org.kie.workbench.common.dmn.api.definition.v1_1.DecisionTable in project kie-wb-common by kiegroup.
the class SetHitPolicyCommandTest method makeCommand.
private void makeCommand(final HitPolicy hitPolicy) {
this.dtable = new DecisionTable();
this.dtable.setHitPolicy(hitPolicy);
this.command = new SetHitPolicyCommand(dtable, NEW_HIT_POLICY, canvasOperation);
}
use of org.kie.workbench.common.dmn.api.definition.v1_1.DecisionTable in project kie-wb-common by kiegroup.
the class SetOrientationCommandTest method makeCommand.
private void makeCommand(final DecisionTableOrientation orientation) {
this.dtable = new DecisionTable();
this.dtable.setPreferredOrientation(orientation);
this.command = new SetOrientationCommand(dtable, NEW_ORIENTATION, canvasOperation);
}
Aggregations