@SuppressWarnings("unused")
public void testGetAll() throws Exception {
DatabaseOperation.DELETE_ALL.execute(this.connection,
this.issuedFormDataSet);
Date date = EsimsUtils.createDate(2, Calendar.MARCH, 1980);
IssuedApplicationForm applicationForm1 = new IssuedApplicationForm(
"form2", new Date(), "buyerfn", "buyerln", "appfn", "appln",
date);
issuedApplicationFormDAO.save(applicationForm1);
IssuedApplicationForm applicationForm2 = new IssuedApplicationForm(
"form1", new Date(), "buyerfn", "buyerln", "appfn", "appln",
date);
issuedApplicationFormDAO.save(applicationForm2);
List<IssuedApplicationForm> listOfIssuedForms = issuedApplicationFormDAO
.getAll();
assertEquals(2, listOfIssuedForms.size());
List<IssuedApplicationForm> listOfIssuedForms2 = issuedApplicationFormDAO
.getAll("formNumber");
assertEquals(2, listOfIssuedForms.size());
IssuedApplicationForm applicationForm3 = new IssuedApplicationForm(
"newform1", new Date(), "buyerfn", "buyerln", "appfn", "appln",
date);
issuedApplicationFormDAO.save(applicationForm3);
List<IssuedApplicationForm> listOfIssuedForms3 = issuedApplicationFormDAO
.getByFormNumber("newform1");
assertEquals(1, listOfIssuedForms3.size());
assertEquals("newform1", listOfIssuedForms3.get(0).getFormNumber());
Long tempId = listOfIssuedForms3.get(0).getId();
IssuedApplicationForm form = issuedApplicationFormDAO.get(tempId);
assertNotNull(form);
assertEquals("newform1", form.getFormNumber());
// this should return null
IssuedApplicationForm form1 = issuedApplicationFormDAO.get(new Long(
234442222));
assertNull(form1);
DatabaseOperation.DELETE_ALL.execute(this.connection,
this.issuedFormDataSet);