Search in sources :

Example 16 with TimeIntervalColumnHeader

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

the class GetTaskIdsOfCategoryReportAccTest method testGetTaskIdsOfCategoryReportWithCategoryFilter.

@Test
public void testGetTaskIdsOfCategoryReportWithCategoryFilter() throws InvalidArgumentException {
    TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
    List<String> categories = Arrays.asList("AUTOMATIC", "MANUAL");
    List<TimeIntervalColumnHeader> columnHeaders = getListOfColumnHeaders();
    List<SelectedItem> selectedItems = new ArrayList<>();
    SelectedItem s1 = new SelectedItem();
    s1.setKey("AUTOMATIC");
    s1.setLowerAgeLimit(Integer.MIN_VALUE);
    s1.setUpperAgeLimit(-11);
    selectedItems.add(s1);
    SelectedItem s2 = new SelectedItem();
    s2.setKey("MANUAL");
    s2.setLowerAgeLimit(0);
    s2.setUpperAgeLimit(0);
    selectedItems.add(s2);
    List<String> ids = taskMonitorService.getTaskIdsOfCategoryReportLineItems(null, null, categories, null, null, null, columnHeaders, selectedItems);
    assertEquals(3, ids.size());
    assertTrue(ids.contains("TKI:000000000000000000000000000000000006"));
    assertTrue(ids.contains("TKI:000000000000000000000000000000000031"));
    assertTrue(ids.contains("TKI:000000000000000000000000000000000032"));
}
Also used : TaskMonitorService(pro.taskana.TaskMonitorService) ArrayList(java.util.ArrayList) TimeIntervalColumnHeader(pro.taskana.impl.report.impl.TimeIntervalColumnHeader) SelectedItem(pro.taskana.impl.SelectedItem) Test(org.junit.Test) TaskanaEngineConfigurationTest(pro.taskana.impl.configuration.TaskanaEngineConfigurationTest)

Example 17 with TimeIntervalColumnHeader

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

the class GetTaskIdsOfCategoryReportAccTest method getListOfColumnHeaders.

private List<TimeIntervalColumnHeader> getListOfColumnHeaders() {
    List<TimeIntervalColumnHeader> columnHeaders = new ArrayList<>();
    columnHeaders.add(new TimeIntervalColumnHeader(Integer.MIN_VALUE, -11));
    columnHeaders.add(new TimeIntervalColumnHeader(-10, -6));
    columnHeaders.add(new TimeIntervalColumnHeader(-5, -2));
    columnHeaders.add(new TimeIntervalColumnHeader(-1));
    columnHeaders.add(new TimeIntervalColumnHeader(0));
    columnHeaders.add(new TimeIntervalColumnHeader(1));
    columnHeaders.add(new TimeIntervalColumnHeader(2, 5));
    columnHeaders.add(new TimeIntervalColumnHeader(6, 10));
    columnHeaders.add(new TimeIntervalColumnHeader(11, Integer.MAX_VALUE));
    return columnHeaders;
}
Also used : ArrayList(java.util.ArrayList) TimeIntervalColumnHeader(pro.taskana.impl.report.impl.TimeIntervalColumnHeader)

Example 18 with TimeIntervalColumnHeader

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

the class GetTaskIdsOfCategoryReportAccTest method testGetTaskIdsOfCategoryReportWithWorkbasketFilter.

@Test
public void testGetTaskIdsOfCategoryReportWithWorkbasketFilter() throws InvalidArgumentException {
    TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
    List<String> workbasketIds = Collections.singletonList("WBI:000000000000000000000000000000000001");
    List<TimeIntervalColumnHeader> columnHeaders = getListOfColumnHeaders();
    List<SelectedItem> selectedItems = new ArrayList<>();
    SelectedItem s1 = new SelectedItem();
    s1.setKey("EXTERN");
    s1.setLowerAgeLimit(-5);
    s1.setUpperAgeLimit(-2);
    selectedItems.add(s1);
    SelectedItem s2 = new SelectedItem();
    s2.setKey("AUTOMATIC");
    s2.setLowerAgeLimit(Integer.MIN_VALUE);
    s2.setUpperAgeLimit(-11);
    selectedItems.add(s2);
    SelectedItem s3 = new SelectedItem();
    s3.setKey("MANUAL");
    s3.setLowerAgeLimit(0);
    s3.setUpperAgeLimit(0);
    selectedItems.add(s3);
    List<String> ids = taskMonitorService.getTaskIdsOfCategoryReportLineItems(workbasketIds, null, null, null, null, null, columnHeaders, selectedItems);
    assertEquals(4, ids.size());
    assertTrue(ids.contains("TKI:000000000000000000000000000000000006"));
    assertTrue(ids.contains("TKI:000000000000000000000000000000000020"));
    assertTrue(ids.contains("TKI:000000000000000000000000000000000026"));
    assertTrue(ids.contains("TKI:000000000000000000000000000000000031"));
}
Also used : TaskMonitorService(pro.taskana.TaskMonitorService) ArrayList(java.util.ArrayList) TimeIntervalColumnHeader(pro.taskana.impl.report.impl.TimeIntervalColumnHeader) SelectedItem(pro.taskana.impl.SelectedItem) Test(org.junit.Test) TaskanaEngineConfigurationTest(pro.taskana.impl.configuration.TaskanaEngineConfigurationTest)

Example 19 with TimeIntervalColumnHeader

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

the class GetTaskIdsOfCategoryReportAccTest method testGetTaskIdsOfCategoryReportWithStateFilter.

@Test
public void testGetTaskIdsOfCategoryReportWithStateFilter() throws InvalidArgumentException {
    TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
    List<TaskState> states = Collections.singletonList(TaskState.READY);
    List<TimeIntervalColumnHeader> columnHeaders = getListOfColumnHeaders();
    List<SelectedItem> selectedItems = new ArrayList<>();
    SelectedItem s1 = new SelectedItem();
    s1.setKey("EXTERN");
    s1.setLowerAgeLimit(-5);
    s1.setUpperAgeLimit(-2);
    selectedItems.add(s1);
    SelectedItem s2 = new SelectedItem();
    s2.setKey("AUTOMATIC");
    s2.setLowerAgeLimit(Integer.MIN_VALUE);
    s2.setUpperAgeLimit(-11);
    selectedItems.add(s2);
    SelectedItem s3 = new SelectedItem();
    s3.setKey("MANUAL");
    s3.setLowerAgeLimit(0);
    s3.setUpperAgeLimit(0);
    selectedItems.add(s3);
    List<String> ids = taskMonitorService.getTaskIdsOfCategoryReportLineItems(null, states, null, null, null, null, columnHeaders, selectedItems);
    assertEquals(11, ids.size());
    assertTrue(ids.contains("TKI:000000000000000000000000000000000006"));
    assertTrue(ids.contains("TKI:000000000000000000000000000000000020"));
    assertTrue(ids.contains("TKI:000000000000000000000000000000000021"));
    assertTrue(ids.contains("TKI:000000000000000000000000000000000022"));
    assertTrue(ids.contains("TKI:000000000000000000000000000000000023"));
    assertTrue(ids.contains("TKI:000000000000000000000000000000000024"));
    assertTrue(ids.contains("TKI:000000000000000000000000000000000026"));
    assertTrue(ids.contains("TKI:000000000000000000000000000000000027"));
    assertTrue(ids.contains("TKI:000000000000000000000000000000000028"));
    assertTrue(ids.contains("TKI:000000000000000000000000000000000031"));
    assertTrue(ids.contains("TKI:000000000000000000000000000000000032"));
}
Also used : TaskMonitorService(pro.taskana.TaskMonitorService) ArrayList(java.util.ArrayList) TaskState(pro.taskana.TaskState) TimeIntervalColumnHeader(pro.taskana.impl.report.impl.TimeIntervalColumnHeader) SelectedItem(pro.taskana.impl.SelectedItem) Test(org.junit.Test) TaskanaEngineConfigurationTest(pro.taskana.impl.configuration.TaskanaEngineConfigurationTest)

Example 20 with TimeIntervalColumnHeader

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

the class ProvideClassificationReportAccTest method testEachItemOfClassificationReportWithCategoryFilter.

@Test
public void testEachItemOfClassificationReportWithCategoryFilter() throws InvalidArgumentException {
    TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
    List<String> categories = Arrays.asList("AUTOMATIC", "MANUAL");
    List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
    ClassificationReport report = taskMonitorService.getClassificationReport(null, null, categories, null, null, null, columnHeaders);
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug(reportToString(report, columnHeaders));
    }
    assertNotNull(report);
    assertEquals(2, report.rowSize());
    int[] row1 = report.getRow("L30000").getCells();
    assertArrayEquals(new int[] { 2, 1, 0, 1, 3 }, row1);
    int[] row2 = report.getRow("L40000").getCells();
    assertArrayEquals(new int[] { 2, 2, 2, 0, 4 }, row2);
}
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

TimeIntervalColumnHeader (pro.taskana.impl.report.impl.TimeIntervalColumnHeader)75 Test (org.junit.Test)57 TaskMonitorService (pro.taskana.TaskMonitorService)46 TaskanaEngineConfigurationTest (pro.taskana.impl.configuration.TaskanaEngineConfigurationTest)46 ArrayList (java.util.ArrayList)25 CustomField (pro.taskana.CustomField)19 DetailedMonitorQueryItem (pro.taskana.impl.report.impl.DetailedMonitorQueryItem)13 TaskState (pro.taskana.TaskState)12 DetailedClassificationReport (pro.taskana.impl.report.impl.DetailedClassificationReport)10 CategoryReport (pro.taskana.impl.report.impl.CategoryReport)9 ClassificationReport (pro.taskana.impl.report.impl.ClassificationReport)9 CustomFieldValueReport (pro.taskana.impl.report.impl.CustomFieldValueReport)9 WorkbasketLevelReport (pro.taskana.impl.report.impl.WorkbasketLevelReport)9 DetailedReportRow (pro.taskana.impl.report.impl.DetailedReportRow)8 SelectedItem (pro.taskana.impl.SelectedItem)6 AbstractAccTest (acceptance.AbstractAccTest)4 DaysToWorkingDaysConverter (pro.taskana.impl.DaysToWorkingDaysConverter)4 MonitorQueryItem (pro.taskana.impl.report.impl.MonitorQueryItem)4 WithAccessId (pro.taskana.security.WithAccessId)4 Task (pro.taskana.Task)3