ENH: Abort all tests if connection to db could not be esablished (#1099)

This commit is contained in:
Roland Praml
2017-08-30 20:04:50 +12:00
committed by Rob Bygrave
parent 4c8e1113bf
commit c00febd95b
+8 -1
View File
@@ -16,9 +16,16 @@ public class BaseTestCase {
static {
logger.debug("... preStart");
if (!AgentLoader.loadAgentFromClasspath("ebean-agent", "debug=1;packages=org.tests,org.avaje.test,io.ebean")) {
if (!AgentLoader.loadAgentFromClasspath("ebean-agent", "debug=1")) {
logger.info("avaje-ebeanorm-agent not found in classpath - not dynamically loaded");
}
try {
// First try, if we get the default server. If this fails, all tests will fail.
Ebean.getDefaultServer();
} catch (Throwable e) {
logger.error("Fatal error while getting ebean-server. Exiting...", e);
System.exit(1);
}
}
/**