use of org.kie.workbench.common.widgets.decoratedgrid.client.widget.CellValue.GroupedCellValue in project kie-wb-common by kiegroup.
the class DynamicDataWithGroupingTest method testDataGrouping.
@Test
@SuppressWarnings("rawtypes")
public void testDataGrouping() {
// [1][-][3] --> [1][x][3]
// [1][2][3] --> [-][2][3]
// [-][2][3] -->
CellValue.GroupedCellValue gcv;
CellValue<? extends Comparable<?>> cv = data.get(0).get(0);
data.setMerged(true);
data.applyModelGrouping(cv);
assertEquals(data.size(), 2);
cv = data.get(0).get(0);
assertTrue(cv instanceof GroupedCellValue);
gcv = (GroupedCellValue) cv;
assertFalse(gcv.hasMultipleValues());
assertEquals(cv.getValue(), "1");
cv = data.get(0).get(1);
assertTrue(cv instanceof GroupedCellValue);
gcv = (GroupedCellValue) cv;
assertTrue(gcv.hasMultipleValues());
cv = data.get(0).get(2);
assertTrue(cv instanceof GroupedCellValue);
gcv = (GroupedCellValue) cv;
assertFalse(gcv.hasMultipleValues());
assertEquals(cv.getValue(), "3");
cv = data.get(1).get(0);
assertFalse(cv instanceof GroupedCellValue);
assertEquals(cv.getValue(), "-");
cv = data.get(1).get(1);
assertFalse(cv instanceof GroupedCellValue);
assertEquals(cv.getValue(), "2");
cv = data.get(1).get(2);
assertFalse(cv instanceof GroupedCellValue);
assertEquals(cv.getValue(), "3");
}
use of org.kie.workbench.common.widgets.decoratedgrid.client.widget.CellValue.GroupedCellValue in project kie-wb-common by kiegroup.
the class DynamicDataWithGroupingWithOtherwiseTest method testDataGrouping.
@Test
@SuppressWarnings("rawtypes")
public void testDataGrouping() {
// [1][-][3] --> [1][x][x]
// [1][2][*] --> [-][2][3]
// [-][2][3] -->
GroupedCellValue gcv;
CellValue<? extends Comparable<?>> cv = data.get(0).get(0);
data.setMerged(true);
data.applyModelGrouping(cv);
assertEquals(data.size(), 2);
cv = data.get(0).get(0);
assertTrue(cv instanceof GroupedCellValue);
gcv = (GroupedCellValue) cv;
assertFalse(gcv.hasMultipleValues());
assertEquals(cv.getValue(), "1");
cv = data.get(0).get(1);
assertTrue(cv instanceof GroupedCellValue);
gcv = (GroupedCellValue) cv;
assertTrue(gcv.hasMultipleValues());
cv = data.get(0).get(2);
assertTrue(cv instanceof GroupedCellValue);
gcv = (GroupedCellValue) cv;
assertTrue(gcv.hasMultipleValues());
assertEquals(cv.getValue(), "3");
cv = data.get(1).get(0);
assertFalse(cv instanceof GroupedCellValue);
assertEquals(cv.getValue(), "-");
cv = data.get(1).get(1);
assertFalse(cv instanceof GroupedCellValue);
assertEquals(cv.getValue(), "2");
cv = data.get(1).get(2);
assertFalse(cv instanceof GroupedCellValue);
assertEquals(cv.getValue(), "3");
}
use of org.kie.workbench.common.widgets.decoratedgrid.client.widget.CellValue.GroupedCellValue in project kie-wb-common by kiegroup.
the class DynamicDataTestsWithGrouping method testDataGrouping.
@Test
@SuppressWarnings("rawtypes")
public void testDataGrouping() {
// [1][-][3] --> [1][x][3]
// [1][2][3] --> [-][2][3]
// [-][2][3] -->
CellValue.GroupedCellValue gcv;
CellValue<? extends Comparable<?>> cv = data.get(0).get(0);
data.setMerged(true);
data.applyModelGrouping(cv);
assertEquals(data.size(), 2);
cv = data.get(0).get(0);
assertTrue(cv instanceof GroupedCellValue);
gcv = (GroupedCellValue) cv;
assertFalse(gcv.hasMultipleValues());
assertEquals(cv.getValue(), "1");
cv = data.get(0).get(1);
assertTrue(cv instanceof GroupedCellValue);
gcv = (GroupedCellValue) cv;
assertTrue(gcv.hasMultipleValues());
cv = data.get(0).get(2);
assertTrue(cv instanceof GroupedCellValue);
gcv = (GroupedCellValue) cv;
assertFalse(gcv.hasMultipleValues());
assertEquals(cv.getValue(), "3");
cv = data.get(1).get(0);
assertFalse(cv instanceof GroupedCellValue);
assertEquals(cv.getValue(), "-");
cv = data.get(1).get(1);
assertFalse(cv instanceof GroupedCellValue);
assertEquals(cv.getValue(), "2");
cv = data.get(1).get(2);
assertFalse(cv instanceof GroupedCellValue);
assertEquals(cv.getValue(), "3");
}
use of org.kie.workbench.common.widgets.decoratedgrid.client.widget.CellValue.GroupedCellValue in project kie-wb-common by kiegroup.
the class DynamicDataTestsWithGroupingWithOtherwise method testDataGrouping.
@Test
@SuppressWarnings("rawtypes")
public void testDataGrouping() {
// [1][-][3] --> [1][x][x]
// [1][2][*] --> [-][2][3]
// [-][2][3] -->
GroupedCellValue gcv;
CellValue<? extends Comparable<?>> cv = data.get(0).get(0);
data.setMerged(true);
data.applyModelGrouping(cv);
assertEquals(data.size(), 2);
cv = data.get(0).get(0);
assertTrue(cv instanceof GroupedCellValue);
gcv = (GroupedCellValue) cv;
assertFalse(gcv.hasMultipleValues());
assertEquals(cv.getValue(), "1");
cv = data.get(0).get(1);
assertTrue(cv instanceof GroupedCellValue);
gcv = (GroupedCellValue) cv;
assertTrue(gcv.hasMultipleValues());
cv = data.get(0).get(2);
assertTrue(cv instanceof GroupedCellValue);
gcv = (GroupedCellValue) cv;
assertTrue(gcv.hasMultipleValues());
assertEquals(cv.getValue(), "3");
cv = data.get(1).get(0);
assertFalse(cv instanceof GroupedCellValue);
assertEquals(cv.getValue(), "-");
cv = data.get(1).get(1);
assertFalse(cv instanceof GroupedCellValue);
assertEquals(cv.getValue(), "2");
cv = data.get(1).get(2);
assertFalse(cv instanceof GroupedCellValue);
assertEquals(cv.getValue(), "3");
}
Aggregations