use of org.kie.workbench.common.dmn.api.definition.v1_1.Relation in project kie-wb-common by kiegroup.
the class RelationUIModelMapperHelperTest method testGetSectionNonExistingIndexEqualToColumnCount.
@Test
public void testGetSectionNonExistingIndexEqualToColumnCount() {
relation.getColumn().add(new InformationItem());
assertEquals(RelationSection.NONE, getSection(relation, relation.getColumn().size() + 1));
}
use of org.kie.workbench.common.dmn.api.definition.v1_1.Relation in project kie-wb-common by kiegroup.
the class RelationUIModelMapperHelperTest method testGetSectionInformationItemColumn.
@Test
public void testGetSectionInformationItemColumn() {
relation.getColumn().add(new InformationItem());
assertEquals(RelationSection.INFORMATION_ITEM, getSection(relation, 1));
}
use of org.kie.workbench.common.dmn.api.definition.v1_1.Relation in project kie-wb-common by kiegroup.
the class RelationUIModelMapperHelperTest method testGetSectionNonExistingNegativeIndex.
@Test
public void testGetSectionNonExistingNegativeIndex() {
relation.getColumn().add(new InformationItem());
assertEquals(RelationSection.NONE, getSection(relation, -1));
}
use of org.kie.workbench.common.dmn.api.definition.v1_1.Relation in project kie-wb-common by kiegroup.
the class RelationUIModelMapperTest method setup.
@Before
public void setup() {
this.uiModel = new BaseGridData();
this.uiModel.appendRow(new DMNGridRow());
this.uiModel.appendRow(new DMNGridRow());
this.uiModel.appendColumn(uiRowNumberColumn);
this.uiModel.appendColumn(uiRelationColumn1);
this.uiModel.appendColumn(uiRelationColumn2);
doReturn(0).when(uiRowNumberColumn).getIndex();
doReturn(1).when(uiRelationColumn1).getIndex();
doReturn(2).when(uiRelationColumn2).getIndex();
this.relation = new Relation();
this.relation.getColumn().add(new InformationItem());
this.relation.getColumn().add(new InformationItem());
this.relation.getRow().add(new List() {
{
getExpression().add(new LiteralExpression() {
{
setText("le(1,0)");
}
});
getExpression().add(new LiteralExpression() {
{
setText("le(2,0)");
}
});
}
});
this.relation.getRow().add(new List() {
{
getExpression().add(new LiteralExpression() {
{
setText("le(1,1)");
}
});
getExpression().add(new LiteralExpression() {
{
setText("le(2,1)");
}
});
}
});
this.mapper = new RelationUIModelMapper(() -> uiModel, () -> Optional.of(relation), listSelector);
this.cellValueSupplier = Optional::empty;
}
use of org.kie.workbench.common.dmn.api.definition.v1_1.Relation in project kie-wb-common by kiegroup.
the class AddRelationColumnCommandTest method setup.
@Before
public void setup() {
this.relation = new Relation();
this.informationItem = new InformationItem();
this.uiModel = new BaseGridData();
this.uiModel.appendColumn(uiRowNumberColumn);
this.uiModelMapper = new RelationUIModelMapper(() -> uiModel, () -> Optional.of(relation), listSelector);
makeCommand(1);
doReturn(ruleManager).when(handler).getRuleManager();
doReturn(0).when(uiRowNumberColumn).getIndex();
doReturn(1).when(uiModelColumn).getIndex();
}
Aggregations