|
svn commit: r488187 - /db/torque/test/trunk/test-project/src/java/org/apach: msg#00069jakarta.turbine.torque.devel
Author: tfischer Date: Mon Dec 18 02:03:49 2006 New Revision: 488187 URL: http://svn.apache.org/viewvc?view=rev&rev=488187 Log: improved the shutdown test case in the test project to see whether reinitialisation is possible. Modified: db/torque/test/trunk/test-project/src/java/org/apache/torque/DataTest.java Modified: db/torque/test/trunk/test-project/src/java/org/apache/torque/DataTest.java URL: http://svn.apache.org/viewvc/db/torque/test/trunk/test-project/src/java/org/apache/torque/DataTest.java?view=diff&rev=488187&r1=488186&r2=488187 ============================================================================== --- db/torque/test/trunk/test-project/src/java/org/apache/torque/DataTest.java (original) +++ db/torque/test/trunk/test-project/src/java/org/apache/torque/DataTest.java Mon Dec 18 02:03:49 2006 @@ -1777,12 +1777,36 @@ } /** - * Tests whether shutdown complains about anything - * @throws TorqueException if shutdown does not exit cleanly + * Tests whether shutdown works correctly and whether reinitialisation + * is possible after shutdown. + * @throws TorqueException if shutdown does not exit cleanly. */ - public void testShutdown() throws TorqueException + public void testShutdown() throws Exception { Torque.shutdown(); + + try + { + Torque.getDatabase(Torque.getDefaultDB()); + fail("database access should not be possible " + + "when Torque is shutdown()"); + } + catch (TorqueException e) + { + } + + Torque.init(System.getProperty(CONFIG_FILE_SYSTEM_PROPERTY)); + + cleanBookstore(); + Author author = new Author(); + author.setName("shutdownName"); + author.save(); + List authors = AuthorPeer.doSelect(new Criteria()); + assertEquals("List should contain one author", 1, authors.size()); + author = (Author) authors.get(0); + assertEquals("Author's name should be shutdownName", + "shutdownName", + author.getName()); } /** |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | [PATCH] Maven2 Plugin: 00069, Jeffrey D. Brekke |
|---|---|
| Next by Date: | [jira] Commented: (TORQUE-68) DatabaseMap remains empty if Torque is stopped and restarted, causes NPEs: 00069, Thomas Fischer (JIRA) |
| Previous by Thread: | [PATCH] Maven2 Plugini: 00069, Jeffrey D. Brekke |
| Next by Thread: | [jira] Commented: (TORQUE-68) DatabaseMap remains empty if Torque is stopped and restarted, causes NPEs: 00069, Thomas Fischer (JIRA) |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |