use of org.kie.workbench.common.dmn.api.definition.model.InformationItem in project kie-wb-common by kiegroup.
the class RelationUIModelMapperTest method setup.
@Before
public void setup() {
this.uiModel = new BaseGridData();
this.uiModel.appendRow(new BaseGridRow());
this.uiModel.appendRow(new BaseGridRow());
this.uiModel.appendColumn(uiRowNumberColumn);
this.uiModel.appendColumn(uiRelationColumn1);
this.uiModel.appendColumn(uiRelationColumn2);
when(uiRowNumberColumn.getIndex()).thenReturn(0);
when(uiRelationColumn1.getIndex()).thenReturn(1);
when(uiRelationColumn2.getIndex()).thenReturn(2);
this.relation = new Relation();
this.relation.getColumn().add(new InformationItem());
this.relation.getColumn().add(new InformationItem());
final List rowList1 = new List();
rowList1.getExpression().add(HasExpression.wrap(rowList1, new LiteralExpression() {
{
getText().setValue("le(1,0)");
}
}));
rowList1.getExpression().add(HasExpression.wrap(rowList1, new LiteralExpression() {
{
getText().setValue("le(2,0)");
}
}));
final List rowList2 = new List();
rowList2.getExpression().add(HasExpression.wrap(rowList2, new LiteralExpression() {
{
getText().setValue("le(1,1)");
}
}));
rowList2.getExpression().add(HasExpression.wrap(rowList2, new LiteralExpression() {
{
getText().setValue("le(2,1)");
}
}));
this.relation.getRow().add(rowList1);
this.relation.getRow().add(rowList2);
this.mapper = new RelationUIModelMapper(() -> uiModel, () -> Optional.of(relation), listSelector, DEFAULT_HEIGHT);
this.cellValueSupplier = Optional::empty;
}
use of org.kie.workbench.common.dmn.api.definition.model.InformationItem 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.model.InformationItem 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.model.InformationItem in project kie-wb-common by kiegroup.
the class RelationUIModelMapperHelperTest method testGetSectionInformationItemColumnNegativeIndex.
@Test(expected = IllegalArgumentException.class)
public void testGetSectionInformationItemColumnNegativeIndex() {
relation.getColumn().add(new InformationItem());
assertEquals(RelationSection.INFORMATION_ITEM, getInformationItemIndex(relation, -1));
}
use of org.kie.workbench.common.dmn.api.definition.model.InformationItem 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));
}
Aggregations