Search in sources :

Example 16 with TaskMonitorService

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

the class ProvideClassificationReportAccTest method testEachItemOfClassificationReportNotInWorkingDays.

@Test
public void testEachItemOfClassificationReportNotInWorkingDays() throws InvalidArgumentException {
    TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
    List<TimeIntervalColumnHeader> reportLineItemDefinitions = getShortListOfColumnHeaders();
    ClassificationReport report = taskMonitorService.getClassificationReport(null, null, null, null, null, null, reportLineItemDefinitions, false);
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug(reportToString(report, reportLineItemDefinitions));
    }
    assertNotNull(report);
    assertEquals(5, report.rowSize());
    int[] row1 = report.getRow("L10000").getCells();
    assertArrayEquals(new int[] { 9, 0, 1, 0, 0 }, row1);
    int[] row2 = report.getRow("L20000").getCells();
    assertArrayEquals(new int[] { 8, 0, 1, 0, 1 }, row2);
    int[] row3 = report.getRow("L30000").getCells();
    assertArrayEquals(new int[] { 3, 0, 0, 0, 4 }, row3);
    int[] row4 = report.getRow("L40000").getCells();
    assertArrayEquals(new int[] { 4, 0, 2, 0, 4 }, row4);
    int[] row5 = report.getRow("L50000").getCells();
    assertArrayEquals(new int[] { 6, 0, 0, 0, 7 }, row5);
}
Also used : TaskMonitorService(pro.taskana.TaskMonitorService) TimeIntervalColumnHeader(pro.taskana.impl.report.impl.TimeIntervalColumnHeader) ClassificationReport(pro.taskana.impl.report.impl.ClassificationReport) TaskanaEngineConfigurationTest(pro.taskana.impl.configuration.TaskanaEngineConfigurationTest) Test(org.junit.Test)

Example 17 with TaskMonitorService

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

the class ProvideClassificationReportAccTest method testEachItemOfClassificationReportWithWorkbasketFilter.

@Test
public void testEachItemOfClassificationReportWithWorkbasketFilter() throws InvalidArgumentException {
    TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
    List<String> workbasketIds = Collections.singletonList("WBI:000000000000000000000000000000000001");
    List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
    ClassificationReport report = taskMonitorService.getClassificationReport(workbasketIds, null, null, null, null, null, columnHeaders);
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug(reportToString(report, columnHeaders));
    }
    assertNotNull(report);
    assertEquals(5, report.rowSize());
    int[] row1 = report.getRow("L10000").getCells();
    assertArrayEquals(new int[] { 6, 0, 0, 0, 0 }, row1);
    int[] row2 = report.getRow("L20000").getCells();
    assertArrayEquals(new int[] { 2, 0, 0, 0, 0 }, row2);
    int[] row3 = report.getRow("L30000").getCells();
    assertArrayEquals(new int[] { 2, 1, 0, 1, 1 }, row3);
    int[] row4 = report.getRow("L40000").getCells();
    assertArrayEquals(new int[] { 1, 0, 1, 0, 1 }, row4);
    int[] row5 = report.getRow("L50000").getCells();
    assertArrayEquals(new int[] { 2, 2, 0, 0, 0 }, row5);
}
Also used : TaskMonitorService(pro.taskana.TaskMonitorService) TimeIntervalColumnHeader(pro.taskana.impl.report.impl.TimeIntervalColumnHeader) ClassificationReport(pro.taskana.impl.report.impl.ClassificationReport) TaskanaEngineConfigurationTest(pro.taskana.impl.configuration.TaskanaEngineConfigurationTest) Test(org.junit.Test)

Example 18 with TaskMonitorService

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

the class ProvideClassificationReportAccTest method testGetClassificationReportWithReportLineItemDefinitions.

@Test
public void testGetClassificationReportWithReportLineItemDefinitions() throws InvalidArgumentException {
    TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
    List<TimeIntervalColumnHeader> reportLineItemDefinitions = getListOfColumnsHeaders();
    ClassificationReport report = taskMonitorService.getClassificationReport(null, null, null, null, null, null, reportLineItemDefinitions);
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug(reportToString(report, reportLineItemDefinitions));
    }
    int sumLineCount = IntStream.of(report.getSumRow().getCells()).sum();
    assertNotNull(report);
    assertEquals(5, report.rowSize());
    assertEquals(10, report.getRow("L10000").getTotalValue());
    assertEquals(10, report.getRow("L20000").getTotalValue());
    assertEquals(7, report.getRow("L30000").getTotalValue());
    assertEquals(10, report.getRow("L40000").getTotalValue());
    assertEquals(13, report.getRow("L50000").getTotalValue());
    assertEquals(10, report.getSumRow().getCells()[0]);
    assertEquals(9, report.getSumRow().getCells()[1]);
    assertEquals(11, report.getSumRow().getCells()[2]);
    assertEquals(0, report.getSumRow().getCells()[3]);
    assertEquals(4, report.getSumRow().getCells()[4]);
    assertEquals(0, report.getSumRow().getCells()[5]);
    assertEquals(7, report.getSumRow().getCells()[6]);
    assertEquals(4, report.getSumRow().getCells()[7]);
    assertEquals(5, report.getSumRow().getCells()[8]);
    assertEquals(50, report.getSumRow().getTotalValue());
    assertEquals(50, sumLineCount);
}
Also used : TaskMonitorService(pro.taskana.TaskMonitorService) TimeIntervalColumnHeader(pro.taskana.impl.report.impl.TimeIntervalColumnHeader) ClassificationReport(pro.taskana.impl.report.impl.ClassificationReport) TaskanaEngineConfigurationTest(pro.taskana.impl.configuration.TaskanaEngineConfigurationTest) Test(org.junit.Test)

Example 19 with TaskMonitorService

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

the class ProvideClassificationReportAccTest method testEachItemOfClassificationReportWithStateFilter.

@Test
public void testEachItemOfClassificationReportWithStateFilter() throws InvalidArgumentException {
    TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
    List<TaskState> states = Collections.singletonList(TaskState.READY);
    List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
    ClassificationReport report = taskMonitorService.getClassificationReport(null, states, null, null, null, null, columnHeaders);
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug(reportToString(report, columnHeaders));
    }
    assertNotNull(report);
    assertEquals(5, report.rowSize());
    int[] row1 = report.getRow("L10000").getCells();
    assertArrayEquals(new int[] { 7, 2, 1, 0, 0 }, row1);
    int[] row2 = report.getRow("L20000").getCells();
    assertArrayEquals(new int[] { 5, 3, 1, 1, 0 }, row2);
    int[] row3 = report.getRow("L30000").getCells();
    assertArrayEquals(new int[] { 2, 1, 0, 1, 0 }, row3);
    int[] row4 = report.getRow("L40000").getCells();
    assertArrayEquals(new int[] { 2, 2, 2, 0, 0 }, row4);
    int[] row5 = report.getRow("L50000").getCells();
    assertArrayEquals(new int[] { 3, 3, 0, 5, 0 }, row5);
}
Also used : TaskMonitorService(pro.taskana.TaskMonitorService) TaskState(pro.taskana.TaskState) TimeIntervalColumnHeader(pro.taskana.impl.report.impl.TimeIntervalColumnHeader) ClassificationReport(pro.taskana.impl.report.impl.ClassificationReport) TaskanaEngineConfigurationTest(pro.taskana.impl.configuration.TaskanaEngineConfigurationTest) Test(org.junit.Test)

Example 20 with TaskMonitorService

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

the class ProvideClassificationReportAccTest method testEachItemOfClassificationReportWithDomainFilter.

@Test
public void testEachItemOfClassificationReportWithDomainFilter() throws InvalidArgumentException {
    TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
    List<String> domains = Collections.singletonList("DOMAIN_A");
    List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
    ClassificationReport report = taskMonitorService.getClassificationReport(null, null, null, domains, null, null, columnHeaders);
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug(reportToString(report, columnHeaders));
    }
    assertNotNull(report);
    assertEquals(5, report.rowSize());
    int[] row1 = report.getRow("L10000").getCells();
    assertArrayEquals(new int[] { 5, 2, 1, 0, 0 }, row1);
    int[] row2 = report.getRow("L20000").getCells();
    assertArrayEquals(new int[] { 3, 1, 1, 1, 0 }, row2);
    int[] row3 = report.getRow("L30000").getCells();
    assertArrayEquals(new int[] { 1, 0, 0, 1, 1 }, row3);
    int[] row4 = report.getRow("L40000").getCells();
    assertArrayEquals(new int[] { 2, 0, 0, 0, 3 }, row4);
    int[] row5 = report.getRow("L50000").getCells();
    assertArrayEquals(new int[] { 0, 1, 0, 3, 0 }, row5);
}
Also used : TaskMonitorService(pro.taskana.TaskMonitorService) TimeIntervalColumnHeader(pro.taskana.impl.report.impl.TimeIntervalColumnHeader) ClassificationReport(pro.taskana.impl.report.impl.ClassificationReport) 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