Search in sources :

Example 11 with CategoryReport

use of pro.taskana.impl.report.impl.CategoryReport in project taskana by Taskana.

the class ProvideCategoryReportAccTest method testEachItemOfCategoryReport.

@Test
public void testEachItemOfCategoryReport() throws InvalidArgumentException {
    TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
    List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
    CategoryReport report = taskMonitorService.getCategoryReport(null, null, null, null, null, null, columnHeaders);
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug(reportToString(report, columnHeaders));
    }
    assertNotNull(report);
    assertEquals(3, report.rowSize());
    int[] row1 = report.getRow("EXTERN").getCells();
    assertArrayEquals(new int[] { 15, 8, 2, 6, 2 }, row1);
    int[] row2 = report.getRow("AUTOMATIC").getCells();
    assertArrayEquals(new int[] { 2, 1, 0, 1, 3 }, row2);
    int[] row3 = report.getRow("MANUAL").getCells();
    assertArrayEquals(new int[] { 2, 2, 2, 0, 4 }, row3);
}
Also used : TaskMonitorService(pro.taskana.TaskMonitorService) TimeIntervalColumnHeader(pro.taskana.impl.report.impl.TimeIntervalColumnHeader) CategoryReport(pro.taskana.impl.report.impl.CategoryReport) TaskanaEngineConfigurationTest(pro.taskana.impl.configuration.TaskanaEngineConfigurationTest) Test(org.junit.Test)

Example 12 with CategoryReport

use of pro.taskana.impl.report.impl.CategoryReport 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);
}
Also used : TaskMonitorService(pro.taskana.TaskMonitorService) CustomField(pro.taskana.CustomField) TimeIntervalColumnHeader(pro.taskana.impl.report.impl.TimeIntervalColumnHeader) CategoryReport(pro.taskana.impl.report.impl.CategoryReport) TaskanaEngineConfigurationTest(pro.taskana.impl.configuration.TaskanaEngineConfigurationTest) Test(org.junit.Test)

Aggregations

CategoryReport (pro.taskana.impl.report.impl.CategoryReport)12 Test (org.junit.Test)11 TaskMonitorService (pro.taskana.TaskMonitorService)9 TaskanaEngineConfigurationTest (pro.taskana.impl.configuration.TaskanaEngineConfigurationTest)9 TimeIntervalColumnHeader (pro.taskana.impl.report.impl.TimeIntervalColumnHeader)9 CustomField (pro.taskana.CustomField)3 TaskState (pro.taskana.TaskState)3 DetailedMonitorQueryItem (pro.taskana.impl.report.impl.DetailedMonitorQueryItem)3 MonitorQueryItem (pro.taskana.impl.report.impl.MonitorQueryItem)3 ArrayList (java.util.ArrayList)2