diff --git a/src/main/java/io/ebean/config/ServerConfig.java b/src/main/java/io/ebean/config/ServerConfig.java index 04f3e0810..4861f45be 100644 --- a/src/main/java/io/ebean/config/ServerConfig.java +++ b/src/main/java/io/ebean/config/ServerConfig.java @@ -80,12 +80,6 @@ public class ServerConfig { */ private String name = "db"; - /** - * When false (default) H2 automatically uses DDL generate and run - * (i.e. assumes we are running tests using in memory h2). - */ - private boolean h2ProductionMode; - /** * Typically configuration type objects that are passed by this ServerConfig * to plugins. For example - IgniteConfiguration passed to Ignite plugin. @@ -527,27 +521,6 @@ public class ServerConfig { this.name = name; } - /** - * Return true if H2 should be used in production mode. - *

- * Otherwise it is assumed we are using H2 for testing and DDL generate and run is turned on. - *

- */ - public boolean isH2ProductionMode() { - return h2ProductionMode; - } - - /** - * Set to true for H2 to be used in production mode. - *

- * Do this when we want to use H2 and not have the DDL generation and run automatically turned on. - * Otherwise it is assumed we are using H2 for testing purposes. - *

- */ - public void setH2ProductionMode(boolean h2ProductionMode) { - this.h2ProductionMode = h2ProductionMode; - } - /** * Return the container / clustering configuration. *

@@ -1567,11 +1540,6 @@ public class ServerConfig { */ public void setDatabasePlatform(DatabasePlatform databasePlatform) { this.databasePlatform = databasePlatform; - if (!h2ProductionMode && databasePlatform != null && databasePlatform.isPlatform(Platform.H2)) { - // we are using H2 to run tests so turn on DDL generation and run - this.ddlGenerate = true; - this.ddlRun = true; - } } /** @@ -2610,7 +2578,6 @@ public class ServerConfig { jsonDateTime = JsonConfig.DateTime.MILLIS; } - h2ProductionMode = p.getBoolean("h2ProductionMode", h2ProductionMode); ddlGenerate = p.getBoolean("ddl.generate", ddlGenerate); ddlRun = p.getBoolean("ddl.run", ddlRun); ddlCreateOnly = p.getBoolean("ddl.createOnly", ddlCreateOnly); diff --git a/src/test/java/io/ebean/EbeanServerFactory_ServerConfigStart_Test.java b/src/test/java/io/ebean/EbeanServerFactory_ServerConfigStart_Test.java index 369f01cdd..b3fcc028d 100644 --- a/src/test/java/io/ebean/EbeanServerFactory_ServerConfigStart_Test.java +++ b/src/test/java/io/ebean/EbeanServerFactory_ServerConfigStart_Test.java @@ -20,7 +20,6 @@ public class EbeanServerFactory_ServerConfigStart_Test { config.setName("h2"); config.loadFromProperties(); config.setName("h2other"); - config.setH2ProductionMode(true); config.setDdlGenerate(false); config.setDdlRun(false); config.setDefaultServer(false); diff --git a/src/test/java/io/ebean/config/ServerConfigTest.java b/src/test/java/io/ebean/config/ServerConfigTest.java index 2e7c34122..e16fd2a9d 100644 --- a/src/test/java/io/ebean/config/ServerConfigTest.java +++ b/src/test/java/io/ebean/config/ServerConfigTest.java @@ -34,12 +34,10 @@ public class ServerConfigTest { props.setProperty("jdbcFetchSizeFindList", "43"); props.setProperty("backgroundExecutorShutdownSecs", "98"); props.setProperty("backgroundExecutorSchedulePoolSize", "4"); - props.setProperty("h2ProductionMode", "true"); props.setProperty("dbOffline", "true"); serverConfig.loadFromProperties(props); - assertTrue(serverConfig.isH2ProductionMode()); assertTrue(serverConfig.isDbOffline()); assertEquals(PersistBatch.INSERT, serverConfig.getPersistBatch()); assertEquals(PersistBatch.INSERT, serverConfig.getPersistBatchOnCascade()); diff --git a/src/test/java/io/ebean/dbmigration/model/build/ModelBuild_compoundKeyTest.java b/src/test/java/io/ebean/dbmigration/model/build/ModelBuild_compoundKeyTest.java index 5cd97130b..c4e09ae93 100644 --- a/src/test/java/io/ebean/dbmigration/model/build/ModelBuild_compoundKeyTest.java +++ b/src/test/java/io/ebean/dbmigration/model/build/ModelBuild_compoundKeyTest.java @@ -31,7 +31,6 @@ public class ModelBuild_compoundKeyTest extends BaseTestCase { config.setName("h2"); config.loadFromProperties(); config.setName("h2other"); - config.setH2ProductionMode(true); config.setDdlGenerate(false); config.setDdlRun(false); config.setDefaultServer(false); diff --git a/src/test/java/io/ebean/dbmigration/model/build/ModelBuild_explicitSequencesTest.java b/src/test/java/io/ebean/dbmigration/model/build/ModelBuild_explicitSequencesTest.java index c3833feec..1ba5bdc24 100644 --- a/src/test/java/io/ebean/dbmigration/model/build/ModelBuild_explicitSequencesTest.java +++ b/src/test/java/io/ebean/dbmigration/model/build/ModelBuild_explicitSequencesTest.java @@ -25,7 +25,6 @@ public class ModelBuild_explicitSequencesTest extends BaseTestCase { config.setName("h2"); config.loadFromProperties(); config.setName("h2other"); - config.setH2ProductionMode(true); config.setDdlGenerate(false); config.setDdlRun(false); config.setDefaultServer(false); diff --git a/src/test/java/io/ebean/event/BeanPersistControllerTest.java b/src/test/java/io/ebean/event/BeanPersistControllerTest.java index 6af5decc2..03f7a1170 100644 --- a/src/test/java/io/ebean/event/BeanPersistControllerTest.java +++ b/src/test/java/io/ebean/event/BeanPersistControllerTest.java @@ -73,7 +73,6 @@ public class BeanPersistControllerTest { ServerConfig config = new ServerConfig(); config.setName("h2ebasicver"); - config.setH2ProductionMode(true); config.loadFromProperties(); config.setDdlGenerate(true); config.setDdlRun(true); diff --git a/src/test/java/io/ebean/event/BeanPostLoadTest.java b/src/test/java/io/ebean/event/BeanPostLoadTest.java index 6ce0039af..7079a9d10 100644 --- a/src/test/java/io/ebean/event/BeanPostLoadTest.java +++ b/src/test/java/io/ebean/event/BeanPostLoadTest.java @@ -52,7 +52,6 @@ public class BeanPostLoadTest extends BaseTestCase { config.setName("h2ebasicver"); config.loadFromProperties(); - config.setH2ProductionMode(true); config.setDdlGenerate(true); config.setDdlRun(true); diff --git a/src/test/java/org/tests/transaction/TestAutoCommitDataSource.java b/src/test/java/org/tests/transaction/TestAutoCommitDataSource.java index a7a82c943..2193b4318 100644 --- a/src/test/java/org/tests/transaction/TestAutoCommitDataSource.java +++ b/src/test/java/org/tests/transaction/TestAutoCommitDataSource.java @@ -43,7 +43,6 @@ public class TestAutoCommitDataSource extends BaseTestCase { ServerConfig config = new ServerConfig(); config.setName("h2autocommit"); - config.setH2ProductionMode(true); config.loadFromProperties(); config.setDataSource(pool); config.setDefaultServer(false); diff --git a/src/test/resources/ebean.properties b/src/test/resources/ebean.properties index d31a62e7b..be3382d9d 100644 --- a/src/test/resources/ebean.properties +++ b/src/test/resources/ebean.properties @@ -119,5 +119,6 @@ datasource.pg.username=unit datasource.pg.password=unit datasource.pg.databaseUrl=jdbc:postgresql://127.0.0.1:5432/unit datasource.pg.databaseDriver=org.postgresql.Driver - +datasource.pg.capturestacktrace=true +datasource.pg.maxStackTraceSize=50 diff --git a/src/test/resources/logback-test.xml b/src/test/resources/logback-test.xml index 11f426511..192b80826 100644 --- a/src/test/resources/logback-test.xml +++ b/src/test/resources/logback-test.xml @@ -79,9 +79,9 @@ - - - + + +