@Override protected void setUp() throws Exception { gen = new TestDataGenerator(); gen.clearAllTables(); gen.patient1(); gen.patient2(); }
public void testRemoveAllRepresented() throws Exception { // 2 represents 1, but not 4 gen.patient1(); gen.patient4(); // Add patient 4 to be represented by patient 2 patientDAO.addRepresentative(2L, 4L); // Ensure the representatives were added correctly assertEquals(2, patientDAO.getRepresented(2L).size()); // Remove all patient's from being represented by patient 2 patientDAO.removeAllRepresented(2L); // Assert that no more patients are represented by patient 2 assertTrue(patientDAO.getRepresented(2L).isEmpty()); // Test with an evil factory patientDAO = new PatientDAO(EvilDAOFactory.getEvilInstance()); try { patientDAO.removeAllRepresented(2L); fail("Exception should be caught"); } catch (DBException e) { // Successful test } }
@Override protected void setUp() throws Exception { gen.clearAllTables(); gen.hospitals(); gen.hcp0(); gen.patient1(); gen.admin1(); gen.officeVisit1(); gen.ndCodes(); action = new EditOfficeVisitAction(factory, 9000000001L, "1", "1"); }