505152535455565758
/** * run the test. */ @Test public void retrieveSubClassTest() { Person person = dao.retrieve(FOUR); Assert.assertNotNull(person.getAddress().getCity()); }
5960616263646566
/** * run the test. */ @Test public void retrieveEnumTest() { Person person = dao.retrieve(FOUR); Assert.assertEquals(person.getSex(), Sex.MALE); }
6768697071727374
/** * run the test. */ @Test public void retrieveEnumEmptyTest() { Person person = dao.retrieve(FOUR); Assert.assertNotNull(person.getSex()); }
767778798081828384
* run the test. */ @Test public void overrideTest() { Person person = getPerson(); person.setId(1L); Assert.assertTrue(dao.insert(person)); }
9293949596979899100101102
/** * run the test. */ @Test public void removeTest() { Person person = getPerson(); person.setId(1L); Assert.assertTrue(dao.insert(person)); Assert.assertTrue(dao.remove(person)); Assert.assertNull(dao.retrieve(1L)); }
103104105106107108109110
/** * run the test. */ @Test public void cantRetrieve() { Person person = dao.retrieve(new Long(-1)); Assert.assertNull(person); }
111112113114115116117118119120121
/** * run the test. */ @Test public void listTest() { Person person = getPerson(); person.setId(1L); dao.insert(person); Assert.assertTrue(dao.listAll().size() > 0); }
131132133134135136137138139140141142143
/** * run the test. */ @Test public void insertFileTest() { Person person = getPerson(); person.setName(NAME); person.setId(FOUR); Address address = getAddress(); person.setAddress(address); Assert.assertTrue(dao.insert(person)); }
175176177178179180181182183184
/** * run the test. */ @Test public void insertWithPerson() { Person person = getPerson(); person.setName(NAME); person.setId(SAMPLE_ID); Assert.assertTrue(dao.insert(person)); }
190191192193194195196197198199200
address.setState("Bahia"); return address; } private Person getPerson() { Person person = new Person(); person.setYear(TEN); person.setName(NAME); person.setSex(Sex.MALE); return person; }