use of pro.taskana.TaskMonitorService in project taskana by Taskana.
the class ProvideCustomFieldValueReportAccTest method testGetTotalNumbersOfTasksOfCustomFieldValueReportForCustom2.
@Test
public void testGetTotalNumbersOfTasksOfCustomFieldValueReportForCustom2() throws InvalidArgumentException {
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
CustomField customField = CustomField.CUSTOM_2;
CustomFieldValueReport report = taskMonitorService.getCustomFieldValueReport(null, null, null, null, customField, null);
if (LOGGER.isDebugEnabled()) {
LOGGER.debug(reportToString(report));
}
assertNotNull(report);
assertEquals(2, report.rowSize());
assertEquals(21, report.getRow("Vollkasko").getTotalValue());
assertEquals(29, report.getRow("Teilkasko").getTotalValue());
assertEquals(0, report.getRow("Vollkasko").getCells().length);
assertEquals(0, report.getRow("Teilkasko").getCells().length);
assertEquals(50, report.getSumRow().getTotalValue());
}
use of pro.taskana.TaskMonitorService in project taskana by Taskana.
the class ProvideCustomFieldValueReportAccTest method testEachItemOfCustomFieldValueReportWithCustomFieldValueFilter.
@Test
public void testEachItemOfCustomFieldValueReportWithCustomFieldValueFilter() throws InvalidArgumentException {
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
CustomField customField = CustomField.CUSTOM_1;
List<String> customFieldValues = Collections.singletonList("Geschaeftsstelle A");
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
CustomFieldValueReport report = taskMonitorService.getCustomFieldValueReport(null, null, null, null, customField, customFieldValues, columnHeaders);
if (LOGGER.isDebugEnabled()) {
LOGGER.debug(reportToString(report, columnHeaders));
}
assertNotNull(report);
assertEquals(1, report.rowSize());
int[] row1 = report.getRow("Geschaeftsstelle A").getCells();
assertArrayEquals(new int[] { 11, 4, 3, 4, 3 }, row1);
}
use of pro.taskana.TaskMonitorService in project taskana by Taskana.
the class ProvideCustomFieldValueReportAccTest method testGetTotalNumbersOfTasksOfCustomFieldValueReportForCustom1.
@Test
public void testGetTotalNumbersOfTasksOfCustomFieldValueReportForCustom1() throws InvalidArgumentException {
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
CustomField customField = CustomField.CUSTOM_1;
CustomFieldValueReport report = taskMonitorService.getCustomFieldValueReport(null, null, null, null, customField, null);
if (LOGGER.isDebugEnabled()) {
LOGGER.debug(reportToString(report));
}
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());
assertEquals(0, report.getRow("Geschaeftsstelle A").getCells().length);
assertEquals(0, report.getRow("Geschaeftsstelle B").getCells().length);
assertEquals(0, report.getRow("Geschaeftsstelle C").getCells().length);
assertEquals(50, report.getSumRow().getTotalValue());
}
use of pro.taskana.TaskMonitorService in project taskana by Taskana.
the class ProvideCustomFieldValueReportAccTest method testEachItemOfCustomFieldValueReportWithDomainFilter.
@Test
public void testEachItemOfCustomFieldValueReportWithDomainFilter() throws InvalidArgumentException {
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
List<String> domains = Collections.singletonList("DOMAIN_A");
CustomField customField = CustomField.CUSTOM_1;
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
CustomFieldValueReport report = taskMonitorService.getCustomFieldValueReport(null, null, null, domains, 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[] { 8, 1, 1, 4, 1 }, row1);
int[] row2 = report.getRow("Geschaeftsstelle B").getCells();
assertArrayEquals(new int[] { 2, 2, 0, 1, 0 }, row2);
int[] row3 = report.getRow("Geschaeftsstelle C").getCells();
assertArrayEquals(new int[] { 1, 1, 1, 0, 3 }, row3);
}
use of pro.taskana.TaskMonitorService in project taskana by Taskana.
the class ProvideTaskStatusReportAccTest method testCompleteTaskStatusReportWithStateFilter.
@Test
public void testCompleteTaskStatusReportWithStateFilter() {
// given
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
// when
TaskStatusReport report = taskMonitorService.getTaskStatusReport(null, Collections.singletonList(TaskState.READY));
// then
if (LOGGER.isDebugEnabled()) {
LOGGER.debug(reportToString(report));
}
assertNotNull(report);
assertEquals(3, report.rowSize());
ReportRow<TaskQueryItem> row1 = report.getRow("DOMAIN_A");
assertArrayEquals(new int[] { 22 }, row1.getCells());
assertEquals(22, row1.getTotalValue());
ReportRow<TaskQueryItem> row2 = report.getRow("DOMAIN_B");
assertArrayEquals(new int[] { 9 }, row2.getCells());
assertEquals(9, row2.getTotalValue());
ReportRow<TaskQueryItem> row3 = report.getRow("DOMAIN_C");
assertArrayEquals(new int[] { 10 }, row3.getCells());
assertEquals(10, row3.getTotalValue());
ReportRow<TaskQueryItem> sumRow = report.getSumRow();
assertArrayEquals(new int[] { 41 }, sumRow.getCells());
assertEquals(41, sumRow.getTotalValue());
}
Aggregations