[prev in list] [next in list] [prev in thread] [next in thread]
List: turbine-torque-dev
Subject: svn commit: r488187 -
From: tfischer () apache ! org
Date: 2006-12-18 10:03:50
Message-ID: 20061218100350.BF8A41A981A () eris ! apache ! org
[Download RAW message or body]
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: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic