Search in sources :

Example 31 with TaskMonitorService

use of pro.taskana.TaskMonitorService in project taskana by Taskana.

the class ProvideCategoryReportAccTest method testEachItemOfCategoryReportNotInWorkingDays.

@Test
public void testEachItemOfCategoryReportNotInWorkingDays() throws InvalidArgumentException {
    TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
    List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
    CategoryReport report = taskMonitorService.getCategoryReport(null, null, null, null, null, null, columnHeaders, false);
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug(reportToString(report, columnHeaders));
    }
    assertNotNull(report);
    assertEquals(3, report.rowSize());
    int[] row1 = report.getRow("EXTERN").getCells();
    assertArrayEquals(new int[] { 23, 0, 2, 0, 8 }, row1);
    int[] row2 = report.getRow("AUTOMATIC").getCells();
    assertArrayEquals(new int[] { 3, 0, 0, 0, 4 }, row2);
    int[] row3 = report.getRow("MANUAL").getCells();
    assertArrayEquals(new int[] { 4, 0, 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 32 with TaskMonitorService

use of pro.taskana.TaskMonitorService in project taskana by Taskana.

the class ProvideCategoryReportAccTest method testEachItemOfCategoryReportWithCategoryFilter.

@Test
public void testEachItemOfCategoryReportWithCategoryFilter() throws InvalidArgumentException {
    TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
    List<String> categories = Arrays.asList("AUTOMATIC", "MANUAL");
    List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
    CategoryReport report = taskMonitorService.getCategoryReport(null, null, categories, null, null, null, columnHeaders);
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug(reportToString(report, columnHeaders));
    }
    assertNotNull(report);
    assertEquals(2, report.rowSize());
    int[] row1 = report.getRow("AUTOMATIC").getCells();
    assertArrayEquals(new int[] { 2, 1, 0, 1, 3 }, row1);
    int[] row2 = report.getRow("MANUAL").getCells();
    assertArrayEquals(new int[] { 2, 2, 2, 0, 4 }, row2);
}
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 33 with TaskMonitorService

use of pro.taskana.TaskMonitorService 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 34 with TaskMonitorService

use of pro.taskana.TaskMonitorService 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)

Example 35 with TaskMonitorService

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

Aggregations

Test (org.junit.Test)55 TaskMonitorService (pro.taskana.TaskMonitorService)55 TaskanaEngineConfigurationTest (pro.taskana.impl.configuration.TaskanaEngineConfigurationTest)55 TimeIntervalColumnHeader (pro.taskana.impl.report.impl.TimeIntervalColumnHeader)46 CustomField (pro.taskana.CustomField)15 CustomFieldValueReport (pro.taskana.impl.report.impl.CustomFieldValueReport)10 CategoryReport (pro.taskana.impl.report.impl.CategoryReport)9 ClassificationReport (pro.taskana.impl.report.impl.ClassificationReport)9 DetailedClassificationReport (pro.taskana.impl.report.impl.DetailedClassificationReport)9 WorkbasketLevelReport (pro.taskana.impl.report.impl.WorkbasketLevelReport)9 DetailedReportRow (pro.taskana.impl.report.impl.DetailedReportRow)8 DetailedMonitorQueryItem (pro.taskana.impl.report.impl.DetailedMonitorQueryItem)7 ArrayList (java.util.ArrayList)6 TaskState (pro.taskana.TaskState)6 SelectedItem (pro.taskana.impl.SelectedItem)6 TaskQueryItem (pro.taskana.impl.report.impl.TaskQueryItem)3 TaskStatusReport (pro.taskana.impl.report.impl.TaskStatusReport)3