use of com.artezio.arttime.report.repositories.SampleDataRepository in project ART-TIME by Artezio.
the class HourTypeDataSetTest method testOpen.
@Test
public void testOpen() throws IllegalAccessException {
Map<String, Object> parameters = new HashMap<>();
parameters.put(REPORT_PARAM_NAME_HOUR_TYPE_IDS, new Long[] { 1L, 3L });
dataSet.open(null, parameters);
Iterator<HourType> actual = (Iterator) FieldUtils.readField(dataSet, "dataIterator", true);
List<HourType> hourTypes = new SampleDataRepository().getHourTypes();
List<HourType> expected = Arrays.asList(hourTypes.get(0), hourTypes.get(2));
ListAssert.assertEquals(expected, IteratorUtils.toList(actual));
}
use of com.artezio.arttime.report.repositories.SampleDataRepository in project ART-TIME by Artezio.
the class ProjectDataSetTest method testOpen.
@Test
public void testOpen() throws IllegalAccessException {
Map<String, Object> parameters = new HashMap<>();
parameters.put(REPORT_PARAM_NAME_PROJECT_IDS, new Long[] { 2L, 3L });
dataSet.open(null, parameters);
Iterator<Project> actual = (Iterator) FieldUtils.readField(dataSet, "dataIterator", true);
List<Project> projecs = new SampleDataRepository().getProjects();
List<Project> expected = projecs.subList(1, 3);
ListAssert.assertEquals(expected, IteratorUtils.toList(actual));
}
use of com.artezio.arttime.report.repositories.SampleDataRepository in project ART-TIME by Artezio.
the class HoursDataSetTest method testOpen.
@Test
public void testOpen() throws IllegalAccessException {
Map<String, Object> parameters = new HashMap<>();
parameters.put(REPORT_PARAM_NAME_START_DATE, new GregorianCalendar(2018, 2, 4).getTime());
parameters.put(REPORT_PARAM_NAME_END_DATE, new GregorianCalendar(2018, 2, 5).getTime());
parameters.put(REPORT_PARAM_NAME_PROJECT_IDS, new Long[] { 2L, 3L });
parameters.put(REPORT_PARAM_NAME_DEPARTMENTS, new String[] { "Minsk", "Moscow" });
parameters.put(REPORT_PARAM_NAME_EMPLOYEE_USERNAMES, new String[] { "user2", "user3" });
parameters.put(REPORT_PARAM_NAME_HOUR_TYPE_IDS, new Long[] { 1L, 2L, 3L });
dataSet.open(null, parameters);
Iterator<Hours> actual = (Iterator) FieldUtils.readField(dataSet, "dataIterator", true);
List<Hours> hours = new SampleDataRepository().getHours();
List<Hours> expected = hours.subList(1, 3);
ListAssert.assertEquals(expected, IteratorUtils.toList(actual));
}
Aggregations