Search in sources :

Example 1 with CustomField

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

the class ProvideCustomFieldValueReportAccTest method testGetTotalNumbersOfTasksOfCustomFieldValueReportForCustom2.

@Test
public void testGetTotalNumbersOfTasksOfCustomFieldValueReportForCustom2() throws InvalidArgumentException {
    TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
    CustomField customField = CustomField.CUSTOM_2;
    CustomFieldValueReport report = taskMonitorService.getCustomFieldValueReport(null, null, null, null, customField, null);
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug(reportToString(report));
    }
    assertNotNull(report);
    assertEquals(2, report.rowSize());
    assertEquals(21, report.getRow("Vollkasko").getTotalValue());
    assertEquals(29, report.getRow("Teilkasko").getTotalValue());
    assertEquals(0, report.getRow("Vollkasko").getCells().length);
    assertEquals(0, report.getRow("Teilkasko").getCells().length);
    assertEquals(50, report.getSumRow().getTotalValue());
}
Also used : TaskMonitorService(pro.taskana.TaskMonitorService) CustomFieldValueReport(pro.taskana.impl.report.impl.CustomFieldValueReport) CustomField(pro.taskana.CustomField) TaskanaEngineConfigurationTest(pro.taskana.impl.configuration.TaskanaEngineConfigurationTest) Test(org.junit.Test)

Example 2 with CustomField

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

the class ProvideCustomFieldValueReportAccTest method testEachItemOfCustomFieldValueReportWithCustomFieldValueFilter.

@Test
public void testEachItemOfCustomFieldValueReportWithCustomFieldValueFilter() throws InvalidArgumentException {
    TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
    CustomField customField = CustomField.CUSTOM_1;
    List<String> customFieldValues = Collections.singletonList("Geschaeftsstelle A");
    List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
    CustomFieldValueReport report = taskMonitorService.getCustomFieldValueReport(null, null, null, null, customField, customFieldValues, columnHeaders);
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug(reportToString(report, columnHeaders));
    }
    assertNotNull(report);
    assertEquals(1, report.rowSize());
    int[] row1 = report.getRow("Geschaeftsstelle A").getCells();
    assertArrayEquals(new int[] { 11, 4, 3, 4, 3 }, row1);
}
Also used : TaskMonitorService(pro.taskana.TaskMonitorService) CustomFieldValueReport(pro.taskana.impl.report.impl.CustomFieldValueReport) CustomField(pro.taskana.CustomField) TimeIntervalColumnHeader(pro.taskana.impl.report.impl.TimeIntervalColumnHeader) TaskanaEngineConfigurationTest(pro.taskana.impl.configuration.TaskanaEngineConfigurationTest) Test(org.junit.Test)

Example 3 with CustomField

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

the class ProvideCustomFieldValueReportAccTest method testGetTotalNumbersOfTasksOfCustomFieldValueReportForCustom1.

@Test
public void testGetTotalNumbersOfTasksOfCustomFieldValueReportForCustom1() throws InvalidArgumentException {
    TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
    CustomField customField = CustomField.CUSTOM_1;
    CustomFieldValueReport report = taskMonitorService.getCustomFieldValueReport(null, null, null, null, customField, null);
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug(reportToString(report));
    }
    assertNotNull(report);
    assertEquals(3, report.rowSize());
    assertEquals(25, report.getRow("Geschaeftsstelle A").getTotalValue());
    assertEquals(10, report.getRow("Geschaeftsstelle B").getTotalValue());
    assertEquals(15, report.getRow("Geschaeftsstelle C").getTotalValue());
    assertEquals(0, report.getRow("Geschaeftsstelle A").getCells().length);
    assertEquals(0, report.getRow("Geschaeftsstelle B").getCells().length);
    assertEquals(0, report.getRow("Geschaeftsstelle C").getCells().length);
    assertEquals(50, report.getSumRow().getTotalValue());
}
Also used : TaskMonitorService(pro.taskana.TaskMonitorService) CustomFieldValueReport(pro.taskana.impl.report.impl.CustomFieldValueReport) CustomField(pro.taskana.CustomField) TaskanaEngineConfigurationTest(pro.taskana.impl.configuration.TaskanaEngineConfigurationTest) Test(org.junit.Test)

Example 4 with CustomField

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

the class ProvideCustomFieldValueReportAccTest method testEachItemOfCustomFieldValueReportWithDomainFilter.

@Test
public void testEachItemOfCustomFieldValueReportWithDomainFilter() throws InvalidArgumentException {
    TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
    List<String> domains = Collections.singletonList("DOMAIN_A");
    CustomField customField = CustomField.CUSTOM_1;
    List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
    CustomFieldValueReport report = taskMonitorService.getCustomFieldValueReport(null, null, null, domains, customField, null, columnHeaders);
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug(reportToString(report, columnHeaders));
    }
    assertNotNull(report);
    assertEquals(3, report.rowSize());
    int[] row1 = report.getRow("Geschaeftsstelle A").getCells();
    assertArrayEquals(new int[] { 8, 1, 1, 4, 1 }, row1);
    int[] row2 = report.getRow("Geschaeftsstelle B").getCells();
    assertArrayEquals(new int[] { 2, 2, 0, 1, 0 }, row2);
    int[] row3 = report.getRow("Geschaeftsstelle C").getCells();
    assertArrayEquals(new int[] { 1, 1, 1, 0, 3 }, row3);
}
Also used : TaskMonitorService(pro.taskana.TaskMonitorService) CustomFieldValueReport(pro.taskana.impl.report.impl.CustomFieldValueReport) CustomField(pro.taskana.CustomField) TimeIntervalColumnHeader(pro.taskana.impl.report.impl.TimeIntervalColumnHeader) TaskanaEngineConfigurationTest(pro.taskana.impl.configuration.TaskanaEngineConfigurationTest) Test(org.junit.Test)

Example 5 with CustomField

use of pro.taskana.CustomField 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)

Aggregations

Test (org.junit.Test)26 CustomField (pro.taskana.CustomField)26 TimeIntervalColumnHeader (pro.taskana.impl.report.impl.TimeIntervalColumnHeader)19 TaskMonitorService (pro.taskana.TaskMonitorService)15 TaskanaEngineConfigurationTest (pro.taskana.impl.configuration.TaskanaEngineConfigurationTest)15 TaskState (pro.taskana.TaskState)12 CustomFieldValueReport (pro.taskana.impl.report.impl.CustomFieldValueReport)12 ArrayList (java.util.ArrayList)11 DetailedMonitorQueryItem (pro.taskana.impl.report.impl.DetailedMonitorQueryItem)11 MonitorQueryItem (pro.taskana.impl.report.impl.MonitorQueryItem)8 DetailedClassificationReport (pro.taskana.impl.report.impl.DetailedClassificationReport)5 CategoryReport (pro.taskana.impl.report.impl.CategoryReport)3 ClassificationReport (pro.taskana.impl.report.impl.ClassificationReport)3 DetailedReportRow (pro.taskana.impl.report.impl.DetailedReportRow)3 WorkbasketLevelReport (pro.taskana.impl.report.impl.WorkbasketLevelReport)3 SelectedItem (pro.taskana.impl.SelectedItem)1