Search in sources :

Example 11 with ClassificationReport

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

the class ProvideClassificationReportAccTest method testGetTotalNumbersOfTasksOfClassificationReport.

@Test
public void testGetTotalNumbersOfTasksOfClassificationReport() throws InvalidArgumentException {
    TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
    ClassificationReport report = taskMonitorService.getClassificationReport(null, null, null, null, null, null);
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug(reportToString(report));
    }
    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(0, report.getRow("L10000").getCells().length);
    assertEquals(0, report.getRow("L20000").getCells().length);
    assertEquals(0, report.getRow("L30000").getCells().length);
    assertEquals(0, report.getRow("L40000").getCells().length);
    assertEquals(0, report.getRow("L50000").getCells().length);
    assertEquals(50, report.getSumRow().getTotalValue());
}
Also used : TaskMonitorService(pro.taskana.TaskMonitorService) ClassificationReport(pro.taskana.impl.report.impl.ClassificationReport) TaskanaEngineConfigurationTest(pro.taskana.impl.configuration.TaskanaEngineConfigurationTest) Test(org.junit.Test)

Example 12 with ClassificationReport

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

the class ProvideClassificationReportAccTest method testEachItemOfClassificationReport.

@Test
public void testEachItemOfClassificationReport() throws InvalidArgumentException {
    TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
    List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
    ClassificationReport report = taskMonitorService.getClassificationReport(null, 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[] { 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, 3 }, row3);
    int[] row4 = report.getRow("L40000").getCells();
    assertArrayEquals(new int[] { 2, 2, 2, 0, 4 }, row4);
    int[] row5 = report.getRow("L50000").getCells();
    assertArrayEquals(new int[] { 3, 3, 0, 5, 2 }, 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

ClassificationReport (pro.taskana.impl.report.impl.ClassificationReport)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 DetailedClassificationReport (pro.taskana.impl.report.impl.DetailedClassificationReport)3 DetailedMonitorQueryItem (pro.taskana.impl.report.impl.DetailedMonitorQueryItem)3 MonitorQueryItem (pro.taskana.impl.report.impl.MonitorQueryItem)3 ArrayList (java.util.ArrayList)2