From: <id...@us...> - 2009-04-20 15:04:28
|
Revision: 127 http://cse-ip.svn.sourceforge.net/cse-ip/?rev=127&view=rev Author: idueppe Date: 2009-04-20 15:04:25 +0000 (Mon, 20 Apr 2009) Log Message: ----------- fixed tests Modified Paths: -------------- trunk/sandbox/cse-ip/sc-cdmm/src/test/java/de/campussource/cse/cdmm/AccountDaoTest.java Modified: trunk/sandbox/cse-ip/sc-cdmm/src/test/java/de/campussource/cse/cdmm/AccountDaoTest.java =================================================================== --- trunk/sandbox/cse-ip/sc-cdmm/src/test/java/de/campussource/cse/cdmm/AccountDaoTest.java 2009-04-20 15:03:04 UTC (rev 126) +++ trunk/sandbox/cse-ip/sc-cdmm/src/test/java/de/campussource/cse/cdmm/AccountDaoTest.java 2009-04-20 15:04:25 UTC (rev 127) @@ -23,61 +23,61 @@ autowireByType(dao); txBegin(); } -//FIXME fix broken tests -// @Test -// public void testPersistAccount() { -// try { -// dao.persist(account); -// } catch (DataModelManagerException e) { -// fail("Unexpected DataModelManagerException"); -// } -// assertNotNull(account.getId()); -// txCommit(); -// } -// -// -// @Test -// public void testFindAccount() { -// try { -// dao.persist(account); -// } catch (DataModelManagerException e) { -// fail("Unexpected DataModelManagerException"); -// } assertNotNull(account.getId()); -// commitAndBeginTx(); -// Account acid = null; -// try { -// acid = dao.find(account.getId()); -// } catch (DataModelManagerException e) { -// fail("Created account could not be found"); -// } -// assertEquals(account, acid); -// } -// -// @Test -// public void testRemoveAccount() { -// try { -// dao.persist(account); -// } catch (DataModelManagerException e) { -// fail("Unexpected DataModelManagerException"); -// } assertNotNull(account.getId()); -// commitAndBeginTx(); -// try { -// dao.remove(account); -// } catch (DataModelManagerException e) { -// fail("Unexpected DataModelMaangerException"); -// } -// commitAndBeginTx(); -// try { -// @SuppressWarnings("unused") -// Account retrievedAccount = dao.find(account.getId()); -// fail("Deleting of account failed"); -// } catch (DataModelManagerException e) { -// // Exception should occur; -// } -// -// } + + @Test + public void testPersistAccount() { + try { + dao.persist(account); + } catch (DataModelManagerException e) { + fail("Unexpected DataModelManagerException"); + } + assertNotNull(account.getId()); + txCommit(); + } + @Test + public void testFindAccount() { + try { + dao.persist(account); + } catch (DataModelManagerException e) { + fail("Unexpected DataModelManagerException"); + } assertNotNull(account.getId()); + commitAndBeginTx(); + Account acid = null; + try { + acid = dao.find(account.getId()); + } catch (DataModelManagerException e) { + fail("Created account could not be found"); + } + assertEquals(account, acid); + } + + @Test + public void testRemoveAccount() { + try { + dao.persist(account); + } catch (DataModelManagerException e) { + fail("Unexpected DataModelManagerException"); + } assertNotNull(account.getId()); + commitAndBeginTx(); + try { + dao.remove(account); + } catch (DataModelManagerException e) { + fail("Unexpected DataModelMaangerException"); + } + commitAndBeginTx(); + try { + @SuppressWarnings("unused") + Account retrievedAccount = dao.find(account.getId()); + fail("Deleting of account failed"); + } catch (DataModelManagerException e) { + // Exception should occur; + } + + } + + @Test public void testDoNotFindById() { Account foundAccount = null; try { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |