Search in sources :

Example 1 with TaskMonitorService

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

the class ProvideCategoryReportAccTest method testGetTotalNumbersOfTasksOfCategoryReport.

@Test
public void testGetTotalNumbersOfTasksOfCategoryReport() throws InvalidArgumentException {
    TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
    CategoryReport report = taskMonitorService.getCategoryReport(null, null, null, null, null, null);
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug(reportToString(report));
    }
    assertNotNull(report);
    assertEquals(3, report.rowSize());
    assertEquals(33, report.getRow("EXTERN").getTotalValue());
    assertEquals(7, report.getRow("AUTOMATIC").getTotalValue());
    assertEquals(10, report.getRow("MANUAL").getTotalValue());
    assertEquals(0, report.getRow("EXTERN").getCells().length);
    assertEquals(0, report.getRow("AUTOMATIC").getCells().length);
    assertEquals(0, report.getRow("MANUAL").getCells().length);
    assertEquals(50, report.getSumRow().getTotalValue());
}
Also used : TaskMonitorService(pro.taskana.TaskMonitorService) CategoryReport(pro.taskana.impl.report.impl.CategoryReport) TaskanaEngineConfigurationTest(pro.taskana.impl.configuration.TaskanaEngineConfigurationTest) Test(org.junit.Test)

Example 2 with TaskMonitorService

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

the class ProvideCategoryReportAccTest method testGetCategoryReportWithReportLineItemDefinitions.

@Test
public void testGetCategoryReportWithReportLineItemDefinitions() throws InvalidArgumentException {
    TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
    List<TimeIntervalColumnHeader> columnHeaders = getListOfColumnHeaders();
    CategoryReport report = taskMonitorService.getCategoryReport(null, null, null, null, null, null, columnHeaders);
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug(reportToString(report, columnHeaders));
    }
    int sumLineCount = IntStream.of(report.getSumRow().getCells()).sum();
    assertNotNull(report);
    assertEquals(3, report.rowSize());
    assertEquals(33, report.getRow("EXTERN").getTotalValue());
    assertEquals(7, report.getRow("AUTOMATIC").getTotalValue());
    assertEquals(10, report.getRow("MANUAL").getTotalValue());
    int[] sumRow = report.getSumRow().getCells();
    assertArrayEquals(new int[] { 10, 9, 11, 0, 4, 0, 7, 4, 5 }, sumRow);
    assertEquals(50, report.getSumRow().getTotalValue());
    assertEquals(50, sumLineCount);
}
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 3 with TaskMonitorService

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

the class ProvideCategoryReportAccTest method testEachItemOfCategoryReportWithStateFilter.

@Test
public void testEachItemOfCategoryReportWithStateFilter() throws InvalidArgumentException {
    TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
    List<TaskState> states = Collections.singletonList(TaskState.READY);
    List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
    CategoryReport report = taskMonitorService.getCategoryReport(null, states, 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, 0 }, row1);
    int[] row2 = report.getRow("AUTOMATIC").getCells();
    assertArrayEquals(new int[] { 2, 1, 0, 1, 0 }, row2);
    int[] row3 = report.getRow("MANUAL").getCells();
    assertArrayEquals(new int[] { 2, 2, 2, 0, 0 }, row3);
}
Also used : TaskMonitorService(pro.taskana.TaskMonitorService) TaskState(pro.taskana.TaskState) 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 4 with TaskMonitorService

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

the class ProvideCategoryReportAccTest method testEachItemOfCategoryReportWithWorkbasketFilter.

@Test
public void testEachItemOfCategoryReportWithWorkbasketFilter() throws InvalidArgumentException {
    TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
    List<String> workbasketIds = Collections.singletonList("WBI:000000000000000000000000000000000001");
    List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
    CategoryReport report = taskMonitorService.getCategoryReport(workbasketIds, 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[] { 10, 2, 0, 0, 0 }, row1);
    int[] row2 = report.getRow("AUTOMATIC").getCells();
    assertArrayEquals(new int[] { 2, 1, 0, 1, 1 }, row2);
    int[] row3 = report.getRow("MANUAL").getCells();
    assertArrayEquals(new int[] { 1, 0, 1, 0, 1 }, 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 5 with TaskMonitorService

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

the class ProvideCategoryReportAccTest method testEachItemOfCategoryReportWithDomainFilter.

@Test
public void testEachItemOfCategoryReportWithDomainFilter() throws InvalidArgumentException {
    TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
    List<String> domains = Collections.singletonList("DOMAIN_A");
    List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
    CategoryReport report = taskMonitorService.getCategoryReport(null, null, null, domains, 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[] { 8, 4, 2, 4, 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[] { 2, 0, 0, 0, 3 }, 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)

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