From e9ad459fa5c5398af0194333f9c1fc180dc75024 Mon Sep 17 00:00:00 2001 From: Rob Bygrave Date: Mon, 31 Oct 2016 20:40:26 +1300 Subject: [PATCH] #843 - Change ServerConfig name to default to "db" (prior default was null) and defaultServer to true --- src/main/java/com/avaje/ebean/config/ServerConfig.java | 6 +++--- .../java/com/avaje/ebean/config/DbMigrationConfigTest.java | 1 + .../TestPersistenceContextServerConfig.java | 2 ++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/avaje/ebean/config/ServerConfig.java b/src/main/java/com/avaje/ebean/config/ServerConfig.java index 44e5dab02..2f0230220 100644 --- a/src/main/java/com/avaje/ebean/config/ServerConfig.java +++ b/src/main/java/com/avaje/ebean/config/ServerConfig.java @@ -75,7 +75,7 @@ public class ServerConfig { /** * The EbeanServer name. */ - private String name; + private String name = "db"; /** * Typically configuration type objects that are passed by this ServerConfig @@ -105,7 +105,7 @@ public class ServerConfig { /** * Set to true if this is the default/primary server. */ - private boolean defaultServer; + private boolean defaultServer = true; /** * Set this to true to disable class path search. @@ -563,7 +563,7 @@ public class ServerConfig { } /** - * Set true if this EbeanServer should be registered as the "default" server + * Set false if you do not want this EbeanServer to be registered as the "default" server * with the Ebean singleton. *

* This is only used when {@link #setRegister(boolean)} is also true. diff --git a/src/test/java/com/avaje/ebean/config/DbMigrationConfigTest.java b/src/test/java/com/avaje/ebean/config/DbMigrationConfigTest.java index 2d9fd7523..e86f92be3 100644 --- a/src/test/java/com/avaje/ebean/config/DbMigrationConfigTest.java +++ b/src/test/java/com/avaje/ebean/config/DbMigrationConfigTest.java @@ -14,6 +14,7 @@ public class DbMigrationConfigTest { ServerConfig config = new ServerConfig(); config.setName("h2other"); config.loadFromProperties(); + config.setDefaultServer(false); DbMigrationConfig migrationConfig = config.getMigrationConfig(); diff --git a/src/test/java/com/avaje/tests/persistencecontext/TestPersistenceContextServerConfig.java b/src/test/java/com/avaje/tests/persistencecontext/TestPersistenceContextServerConfig.java index cb7dc971e..f3dac5fd1 100644 --- a/src/test/java/com/avaje/tests/persistencecontext/TestPersistenceContextServerConfig.java +++ b/src/test/java/com/avaje/tests/persistencecontext/TestPersistenceContextServerConfig.java @@ -46,6 +46,8 @@ public class TestPersistenceContextServerConfig extends BaseTestCase { config.loadFromProperties(properties); config.setPersistenceContextScope(PersistenceContextScope.QUERY); config.setContainerConfig(new ContainerConfig()); + config.setDefaultServer(false); + config.setRegister(false); // DataSourceConfig dataSourceConfig = new DataSourceConfig(); // dataSourceConfig.setUsername("sa");