Author: tchemit Date: 2009-02-12 11:24:15 +0000 (Thu, 12 Feb 2009) New Revision: 1367 Modified: topia/trunk/topia-persistence/src/test/java/org/codelutin/topia/generator/TopiaTestCase.java Log: destroy db after test Modified: topia/trunk/topia-persistence/src/test/java/org/codelutin/topia/generator/TopiaTestCase.java =================================================================== --- topia/trunk/topia-persistence/src/test/java/org/codelutin/topia/generator/TopiaTestCase.java 2009-02-12 11:17:11 UTC (rev 1366) +++ topia/trunk/topia-persistence/src/test/java/org/codelutin/topia/generator/TopiaTestCase.java 2009-02-12 11:24:15 UTC (rev 1367) @@ -31,6 +31,7 @@ import org.codelutin.topiatest.Department; import org.codelutin.topiatest.DepartmentDAO; import org.hibernate.cfg.Environment; +import org.junit.AfterClass; import org.junit.Assert; import org.junit.Before; import org.junit.BeforeClass; @@ -54,7 +55,7 @@ protected static Properties config = null; /** TopiaContext */ - protected TopiaContext context = null; + protected static TopiaContext context = null; /** * Init les proprietes de connection a la base @@ -69,9 +70,15 @@ config.setProperty(Environment.CURRENT_SESSION_CONTEXT_CLASS, "thread"); config.setProperty(Environment.DIALECT,"org.hibernate.dialect.H2Dialect"); config.setProperty(Environment.DRIVER,"org.h2.Driver"); - config.setProperty(Environment.URL, "jdbc:h2:file:/tmp/" + TopiaTestCase.class + "/db/data_" + System.currentTimeMillis()); + config.setProperty(Environment.URL, "jdbc:h2:file:/tmp/" + TopiaTestCase.class.getSimpleName() + "/db/data_" + System.currentTimeMillis()); } + @AfterClass + public static void after() throws TopiaException { + // destroy database + context.clear(true); + } + /** * Create base with schema created. */
participants (1)
-
tchemit@users.labs.libre-entreprise.org