use of pro.taskana.CustomField in project taskana by Taskana.
the class ProvideCustomFieldValueReportAccTest method testEachItemOfCustomFieldValueReportWithStateFilter.
@Test
public void testEachItemOfCustomFieldValueReportWithStateFilter() throws InvalidArgumentException {
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
List<TaskState> states = Collections.singletonList(TaskState.READY);
CustomField customField = CustomField.CUSTOM_1;
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
CustomFieldValueReport report = taskMonitorService.getCustomFieldValueReport(null, states, null, null, 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[] { 11, 4, 3, 4, 0 }, row1);
int[] row2 = report.getRow("Geschaeftsstelle B").getCells();
assertArrayEquals(new int[] { 5, 3, 0, 2, 0 }, row2);
int[] row3 = report.getRow("Geschaeftsstelle C").getCells();
assertArrayEquals(new int[] { 3, 4, 1, 1, 0 }, row3);
}
use of pro.taskana.CustomField in project taskana by Taskana.
the class ProvideCustomFieldValueReportAccTest method testEachItemOfCustomFieldValueReport.
@Test
public void testEachItemOfCustomFieldValueReport() throws InvalidArgumentException {
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
CustomField customField = CustomField.CUSTOM_1;
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
CustomFieldValueReport report = taskMonitorService.getCustomFieldValueReport(null, null, null, null, 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[] { 11, 4, 3, 4, 3 }, row1);
int[] row2 = report.getRow("Geschaeftsstelle B").getCells();
assertArrayEquals(new int[] { 5, 3, 0, 2, 0 }, row2);
int[] row3 = report.getRow("Geschaeftsstelle C").getCells();
assertArrayEquals(new int[] { 3, 4, 1, 1, 6 }, row3);
}
use of pro.taskana.CustomField in project taskana by Taskana.
the class ProvideCustomFieldValueReportAccTest method testEachItemOfCustomFieldValueReportNotInWorkingDays.
@Test
public void testEachItemOfCustomFieldValueReportNotInWorkingDays() throws InvalidArgumentException {
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
CustomField customField = CustomField.CUSTOM_1;
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
CustomFieldValueReport report = taskMonitorService.getCustomFieldValueReport(null, null, null, null, customField, null, columnHeaders, false);
if (LOGGER.isDebugEnabled()) {
LOGGER.debug(reportToString(report, columnHeaders));
}
assertNotNull(report);
assertEquals(3, report.rowSize());
int[] row1 = report.getRow("Geschaeftsstelle A").getCells();
assertArrayEquals(new int[] { 15, 0, 3, 0, 7 }, row1);
int[] row2 = report.getRow("Geschaeftsstelle B").getCells();
assertArrayEquals(new int[] { 8, 0, 0, 0, 2 }, row2);
int[] row3 = report.getRow("Geschaeftsstelle C").getCells();
assertArrayEquals(new int[] { 7, 0, 1, 0, 7 }, row3);
}
use of pro.taskana.CustomField in project taskana by Taskana.
the class GetTaskIdsOfCategoryReportAccTest method testGetTaskIdsOfCategoryReportWithCustomFieldValueFilter.
@Test
public void testGetTaskIdsOfCategoryReportWithCustomFieldValueFilter() throws InvalidArgumentException {
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
CustomField customField = CustomField.CUSTOM_1;
List<String> customFieldValues = Collections.singletonList("Geschaeftsstelle A");
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, null, null, null, customField, customFieldValues, columnHeaders, selectedItems);
assertEquals(5, ids.size());
assertTrue(ids.contains("TKI:000000000000000000000000000000000020"));
assertTrue(ids.contains("TKI:000000000000000000000000000000000024"));
assertTrue(ids.contains("TKI:000000000000000000000000000000000027"));
assertTrue(ids.contains("TKI:000000000000000000000000000000000031"));
assertTrue(ids.contains("TKI:000000000000000000000000000000000032"));
}
use of pro.taskana.CustomField in project taskana by Taskana.
the class ProvideClassificationReportAccTest method testEachItemOfClassificationReportWithCustomFieldValueFilter.
@Test
public void testEachItemOfClassificationReportWithCustomFieldValueFilter() throws InvalidArgumentException {
TaskMonitorService taskMonitorService = taskanaEngine.getTaskMonitorService();
CustomField customField = CustomField.CUSTOM_1;
List<String> customFieldValues = Collections.singletonList("Geschaeftsstelle A");
List<TimeIntervalColumnHeader> columnHeaders = getShortListOfColumnHeaders();
ClassificationReport report = taskMonitorService.getClassificationReport(null, null, null, null, customField, customFieldValues, columnHeaders);
if (LOGGER.isDebugEnabled()) {
LOGGER.debug(reportToString(report, columnHeaders));
}
assertNotNull(report);
assertEquals(5, report.rowSize());
int[] row1 = report.getRow("L10000").getCells();
assertArrayEquals(new int[] { 4, 0, 0, 0, 0 }, row1);
int[] row2 = report.getRow("L20000").getCells();
assertArrayEquals(new int[] { 4, 1, 1, 1, 0 }, row2);
int[] row3 = report.getRow("L30000").getCells();
assertArrayEquals(new int[] { 1, 0, 0, 1, 1 }, row3);
int[] row4 = report.getRow("L40000").getCells();
assertArrayEquals(new int[] { 1, 1, 2, 0, 2 }, row4);
int[] row5 = report.getRow("L50000").getCells();
assertArrayEquals(new int[] { 1, 2, 0, 2, 0 }, row5);
}
Aggregations