Merged in CLIP-1554-remove-default-preferred-test-query (pull request #146)

CLIP-1554: Remove default hibernate.c3p0.preferredTestQuery

* Make preferredTestQuery optional

* Make preferredTestQuery optional


Approved-by: Yifei Zhang
Approved-by: Minh Tran
Approved-by: Adam Brokes
This commit is contained in:
Eugene Ivantsov 2023-12-11 23:36:46 +00:00
parent 9be8112bb2
commit 3b62a5a1a1
2 changed files with 4 additions and 3 deletions

View File

@ -42,7 +42,9 @@
<property name="hibernate.c3p0.max_statements">{{ atl_db_maxstatements | default('0') }}</property>
<property name="hibernate.c3p0.validate">{{ atl_db_validate | default('true') }}</property>
<property name="hibernate.c3p0.acquire_increment">{{ atl_db_acquireincrement | default('1') }}</property>
<property name="hibernate.c3p0.preferredTestQuery">{{ atl_db_validationquery | default('select 1') }}</property>
{% if atl_db_validationquery is defined %}
<property name="hibernate.c3p0.preferredTestQuery">{{ atl_db_validationquery }}</property>
{% endif %}
{% else %}
<property name="hibernate.hikari.idleTimeout">{{ (atl_db_timeout | default(30) | int) * 1000 }}</property>
<property name="hibernate.hikari.maximumPoolSize">{{ atl_db_poolmaxsize | default('100') }}</property>

View File

@ -312,7 +312,7 @@ def test_confluence_xml_postgres_c3p0(docker_cli, image, run_user):
'ATL_DB_TYPE': 'postgresql',
'ATL_JDBC_URL': 'atl_jdbc_url',
'ATL_JDBC_USER': 'atl_jdbc_user',
'ATL_JDBC_PASSWORD': 'atl_jdbc_password',
'ATL_JDBC_PASSWORD': 'atl_jdbc_password'
}
container = run_image(docker_cli, image, user=run_user, environment=environment)
_jvm = wait_for_proc(container, get_bootstrap_proc(container))
@ -332,7 +332,6 @@ def test_confluence_xml_postgres_c3p0(docker_cli, image, run_user):
assert xml.findall('.//property[@name="hibernate.c3p0.max_statements"]')[0].text == "0"
assert xml.findall('.//property[@name="hibernate.c3p0.validate"]')[0].text == "true"
assert xml.findall('.//property[@name="hibernate.c3p0.acquire_increment"]')[0].text == "1"
assert xml.findall('.//property[@name="hibernate.c3p0.preferredTestQuery"]')[0].text == "select 1"
def test_confluence_xml_postgres_all_set_c3p0(docker_cli, image, run_user):