Search in sources :

Example 1 with DetailedClassificationReport

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

the class ProvideDetailedClassificationReportAccTest method testEachItemOfDetailedClassificationReportWithCustomFieldValueFilter.

@Test
public void testEachItemOfDetailedClassificationReportWithCustomFieldValueFilter() throws InvalidArgumentException {
    TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
    CustomField customField = CustomField.CUSTOM_1;
    List<String> customFieldValues = Collections.singletonList("Geschaeftsstelle A");
    List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
    DetailedClassificationReport report = taskMonitorService.getDetailedClassificationReport(null, null, null, null, customField, customFieldValues, columnHeaders);
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug(reportToString(report, columnHeaders));
    }
    assertNotNull(report);
    assertEquals(5, report.rowSize());
    DetailedReportRow line1 = report.getRow("L10000");
    assertArrayEquals(new int[] { 4, 0, 0, 0, 0 }, line1.getCells());
    ReportRow<DetailedMonitorQueryItem> detailedLine1 = line1.getDetailRows().get("L11000");
    assertArrayEquals(new int[] { 1, 0, 0, 0, 0 }, detailedLine1.getCells());
    ReportRow<DetailedMonitorQueryItem> detailedLineNoAttachment1 = line1.getDetailRows().get("N/A");
    assertArrayEquals(new int[] { 3, 0, 0, 0, 0 }, detailedLineNoAttachment1.getCells());
    DetailedReportRow line2 = report.getRow("L20000");
    assertArrayEquals(new int[] { 4, 1, 1, 1, 0 }, line2.getCells());
    ReportRow<DetailedMonitorQueryItem> detailedLine2 = line2.getDetailRows().get("L22000");
    assertArrayEquals(new int[] { 1, 1, 1, 1, 0 }, detailedLine2.getCells());
    ReportRow<DetailedMonitorQueryItem> detailedLineNoAttachment2 = line2.getDetailRows().get("N/A");
    assertArrayEquals(new int[] { 3, 0, 0, 0, 0 }, detailedLineNoAttachment2.getCells());
    DetailedReportRow line3 = report.getRow("L30000");
    assertArrayEquals(new int[] { 1, 0, 0, 1, 1 }, line3.getCells());
    ReportRow<DetailedMonitorQueryItem> detailedLine3a = line3.getDetailRows().get("L33000");
    assertArrayEquals(new int[] { 0, 0, 0, 1, 0 }, detailedLine3a.getCells());
    ReportRow<DetailedMonitorQueryItem> detailedLineNoAttachment3 = line3.getDetailRows().get("N/A");
    assertArrayEquals(new int[] { 1, 0, 0, 0, 1 }, detailedLineNoAttachment3.getCells());
    DetailedReportRow line4 = report.getRow("L40000");
    assertArrayEquals(new int[] { 1, 1, 2, 0, 2 }, line4.getCells());
    ReportRow<DetailedMonitorQueryItem> detailedLineNoAttachment4 = line4.getDetailRows().get("N/A");
    assertArrayEquals(new int[] { 1, 1, 2, 0, 2 }, detailedLineNoAttachment4.getCells());
    DetailedReportRow line5 = report.getRow("L50000");
    assertArrayEquals(new int[] { 1, 2, 0, 2, 0 }, line5.getCells());
    ReportRow<DetailedMonitorQueryItem> detailedLineNoAttachment5 = line5.getDetailRows().get("N/A");
    assertArrayEquals(new int[] { 1, 2, 0, 2, 0 }, detailedLineNoAttachment5.getCells());
}
Also used : TaskMonitorService(pro.taskana.TaskMonitorService) CustomField(pro.taskana.CustomField) DetailedClassificationReport(pro.taskana.impl.report.impl.DetailedClassificationReport) DetailedMonitorQueryItem(pro.taskana.impl.report.impl.DetailedMonitorQueryItem) DetailedReportRow(pro.taskana.impl.report.impl.DetailedReportRow) TimeIntervalColumnHeader(pro.taskana.impl.report.impl.TimeIntervalColumnHeader) TaskanaEngineConfigurationTest(pro.taskana.impl.configuration.TaskanaEngineConfigurationTest) Test(org.junit.Test)

Example 2 with DetailedClassificationReport

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

the class ProvideDetailedClassificationReportAccTest method testGetTotalNumbersOfTasksOfDetailedClassificationReport.

@Test
public void testGetTotalNumbersOfTasksOfDetailedClassificationReport() throws InvalidArgumentException {
    TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
    DetailedClassificationReport report = taskMonitorService.getDetailedClassificationReport(null, null, null, null, null, null);
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug(reportToString(report));
    }
    assertNotNull(report);
    assertEquals(5, report.rowSize());
    DetailedReportRow row1 = report.getRow("L10000");
    assertEquals(10, row1.getTotalValue());
    assertEquals(3, row1.getDetailRows().get("L11000").getTotalValue());
    assertEquals(7, row1.getDetailRows().get("N/A").getTotalValue());
    assertEquals(0, row1.getCells().length);
    assertEquals(2, row1.getDetailRows().size());
    DetailedReportRow row2 = report.getRow("L20000");
    assertEquals(10, row2.getTotalValue());
    assertEquals(4, row2.getDetailRows().get("L22000").getTotalValue());
    assertEquals(6, row2.getDetailRows().get("N/A").getTotalValue());
    assertEquals(0, row2.getCells().length);
    assertEquals(2, row2.getDetailRows().size());
    DetailedReportRow row3 = report.getRow("L30000");
    assertEquals(7, row3.getTotalValue());
    assertEquals(3, row3.getDetailRows().get("L33000").getTotalValue());
    assertEquals(1, row3.getDetailRows().get("L99000").getTotalValue());
    assertEquals(3, row3.getDetailRows().get("N/A").getTotalValue());
    assertEquals(0, row3.getCells().length);
    assertEquals(3, row3.getDetailRows().size());
    DetailedReportRow row4 = report.getRow("L40000");
    assertEquals(10, row4.getTotalValue());
    assertEquals(10, row4.getDetailRows().get("N/A").getTotalValue());
    assertEquals(0, row4.getCells().length);
    assertEquals(1, row4.getDetailRows().size());
    DetailedReportRow row5 = report.getRow("L50000");
    assertEquals(13, row5.getTotalValue());
    assertEquals(13, row5.getDetailRows().get("N/A").getTotalValue());
    assertEquals(0, row5.getCells().length);
    assertEquals(1, row5.getDetailRows().size());
    assertEquals(50, report.getSumRow().getTotalValue());
}
Also used : TaskMonitorService(pro.taskana.TaskMonitorService) DetailedClassificationReport(pro.taskana.impl.report.impl.DetailedClassificationReport) DetailedReportRow(pro.taskana.impl.report.impl.DetailedReportRow) TaskanaEngineConfigurationTest(pro.taskana.impl.configuration.TaskanaEngineConfigurationTest) Test(org.junit.Test)

Example 3 with DetailedClassificationReport

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

the class ProvideDetailedClassificationReportAccTest method testEachItemOfDetailedClassificationReportWithCategoryFilter.

@Test
public void testEachItemOfDetailedClassificationReportWithCategoryFilter() throws InvalidArgumentException {
    TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
    List<String> categories = Arrays.asList("AUTOMATIC", "MANUAL");
    List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
    DetailedClassificationReport report = taskMonitorService.getDetailedClassificationReport(null, null, categories, null, null, null, columnHeaders);
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug(reportToString(report, columnHeaders));
    }
    assertNotNull(report);
    assertEquals(2, report.rowSize());
    DetailedReportRow line1 = report.getRow("L30000");
    assertArrayEquals(new int[] { 2, 1, 0, 1, 3 }, line1.getCells());
    ReportRow<DetailedMonitorQueryItem> detailedLine1a = line1.getDetailRows().get("L33000");
    assertArrayEquals(new int[] { 0, 1, 0, 1, 1 }, detailedLine1a.getCells());
    ReportRow<DetailedMonitorQueryItem> detailedLine1b = line1.getDetailRows().get("L99000");
    assertArrayEquals(new int[] { 0, 0, 0, 0, 1 }, detailedLine1b.getCells());
    ReportRow<DetailedMonitorQueryItem> detailedLine1WithoutAttachment = line1.getDetailRows().get("N/A");
    assertArrayEquals(new int[] { 2, 0, 0, 0, 1 }, detailedLine1WithoutAttachment.getCells());
    DetailedReportRow line2 = report.getRow("L40000");
    assertArrayEquals(new int[] { 2, 2, 2, 0, 4 }, line2.getCells());
    ReportRow<DetailedMonitorQueryItem> detailedLine2WithoutAttachment = line2.getDetailRows().get("N/A");
    assertArrayEquals(new int[] { 2, 2, 2, 0, 4 }, detailedLine2WithoutAttachment.getCells());
}
Also used : TaskMonitorService(pro.taskana.TaskMonitorService) DetailedClassificationReport(pro.taskana.impl.report.impl.DetailedClassificationReport) DetailedMonitorQueryItem(pro.taskana.impl.report.impl.DetailedMonitorQueryItem) DetailedReportRow(pro.taskana.impl.report.impl.DetailedReportRow) TimeIntervalColumnHeader(pro.taskana.impl.report.impl.TimeIntervalColumnHeader) TaskanaEngineConfigurationTest(pro.taskana.impl.configuration.TaskanaEngineConfigurationTest) Test(org.junit.Test)

Example 4 with DetailedClassificationReport

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

the class ProvideDetailedClassificationReportAccTest method testGetDetailedClassificationReportWithReportLineItemDefinitions.

@Test
public void testGetDetailedClassificationReportWithReportLineItemDefinitions() throws InvalidArgumentException {
    TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
    List<TimeIntervalColumnHeader> columnHeaders = getListOfColumnHeaders();
    DetailedClassificationReport report = taskMonitorService.getDetailedClassificationReport(null, null, null, null, null, null, columnHeaders);
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug(reportToString(report, columnHeaders));
    }
    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());
    int[] sumRow = report.getSumRow().getCells();
    assertArrayEquals(new int[] { 10, 9, 11, 0, 4, 0, 7, 4, 5 }, sumRow);
    assertEquals(50, report.getSumRow().getTotalValue());
}
Also used : TaskMonitorService(pro.taskana.TaskMonitorService) DetailedClassificationReport(pro.taskana.impl.report.impl.DetailedClassificationReport) TimeIntervalColumnHeader(pro.taskana.impl.report.impl.TimeIntervalColumnHeader) TaskanaEngineConfigurationTest(pro.taskana.impl.configuration.TaskanaEngineConfigurationTest) Test(org.junit.Test)

Example 5 with DetailedClassificationReport

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

the class ProvideDetailedClassificationReportAccTest method testEachItemOfDetailedClassificationReportWithDomainFilter.

@Test
public void testEachItemOfDetailedClassificationReportWithDomainFilter() throws InvalidArgumentException {
    TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
    List<String> domains = Collections.singletonList("DOMAIN_A");
    List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
    DetailedClassificationReport report = taskMonitorService.getDetailedClassificationReport(null, null, null, domains, null, null, columnHeaders);
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug(reportToString(report, columnHeaders));
    }
    assertNotNull(report);
    assertEquals(5, report.rowSize());
    DetailedReportRow line1 = report.getRow("L10000");
    assertArrayEquals(new int[] { 5, 2, 1, 0, 0 }, line1.getCells());
    ReportRow<DetailedMonitorQueryItem> detailedLine1 = line1.getDetailRows().get("L11000");
    assertArrayEquals(new int[] { 1, 0, 1, 0, 0 }, detailedLine1.getCells());
    ReportRow<DetailedMonitorQueryItem> detailedLineNoAttachment1 = line1.getDetailRows().get("N/A");
    assertArrayEquals(new int[] { 4, 2, 0, 0, 0 }, detailedLineNoAttachment1.getCells());
    DetailedReportRow line2 = report.getRow("L20000");
    assertArrayEquals(new int[] { 3, 1, 1, 1, 0 }, line2.getCells());
    ReportRow<DetailedMonitorQueryItem> detailedLine2 = line2.getDetailRows().get("L22000");
    assertArrayEquals(new int[] { 1, 0, 1, 1, 0 }, detailedLine2.getCells());
    ReportRow<DetailedMonitorQueryItem> detailedLineNoAttachment2 = line2.getDetailRows().get("N/A");
    assertArrayEquals(new int[] { 2, 1, 0, 0, 0 }, detailedLineNoAttachment2.getCells());
    DetailedReportRow line3 = report.getRow("L30000");
    assertArrayEquals(new int[] { 1, 0, 0, 1, 1 }, line3.getCells());
    ReportRow<DetailedMonitorQueryItem> detailedLine3 = line3.getDetailRows().get("L33000");
    assertArrayEquals(new int[] { 0, 0, 0, 1, 1 }, detailedLine3.getCells());
    ReportRow<DetailedMonitorQueryItem> detailedLineNoAttachment3 = line3.getDetailRows().get("N/A");
    assertArrayEquals(new int[] { 1, 0, 0, 0, 0 }, detailedLineNoAttachment3.getCells());
    DetailedReportRow line4 = report.getRow("L40000");
    assertArrayEquals(new int[] { 2, 0, 0, 0, 3 }, line4.getCells());
    ReportRow<DetailedMonitorQueryItem> detailedLineNoAttachment4 = line4.getDetailRows().get("N/A");
    assertArrayEquals(new int[] { 2, 0, 0, 0, 3 }, detailedLineNoAttachment4.getCells());
    DetailedReportRow line5 = report.getRow("L50000");
    assertArrayEquals(new int[] { 0, 1, 0, 3, 0 }, line5.getCells());
    ReportRow<DetailedMonitorQueryItem> detailedLineNoAttachment5 = line5.getDetailRows().get("N/A");
    assertArrayEquals(new int[] { 0, 1, 0, 3, 0 }, detailedLineNoAttachment5.getCells());
}
Also used : TaskMonitorService(pro.taskana.TaskMonitorService) DetailedClassificationReport(pro.taskana.impl.report.impl.DetailedClassificationReport) DetailedMonitorQueryItem(pro.taskana.impl.report.impl.DetailedMonitorQueryItem) DetailedReportRow(pro.taskana.impl.report.impl.DetailedReportRow) TimeIntervalColumnHeader(pro.taskana.impl.report.impl.TimeIntervalColumnHeader) TaskanaEngineConfigurationTest(pro.taskana.impl.configuration.TaskanaEngineConfigurationTest) Test(org.junit.Test)

Aggregations

DetailedClassificationReport (pro.taskana.impl.report.impl.DetailedClassificationReport)12 Test (org.junit.Test)11 DetailedMonitorQueryItem (pro.taskana.impl.report.impl.DetailedMonitorQueryItem)10 DetailedReportRow (pro.taskana.impl.report.impl.DetailedReportRow)10 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 ArrayList (java.util.ArrayList)2