use of com.artezio.arttime.datamodel.WorkdaysCalendar in project ART-TIME by Artezio.
the class WorkdaysCalendarRepositoryTest method testUpdateWorkdaysCalendar.
@Test
public void testUpdateWorkdaysCalendar() {
WorkdaysCalendar workdaysCalendar = new WorkdaysCalendar("calendar");
entityManager.persist(workdaysCalendar);
String expected = "calendar new name";
workdaysCalendar.setName(expected);
workdaysCalendarRepository.update(workdaysCalendar, new ArrayList<Day>());
WorkdaysCalendar actual = entityManager.find(WorkdaysCalendar.class, workdaysCalendar.getId());
assertEquals(expected, actual.getName());
}
use of com.artezio.arttime.datamodel.WorkdaysCalendar in project ART-TIME by Artezio.
the class WorkdaysCalendarRepositoryTest method testCreateDays.
@Test
public void testCreateDays() {
Date date1 = new GregorianCalendar(2011, 1, 3).getTime();
Date date2 = new GregorianCalendar(2011, 1, 0).getTime();
List<Date> dates = Arrays.asList(date1, date2);
WorkdaysCalendar workdaysCalendar = new WorkdaysCalendar("calendar");
List<Day> actuals = workdaysCalendarRepository.createDays(dates, workdaysCalendar);
assertEquals(2, actuals.size());
Day actual = actuals.get(0);
assertEquals(date1, actual.getDate());
assertEquals(workdaysCalendar.getName(), actual.getWorkdaysCalendar().getName());
}
use of com.artezio.arttime.datamodel.WorkdaysCalendar in project ART-TIME by Artezio.
the class ProjectBeanTest method testAddNewTeamMember.
@Test
public void testAddNewTeamMember() throws NoSuchFieldException {
Project project = new Project();
Employee employee = new Employee("employee");
WorkdaysCalendar calendar = new WorkdaysCalendar();
employee.setCalendar(calendar);
Map<Employee, Project[]> participations = new HashMap<>();
setField(bean, "participations", participations);
setField(bean, "project", project);
setField(bean, "employee", employee);
bean.addNewTeamMember();
assertEquals(1, participations.size());
assertEquals(1, participations.get(employee).length);
assertSame(project, participations.get(employee)[0]);
assertTrue(participations.containsKey(employee));
assertNull(bean.getEmployee());
}
use of com.artezio.arttime.datamodel.WorkdaysCalendar in project ART-TIME by Artezio.
the class DepartmentServiceRbacIntegrationTest method setUp.
@Before
public void setUp() throws Exception {
workdaysCalendar = new WorkdaysCalendar("Calendar");
runInNewTx.run(() -> {
entityManager.joinTransaction();
entityManager.persist(workdaysCalendar);
});
}
use of com.artezio.arttime.datamodel.WorkdaysCalendar in project ART-TIME by Artezio.
the class EmployeeServiceRbacIntegrationTest method setUp.
@Before
public void setUp() throws Exception {
workdaysCalendar = new WorkdaysCalendar("Calendar");
employee = new Employee("uname", "fname", "lname", "email", "department1");
employee.setCalendar(workdaysCalendar);
runInNewTx.run(() -> {
entityManager.joinTransaction();
entityManager.persist(workdaysCalendar);
entityManager.persist(employee);
});
}
Aggregations