From cffecc33697f6f79020c2ee1872d23c3ca7de735 Mon Sep 17 00:00:00 2001
From: Daniel Haag <daniel.haag@uibk.ac.at>
Date: Fri, 22 Feb 2019 14:44:06 +0100
Subject: [PATCH] openolat#1: added new test.env.db.postgresql.host.name
 configuration option to allow test databases on different hosts

---
 pom.xml | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/pom.xml b/pom.xml
index a7aa0503240..abf6408a4e7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -85,6 +85,7 @@
 	    <test.env.db.host.port>3306</test.env.db.host.port>
 	    <test.env.db.postgresql.user>postgres</test.env.db.postgresql.user>
 	    <test.env.db.postgresql.pass>postgres</test.env.db.postgresql.pass>
+	    <test.env.db.postgresql.host.name>localhost</test.env.db.postgresql.host.name>
 	    <test.env.db.postgresql.host.port>5432</test.env.db.postgresql.host.port>
 	    <test.env.db.oracle.name>orcl</test.env.db.oracle.name>
 	    <test.env.db.oracle.user>OLATTEST</test.env.db.oracle.user>
@@ -960,7 +961,7 @@
 						<!-- common configuration shared by all executions -->
 						<configuration>
 							<driver>org.postgresql.Driver</driver>
-							<url>jdbc:postgresql://localhost:${test.env.db.postgresql.host.port}/${test.env.db.name}</url>
+							<url>jdbc:postgresql://${test.env.db.postgresql.host.name}:${test.env.db.postgresql.host.port}/${test.env.db.name}</url>
 							<username>${test.env.db.postgresql.user}</username>
 							<password>${test.env.db.postgresql.pass}</password>
 						</configuration>
@@ -974,7 +975,7 @@
 								</goals>
 								<configuration>
 									<!-- need another database to drop the targeted one -->
-									<url>jdbc:postgresql://localhost:${test.env.db.postgresql.host.port}/postgres</url>
+									<url>jdbc:postgresql://${test.env.db.postgresql.host.name}:${test.env.db.postgresql.host.port}/postgres</url>
 									<autocommit>true</autocommit>
 									<sqlCommand>drop database if exists ${test.env.db.name}</sqlCommand>
 									<!-- ignore error when database is not avaiable -->
@@ -989,7 +990,7 @@
 									<goal>execute</goal>
 								</goals>
 								<configuration>
-									<url>jdbc:postgresql://localhost:${test.env.db.postgresql.host.port}/postgres</url>
+									<url>jdbc:postgresql://${test.env.db.postgresql.host.name}:${test.env.db.postgresql.host.port}/postgres</url>
 									<!-- no transaction -->
 									<autocommit>true</autocommit>
 									<sqlCommand>create database ${test.env.db.name}</sqlCommand>
@@ -1022,7 +1023,7 @@
 									<goal>execute</goal>
 								</goals>
 								<configuration>
-									<url>jdbc:postgresql://localhost:${test.env.db.postgresql.host.port}/postgres</url>
+									<url>jdbc:postgresql://${test.env.db.postgresql.host.name}:${test.env.db.postgresql.host.port}/postgres</url>
 									<autocommit>true</autocommit>
 									<sqlCommand>drop database if exists ${test.env.db.name}</sqlCommand>
 								</configuration>
@@ -1037,7 +1038,7 @@
 								</goals>
 								<configuration>
 									<!-- need another database to drop the targeted one -->
-									<url>jdbc:postgresql://localhost:${test.env.db.postgresql.host.port}/postgres</url>
+									<url>jdbc:postgresql://${test.env.db.postgresql.host.name}:${test.env.db.postgresql.host.port}/postgres</url>
 									<autocommit>true</autocommit>
 									<sqlCommand>drop database if exists ${test.env.db.name}</sqlCommand>
 									<!-- ignore error when database is not avaiable -->
@@ -1052,7 +1053,7 @@
 									<goal>execute</goal>
 								</goals>
 								<configuration>
-									<url>jdbc:postgresql://localhost:${test.env.db.postgresql.host.port}/postgres</url>
+									<url>jdbc:postgresql://${test.env.db.postgresql.host.name}:${test.env.db.postgresql.host.port}/postgres</url>
 									<!-- no transaction -->
 									<autocommit>true</autocommit>
 									<sqlCommand>create database ${test.env.db.name}</sqlCommand>
@@ -1081,7 +1082,7 @@
 									<goal>execute</goal>
 								</goals>
 								<configuration>
-									<url>jdbc:postgresql://localhost:${test.env.db.postgresql.host.port}/postgres</url>
+									<url>jdbc:postgresql://${test.env.db.postgresql.host.name}:${test.env.db.postgresql.host.port}/postgres</url>
 									<autocommit>true</autocommit>
 									<sqlCommand>drop database if exists ${test.env.db.name}</sqlCommand>
 								</configuration>
@@ -1379,6 +1380,7 @@
 						<test.env.db.host.port>${test.env.db.host.port}</test.env.db.host.port>
 						<test.env.db.postgresql.user>${test.env.db.postgresql.user}</test.env.db.postgresql.user>
 						<test.env.db.postgresql.pass>${test.env.db.postgresql.pass}</test.env.db.postgresql.pass>
+						<test.env.db.postgresql.host.name>${test.env.db.postgresql.host.name}</test.env.db.postgresql.host.name>
 						<test.env.db.postgresql.host.port>${test.env.db.postgresql.host.port}</test.env.db.postgresql.host.port>
 						<test.env.instance.id>${test.env.instance.id}</test.env.instance.id>
 						<test.env.jmx.rmi.port.0>${test.env.jmx.rmi.port.0}</test.env.jmx.rmi.port.0>
-- 
GitLab