use of pro.taskana.impl.report.impl.TimeIntervalColumnHeader in project taskana by Taskana.
the class ProvideCategoryReportAccTest method testEachItemOfCategoryReportWithCustomFieldValueFilter.
@Test
public void testEachItemOfCategoryReportWithCustomFieldValueFilter() throws InvalidArgumentException {
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
CustomField customField = CustomField.CUSTOM_1;
List<String> customFieldValues = Collections.singletonList("Geschaeftsstelle A");
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
CategoryReport report = taskMonitorService.getCategoryReport(null, null, null, null, customField, customFieldValues, columnHeaders);
if (LOGGER.isDebugEnabled()) {
LOGGER.debug(reportToString(report, columnHeaders));
}
assertNotNull(report);
assertEquals(3, report.rowSize());
int[] row1 = report.getRow("EXTERN").getCells();
assertArrayEquals(new int[] { 9, 3, 1, 3, 0 }, row1);
int[] row2 = report.getRow("AUTOMATIC").getCells();
assertArrayEquals(new int[] { 1, 0, 0, 1, 1 }, row2);
int[] row3 = report.getRow("MANUAL").getCells();
assertArrayEquals(new int[] { 1, 1, 2, 0, 2 }, row3);
}
use of pro.taskana.impl.report.impl.TimeIntervalColumnHeader in project taskana by Taskana.
the class ProvideCustomFieldValueReportAccTest method testGetCustomFieldValueReportWithReportLineItemDefinitions.
@Test
public void testGetCustomFieldValueReportWithReportLineItemDefinitions() throws InvalidArgumentException {
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
CustomField customField = CustomField.CUSTOM_1;
List<TimeIntervalColumnHeader> columnHeaders = getListOfColumnHeaders();
CustomFieldValueReport report = taskMonitorService.getCustomFieldValueReport(null, null, null, null, customField, null, columnHeaders);
if (LOGGER.isDebugEnabled()) {
LOGGER.debug(reportToString(report, columnHeaders));
}
assertNotNull(report);
assertEquals(3, report.rowSize());
assertEquals(25, report.getRow("Geschaeftsstelle A").getTotalValue());
assertEquals(10, report.getRow("Geschaeftsstelle B").getTotalValue());
assertEquals(15, report.getRow("Geschaeftsstelle C").getTotalValue());
assertArrayEquals(new int[] { 10, 9, 11, 0, 4, 0, 7, 4, 5 }, report.getSumRow().getCells());
assertEquals(50, report.getSumRow().getTotalValue());
}
use of pro.taskana.impl.report.impl.TimeIntervalColumnHeader in project taskana by Taskana.
the class ProvideCustomFieldValueReportAccTest method testEachItemOfCustomFieldValueReportWithWorkbasketFilter.
@Test
public void testEachItemOfCustomFieldValueReportWithWorkbasketFilter() throws InvalidArgumentException {
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
List<String> workbasketIds = Collections.singletonList("WBI:000000000000000000000000000000000001");
CustomField customField = CustomField.CUSTOM_1;
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
CustomFieldValueReport report = taskMonitorService.getCustomFieldValueReport(workbasketIds, null, null, null, customField, null, columnHeaders);
if (LOGGER.isDebugEnabled()) {
LOGGER.debug(reportToString(report, columnHeaders));
}
assertNotNull(report);
assertEquals(3, report.rowSize());
int[] row1 = report.getRow("Geschaeftsstelle A").getCells();
assertArrayEquals(new int[] { 6, 1, 1, 1, 1 }, row1);
int[] row2 = report.getRow("Geschaeftsstelle B").getCells();
assertArrayEquals(new int[] { 4, 1, 0, 0, 0 }, row2);
int[] row3 = report.getRow("Geschaeftsstelle C").getCells();
assertArrayEquals(new int[] { 3, 1, 0, 0, 1 }, row3);
}
use of pro.taskana.impl.report.impl.TimeIntervalColumnHeader in project taskana by Taskana.
the class ProvideCustomFieldValueReportAccTest method testEachItemOfCustomFieldValueReportWithCategoryFilter.
@Test
public void testEachItemOfCustomFieldValueReportWithCategoryFilter() throws InvalidArgumentException {
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
List<String> categories = Arrays.asList("AUTOMATIC", "MANUAL");
CustomField customField = CustomField.CUSTOM_1;
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
CustomFieldValueReport report = taskMonitorService.getCustomFieldValueReport(null, null, categories, null, customField, null, columnHeaders);
if (LOGGER.isDebugEnabled()) {
LOGGER.debug(reportToString(report, columnHeaders));
}
assertNotNull(report);
assertEquals(3, report.rowSize());
int[] row1 = report.getRow("Geschaeftsstelle A").getCells();
assertArrayEquals(new int[] { 2, 1, 2, 1, 3 }, row1);
int[] row2 = report.getRow("Geschaeftsstelle B").getCells();
assertArrayEquals(new int[] { 2, 0, 0, 0, 0 }, row2);
int[] row3 = report.getRow("Geschaeftsstelle C").getCells();
assertArrayEquals(new int[] { 0, 2, 0, 0, 4 }, row3);
}
use of pro.taskana.impl.report.impl.TimeIntervalColumnHeader in project taskana by Taskana.
the class ProvideCustomFieldValueReportAccTest method testEachItemOfCustomFieldValueReportWithStateFilter.
@Test
public void testEachItemOfCustomFieldValueReportWithStateFilter() throws InvalidArgumentException {
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
List<TaskState> states = Collections.singletonList(TaskState.READY);
CustomField customField = CustomField.CUSTOM_1;
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
CustomFieldValueReport report = taskMonitorService.getCustomFieldValueReport(null, states, null, null, customField, null, columnHeaders);
if (LOGGER.isDebugEnabled()) {
LOGGER.debug(reportToString(report, columnHeaders));
}
assertNotNull(report);
assertEquals(3, report.rowSize());
int[] row1 = report.getRow("Geschaeftsstelle A").getCells();
assertArrayEquals(new int[] { 11, 4, 3, 4, 0 }, row1);
int[] row2 = report.getRow("Geschaeftsstelle B").getCells();
assertArrayEquals(new int[] { 5, 3, 0, 2, 0 }, row2);
int[] row3 = report.getRow("Geschaeftsstelle C").getCells();
assertArrayEquals(new int[] { 3, 4, 1, 1, 0 }, row3);
}
Aggregations