Search in sources :

Example 6 with DetailedMonitorQueryItem

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

the class ProvideDetailedClassificationReportAccTest method testEachItemOfDetailedClassificationReport.

@Test
public void testEachItemOfDetailedClassificationReport() throws InvalidArgumentException {
    TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
    List<TimeIntervalColumnHeader> reportLineItemDefinitions = getShortListOfColumnHeaders();
    DetailedClassificationReport report = taskMonitorService.getDetailedClassificationReport(null, null, null, null, null, null, reportLineItemDefinitions);
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug(reportToString(report, reportLineItemDefinitions));
    }
    assertNotNull(report);
    assertEquals(5, report.rowSize());
    DetailedReportRow line1 = report.getRow("L10000");
    assertArrayEquals(new int[] { 7, 2, 1, 0, 0 }, line1.getCells());
    ReportRow<DetailedMonitorQueryItem> detailedLine1 = line1.getDetailRows().get("L11000");
    assertArrayEquals(new int[] { 2, 0, 1, 0, 0 }, detailedLine1.getCells());
    ReportRow<DetailedMonitorQueryItem> detailedLineNoAttachment1 = line1.getDetailRows().get("N/A");
    assertArrayEquals(new int[] { 5, 2, 0, 0, 0 }, detailedLineNoAttachment1.getCells());
    DetailedReportRow line2 = report.getRow("L20000");
    assertArrayEquals(new int[] { 5, 3, 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[] { 4, 2, 0, 0, 0 }, detailedLineNoAttachment2.getCells());
    DetailedReportRow line3 = report.getRow("L30000");
    assertArrayEquals(new int[] { 2, 1, 0, 1, 3 }, line3.getCells());
    ReportRow<DetailedMonitorQueryItem> detailedLine3a = line3.getDetailRows().get("L33000");
    assertArrayEquals(new int[] { 0, 1, 0, 1, 1 }, detailedLine3a.getCells());
    ReportRow<DetailedMonitorQueryItem> detailedLine3b = line3.getDetailRows().get("L99000");
    assertArrayEquals(new int[] { 0, 0, 0, 0, 1 }, detailedLine3b.getCells());
    ReportRow<DetailedMonitorQueryItem> detailedLineNoAttachment3 = line3.getDetailRows().get("N/A");
    assertArrayEquals(new int[] { 2, 0, 0, 0, 1 }, detailedLineNoAttachment3.getCells());
    DetailedReportRow line4 = report.getRow("L40000");
    assertArrayEquals(new int[] { 2, 2, 2, 0, 4 }, line4.getCells());
    ReportRow<DetailedMonitorQueryItem> detailedLineNoAttachment4 = line4.getDetailRows().get("N/A");
    assertArrayEquals(new int[] { 2, 2, 2, 0, 4 }, detailedLineNoAttachment4.getCells());
    DetailedReportRow line5 = report.getRow("L50000");
    assertArrayEquals(new int[] { 3, 3, 0, 5, 2 }, line5.getCells());
    ReportRow<DetailedMonitorQueryItem> detailedLineNoAttachment5 = line5.getDetailRows().get("N/A");
    assertArrayEquals(new int[] { 3, 3, 0, 5, 2 }, 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)

Example 7 with DetailedMonitorQueryItem

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

the class TaskMonitorServiceImplTest method testGetTotalNumbersOfDetailedClassificationReport.

@Test
public void testGetTotalNumbersOfDetailedClassificationReport() throws InvalidArgumentException {
    List<String> workbasketIds = Collections.singletonList("WBI:000000000000000000000000000000000001");
    List<TaskState> states = Arrays.asList(TaskState.CLAIMED, TaskState.READY);
    List<String> categories = Collections.singletonList("EXTERN");
    List<String> domains = Collections.singletonList("DOMAIN_A");
    CustomField customField = CustomField.CUSTOM_1;
    List<String> customFieldValues = Collections.singletonList("Geschaeftsstelle A");
    List<DetailedMonitorQueryItem> expectedResult = new ArrayList<>();
    DetailedMonitorQueryItem detailedMonitorQueryItem = new DetailedMonitorQueryItem();
    detailedMonitorQueryItem.setKey("CLI:000000000000000000000000000000000001");
    detailedMonitorQueryItem.setAttachmentKey("CLI:000000000000000000000000000000000006");
    detailedMonitorQueryItem.setNumberOfTasks(1);
    expectedResult.add(detailedMonitorQueryItem);
    doReturn(expectedResult).when(taskMonitorMapperMock).getTaskCountOfDetailedClassifications(workbasketIds, states, categories, domains, customField, customFieldValues);
    DetailedClassificationReport actualResult = cut.getDetailedClassificationReport(workbasketIds, states, categories, domains, customField, customFieldValues);
    verify(taskanaEngineImplMock, times(1)).openConnection();
    verify(taskanaEngineImplMock, times(2)).getConfiguration();
    verify(taskanaEngineConfiguration, times(1)).isGermanPublicHolidaysEnabled();
    verify(taskanaEngineConfiguration, times(1)).getCustomHolidays();
    verify(taskMonitorMapperMock, times(1)).getTaskCountOfDetailedClassifications(any(), any(), any(), any(), any(), any());
    verify(taskanaEngineImplMock, times(1)).returnConnection();
    verifyNoMoreInteractions(taskanaEngineImplMock, taskMonitorMapperMock, taskanaEngineConfiguration);
    DetailedReportRow line = actualResult.getRow("CLI:000000000000000000000000000000000001");
    assertNotNull(actualResult);
    assertEquals(line.getTotalValue(), 1);
    assertEquals(line.getDetailRows().get("CLI:000000000000000000000000000000000006").getTotalValue(), 1);
    assertEquals(actualResult.getSumRow().getTotalValue(), 1);
}
Also used : CustomField(pro.taskana.CustomField) ArrayList(java.util.ArrayList) DetailedClassificationReport(pro.taskana.impl.report.impl.DetailedClassificationReport) DetailedMonitorQueryItem(pro.taskana.impl.report.impl.DetailedMonitorQueryItem) DetailedReportRow(pro.taskana.impl.report.impl.DetailedReportRow) TaskState(pro.taskana.TaskState) Test(org.junit.Test)

Example 8 with DetailedMonitorQueryItem

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

the class TaskMonitorServiceImpl method getDetailedClassificationReport.

@Override
public DetailedClassificationReport getDetailedClassificationReport(List<String> workbasketIds, List<TaskState> states, List<String> categories, List<String> domains, CustomField customField, List<String> customFieldValues, List<TimeIntervalColumnHeader> columnHeaders, boolean inWorkingDays) throws InvalidArgumentException {
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug("entry to getDetailedClassificationReport(workbasketIds = {}, states = {}, " + "categories = {}, domains = {}, customField = {}, customFieldValues = {}, " + "columnHeaders = {}, inWorkingDays = {})", LoggerUtils.listToString(workbasketIds), LoggerUtils.listToString(states), LoggerUtils.listToString(categories), LoggerUtils.listToString(domains), customField, LoggerUtils.listToString(customFieldValues), LoggerUtils.listToString(columnHeaders), inWorkingDays);
    }
    try {
        taskanaEngineImpl.openConnection();
        configureDaysToWorkingDaysConverter();
        DetailedClassificationReport report = new DetailedClassificationReport(columnHeaders);
        List<DetailedMonitorQueryItem> detailedMonitorQueryItems = taskMonitorMapper.getTaskCountOfDetailedClassifications(workbasketIds, states, categories, domains, customField, customFieldValues);
        report.addItems(detailedMonitorQueryItems, new DaysToWorkingDaysPreProcessor<>(columnHeaders, inWorkingDays));
        return report;
    } finally {
        taskanaEngineImpl.returnConnection();
        LOGGER.debug("exit from getDetailedClassificationReport().");
    }
}
Also used : DetailedClassificationReport(pro.taskana.impl.report.impl.DetailedClassificationReport) DetailedMonitorQueryItem(pro.taskana.impl.report.impl.DetailedMonitorQueryItem)

Example 9 with DetailedMonitorQueryItem

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

the class TaskMonitorServiceImplTest method testGetDetailedClassificationReportWithReportLineItemDefinitions.

@Test
public void testGetDetailedClassificationReportWithReportLineItemDefinitions() throws InvalidArgumentException {
    List<String> workbasketIds = Collections.singletonList("WBI:000000000000000000000000000000000001");
    List<TaskState> states = Arrays.asList(TaskState.CLAIMED, TaskState.READY);
    List<String> categories = Collections.singletonList("EXTERN");
    List<String> domains = Collections.singletonList("DOMAIN_A");
    CustomField customField = CustomField.CUSTOM_1;
    List<String> customFieldValues = Collections.singletonList("Geschaeftsstelle A");
    List<TimeIntervalColumnHeader> reportLineItemDefinitions = Collections.singletonList(new TimeIntervalColumnHeader(0, 0));
    List<DetailedMonitorQueryItem> expectedResult = new ArrayList<>();
    DetailedMonitorQueryItem detailedMonitorQueryItem = new DetailedMonitorQueryItem();
    detailedMonitorQueryItem.setKey("CLI:000000000000000000000000000000000001");
    detailedMonitorQueryItem.setAttachmentKey("CLI:000000000000000000000000000000000006");
    detailedMonitorQueryItem.setAgeInDays(0);
    detailedMonitorQueryItem.setNumberOfTasks(1);
    expectedResult.add(detailedMonitorQueryItem);
    doReturn(expectedResult).when(taskMonitorMapperMock).getTaskCountOfDetailedClassifications(workbasketIds, states, categories, domains, customField, customFieldValues);
    DetailedClassificationReport actualResult = cut.getDetailedClassificationReport(workbasketIds, states, categories, domains, customField, customFieldValues, reportLineItemDefinitions);
    verify(taskanaEngineImplMock, times(1)).openConnection();
    verify(taskanaEngineImplMock, times(2)).getConfiguration();
    verify(taskanaEngineConfiguration, times(1)).isGermanPublicHolidaysEnabled();
    verify(taskanaEngineConfiguration, times(1)).getCustomHolidays();
    verify(taskMonitorMapperMock, times(1)).getTaskCountOfDetailedClassifications(any(), any(), any(), any(), any(), any());
    verify(taskanaEngineImplMock, times(1)).returnConnection();
    verifyNoMoreInteractions(taskanaEngineImplMock, taskMonitorMapperMock, taskanaEngineConfiguration);
    DetailedReportRow line = actualResult.getRow("CLI:000000000000000000000000000000000001");
    assertNotNull(actualResult);
    assertEquals(line.getTotalValue(), 1);
    assertEquals(line.getDetailRows().get("CLI:000000000000000000000000000000000006").getTotalValue(), 1);
    assertEquals(line.getCells()[0], 1);
    assertEquals(line.getDetailRows().get("CLI:000000000000000000000000000000000006").getCells()[0], 1);
    assertEquals(actualResult.getSumRow().getTotalValue(), 1);
    assertEquals(actualResult.getSumRow().getCells()[0], 1);
}
Also used : CustomField(pro.taskana.CustomField) ArrayList(java.util.ArrayList) DetailedClassificationReport(pro.taskana.impl.report.impl.DetailedClassificationReport) DetailedMonitorQueryItem(pro.taskana.impl.report.impl.DetailedMonitorQueryItem) DetailedReportRow(pro.taskana.impl.report.impl.DetailedReportRow) TaskState(pro.taskana.TaskState) TimeIntervalColumnHeader(pro.taskana.impl.report.impl.TimeIntervalColumnHeader) Test(org.junit.Test)

Example 10 with DetailedMonitorQueryItem

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

the class ProvideDetailedClassificationReportAccTest method testEachItemOfDetailedClassificationReportWithWorkbasketFilter.

@Test
public void testEachItemOfDetailedClassificationReportWithWorkbasketFilter() throws InvalidArgumentException {
    TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
    List<String> workbasketIds = Collections.singletonList("WBI:000000000000000000000000000000000001");
    List<TimeIntervalColumnHeader> reportLineItemDefinitions = getShortListOfColumnHeaders();
    DetailedClassificationReport report = taskMonitorService.getDetailedClassificationReport(workbasketIds, null, null, null, null, null, reportLineItemDefinitions);
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug(reportToString(report, reportLineItemDefinitions));
    }
    assertNotNull(report);
    assertEquals(5, report.rowSize());
    DetailedReportRow line1 = report.getRow("L10000");
    assertArrayEquals(new int[] { 6, 0, 0, 0, 0 }, line1.getCells());
    ReportRow<DetailedMonitorQueryItem> detailedLine1 = line1.getDetailRows().get("L11000");
    assertArrayEquals(new int[] { 2, 0, 0, 0, 0 }, detailedLine1.getCells());
    ReportRow<DetailedMonitorQueryItem> detailedLineNoAttachment1 = line1.getDetailRows().get("N/A");
    assertArrayEquals(new int[] { 4, 0, 0, 0, 0 }, detailedLineNoAttachment1.getCells());
    DetailedReportRow line2 = report.getRow("L20000");
    assertArrayEquals(new int[] { 2, 0, 0, 0, 0 }, line2.getCells());
    ReportRow<DetailedMonitorQueryItem> detailedLine2 = line2.getDetailRows().get("L22000");
    assertArrayEquals(new int[] { 1, 0, 0, 0, 0 }, detailedLine2.getCells());
    ReportRow<DetailedMonitorQueryItem> detailedLineNoAttachment2 = line2.getDetailRows().get("N/A");
    assertArrayEquals(new int[] { 1, 0, 0, 0, 0 }, detailedLineNoAttachment2.getCells());
    DetailedReportRow line3 = report.getRow("L30000");
    assertArrayEquals(new int[] { 2, 1, 0, 1, 1 }, line3.getCells());
    ReportRow<DetailedMonitorQueryItem> detailedLine3a = line3.getDetailRows().get("L33000");
    assertArrayEquals(new int[] { 0, 1, 0, 1, 1 }, detailedLine3a.getCells());
    ReportRow<DetailedMonitorQueryItem> detailedLineNoAttachment3 = line3.getDetailRows().get("N/A");
    assertArrayEquals(new int[] { 2, 0, 0, 0, 0 }, detailedLineNoAttachment3.getCells());
    DetailedReportRow line4 = report.getRow("L40000");
    assertArrayEquals(new int[] { 1, 0, 1, 0, 1 }, line4.getCells());
    ReportRow<DetailedMonitorQueryItem> detailedLineNoAttachment4 = line4.getDetailRows().get("N/A");
    assertArrayEquals(new int[] { 1, 0, 1, 0, 1 }, detailedLineNoAttachment4.getCells());
    DetailedReportRow line5 = report.getRow("L50000");
    assertArrayEquals(new int[] { 2, 2, 0, 0, 0 }, line5.getCells());
    ReportRow<DetailedMonitorQueryItem> detailedLineNoAttachment5 = line5.getDetailRows().get("N/A");
    assertArrayEquals(new int[] { 2, 2, 0, 0, 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

DetailedMonitorQueryItem (pro.taskana.impl.report.impl.DetailedMonitorQueryItem)11 DetailedClassificationReport (pro.taskana.impl.report.impl.DetailedClassificationReport)10 Test (org.junit.Test)9 DetailedReportRow (pro.taskana.impl.report.impl.DetailedReportRow)9 TimeIntervalColumnHeader (pro.taskana.impl.report.impl.TimeIntervalColumnHeader)9 TaskMonitorService (pro.taskana.TaskMonitorService)7 TaskanaEngineConfigurationTest (pro.taskana.impl.configuration.TaskanaEngineConfigurationTest)7 CustomField (pro.taskana.CustomField)3 TaskState (pro.taskana.TaskState)3 ArrayList (java.util.ArrayList)2