@Test @Ignore public void testInsert() throws Exception { Patient patient = entityManager.find(Patient.class, 3); appointment = new Appointment(entityManager) .setStart(new DateTime(Calculate.getCal(2013, 02, 18, 8, 48, 48))) .setEnd(new DateTime(FormatText.USER_DATETIME.parse("02/18/2013 10:48:48"))); patient.addAppointment(appointment); }
@Test public void testActiveOn() throws Exception { Appointment app = new Appointment(null) .setStart(new DateTime(Calculate.getCal(2013, 02, 18, 8, 48, 48))) .setEnd(new DateTime(FormatText.USER_DATETIME.parse("02/18/2013 10:48:48"))); assertTrue(app.isActiveOnDay(Calculate.getCal(2013, 02, 18).getTime())); assertFalse(app.isActiveOnDay(Calculate.getCal(2013, 02, 19).getTime())); assertFalse(app.isActiveOnDay(Calculate.getCal(2013, 02, 17).getTime())); app.setEnd(new DateTime(FormatText.USER_DATETIME.parse("02/19/2013 08:48:48"))); assertTrue(app.isActiveOnDay(Calculate.getCal(2013, 02, 18).getTime())); assertTrue(app.isActiveOnDay(Calculate.getCal(2013, 02, 19).getTime())); assertFalse(app.isActiveOnDay(Calculate.getCal(2013, 02, 17).getTime())); assertFalse(app.isActiveOnDay(Calculate.getCal(2013, 02, 20).getTime())); }
public static boolean isNull(Object... keys) { for (Object k : keys) if (Calculate.isNull(k)) return true; return false; }
public static boolean isSame(Object o, Object o2) { return Calculate.isSame(o, o2); }