Skip to content

Commit 705e158

Browse files
committed
Test only - add logging for datasource to BaseTestCase
1 parent 265b92f commit 705e158

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

ebean-test/src/test/java/io/ebean/xtest/BaseTestCase.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package io.ebean.xtest;
22

3+
import io.avaje.config.Config;
34
import io.ebean.CacheMode;
45
import io.ebean.DB;
56
import io.ebean.Database;
@@ -71,6 +72,12 @@ public void checkForLeak(TestInfo testInfo) {
7172
String propsFile = System.getProperty("props.file");
7273
System.out.println("BaseTestCase: -Dprops.file=" + propsFile); // help debug CI
7374
// First try, if we get the default server. If this fails, all tests will fail.
75+
String dsName = Config.getNullable("datasource.default");
76+
System.out.println("config: datasource.default " + dsName);
77+
System.out.println("config: username " + Config.getNullable("datasource." + dsName + ".username"));
78+
System.out.println("config: password " + Config.getNullable("datasource." + dsName + ".password"));
79+
System.out.println("config: url " + Config.getNullable("datasource." + dsName + ".url"));
80+
7481
DB.getDefault();
7582
} catch (Throwable e) {
7683
logger.error("Fatal error while getting ebean-server. Exiting...", e);

ebean-test/src/test/resources/ebean.properties

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,10 @@ datasource.yugabyte.username=unit
152152
datasource.yugabyte.password=test
153153
datasource.yugabyte.url=jdbc:postgresql://localhost:6433/unit?sslmode=disable
154154

155+
datasource.postgres.username=unit
156+
datasource.postgres.password=test
157+
datasource.postgres.url=jdbc:postgresql://localhost:6433/unit?sslmode=disable
158+
155159
datasource.oracle.username=test_eb
156160
datasource.oracle.password=test
157161
datasource.oracle.url=jdbc:oracle:thin:@localhost:1521:XE

0 commit comments

Comments
 (0)