From: Simon Brandhof Date: Thu, 6 Nov 2014 17:50:48 +0000 (+0100) Subject: Speed-up db tests X-Git-Tag: 5.0-RC1~350 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9c9df89f55d17bf6fa353b1d5cb4cd394402b40a;p=sonarqube.git Speed-up db tests --- diff --git a/sonar-core/src/test/java/org/sonar/core/persistence/AbstractDaoTestCase.java b/sonar-core/src/test/java/org/sonar/core/persistence/AbstractDaoTestCase.java index e9689e311d1..f4a45af0681 100644 --- a/sonar-core/src/test/java/org/sonar/core/persistence/AbstractDaoTestCase.java +++ b/sonar-core/src/test/java/org/sonar/core/persistence/AbstractDaoTestCase.java @@ -68,7 +68,7 @@ public abstract class AbstractDaoTestCase { private static final Logger LOG = LoggerFactory.getLogger(AbstractDaoTestCase.class); private static Database database; private static DatabaseCommands databaseCommands; - private MyBatis myBatis; + private static MyBatis myBatis; private IDatabaseTester databaseTester; @@ -91,6 +91,9 @@ public abstract class AbstractDaoTestCase { database.start(); LOG.info("Test Database: " + database); databaseCommands = DatabaseCommands.forDialect(database.getDialect()); + + myBatis = new MyBatis(database, new Logback(), new NullQueue()); + myBatis.start(); } } @@ -98,8 +101,6 @@ public abstract class AbstractDaoTestCase { public void startDbUnit() throws Exception { databaseCommands.truncateDatabase(database.getDataSource()); databaseTester = new DataSourceDatabaseTester(database.getDataSource()); - myBatis = new MyBatis(database, new Logback(), new NullQueue()); - myBatis.start(); } /**