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());
     }
 
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to