From a03d62ecd1f3af4127eaf3d6159aa80cc5c43125 Mon Sep 17 00:00:00 2001 From: Filippe Spolti Date: Thu, 7 Jun 2018 15:32:57 -0300 Subject: [PATCH] [CLOUD-2297] - Support Quartz configuration with Oracle and another Databases Signed-off-by: Filippe Spolti --- os.kieserver.launch/added/kieserver-setup.sh | 75 ++++- os.kieserver.launch/added/quartz.properties | 26 +- os.kieserver.launch/configure.sh | 6 + .../jboss-deployment-structure-eap6x.xml | 1 + .../jboss-deployment-structure-eap7x.xml | 1 + os.kieserver.webapp/configure.sh | 2 + .../processserver/processserver_6_4.feature | 310 ++++++++++++++---- 7 files changed, 339 insertions(+), 82 deletions(-) diff --git a/os.kieserver.launch/added/kieserver-setup.sh b/os.kieserver.launch/added/kieserver-setup.sh index 053f68b2e..6b1d27f58 100644 --- a/os.kieserver.launch/added/kieserver-setup.sh +++ b/os.kieserver.launch/added/kieserver-setup.sh @@ -31,25 +31,80 @@ function filterKieJmsFile() { } function filterQuartzPropFile() { + + local QUARTZ_DELEGATE_CLASS="org.quartz.impl.jdbcjobstore.StdJDBCDelegate" + local DEFAULT_JNDI + local DB_TYPE + quartzPropFile="${1}" if [ -e ${quartzPropFile} ] ; then - if [[ "${KIE_SERVER_PERSISTENCE_DIALECT}" == "org.hibernate.dialect.MySQL"* ]]; then - sed -i "s,org.quartz.jobStore.driverDelegateClass=,org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.StdJDBCDelegate," ${quartzPropFile} - quartzDriverDelegateSet="true" - elif [[ "${KIE_SERVER_PERSISTENCE_DIALECT}" == "org.hibernate.dialect.PostgreSQL"* ]]; then - sed -i "s,org.quartz.jobStore.driverDelegateClass=,org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.PostgreSQLDelegate," ${quartzPropFile} - quartzDriverDelegateSet="true" + + # get the first db configuration using legacy datasource configuration: + if [ "x${DB_SERVICE_PREFIX_MAPPING}" != "x" ]; then + local serviceMappingName=${DB_SERVICE_PREFIX_MAPPING%%,*} + local prefix=${serviceMappingName#*=} + DEFAULT_JNDI=$(find_env "${prefix}_JNDI") fi - if [ "x${DB_JNDI}" != "x" ]; then - sed -i "s,org.quartz.dataSource.managedDS.jndiURL=,org.quartz.dataSource.managedDS.jndiURL=${DB_JNDI}," ${quartzPropFile} + # get the first db configuration using DATASOURCES env: + if [ "x${DATASOURCES}" != "x" ]; then + local prefix="${DATASOURCES%%,*}" + DEFAULT_JNDI=$(find_env "${prefix}_JNDI") + fi + + if [ "x${DEFAULT_JNDI}" != "x" ]; then quartzManagedJndiSet="true" fi if [ "x${QUARTZ_JNDI}" != "x" ]; then - sed -i "s,org.quartz.dataSource.notManagedDS.jndiURL=,org.quartz.dataSource.notManagedDS.jndiURL=${QUARTZ_JNDI}," ${quartzPropFile} quartzNotManagedJndiSet="true" fi + + if [[ "${KIE_SERVER_PERSISTENCE_DIALECT}" == "org.hibernate.dialect.MySQL"* ]]; then + quartzDriverDelegateSet="true" + DB_TYPE="MYSQL" + elif [[ "${KIE_SERVER_PERSISTENCE_DIALECT}" == "org.hibernate.dialect.PostgreSQL"* ]]; then + QUARTZ_DELEGATE_CLASS="org.quartz.impl.jdbcjobstore.PostgreSQLDelegate" + quartzDriverDelegateSet="true" + DB_TYPE="POSTGRESQL" + elif [[ "${KIE_SERVER_PERSISTENCE_DIALECT}" == *"Oracle"* ]]; then + log_warning "For Oracle 10G use the org.jbpm.persistence.jpa.hibernate.DisabledFollowOnLockOracle10gDialect to avoid frequent Hibernate warning HHH000444 message in the logs." + QUARTZ_DELEGATE_CLASS="org.quartz.impl.jdbcjobstore.oracle.OracleDelegate" + # Oracle classes needs to be accessible by the quartz, in this case oracle driver needs to be added on jboss-deployment-structure.xml file + if [ "x${QUARTZ_DRIVER}" != "x" ]; then + sed -i "s|<\!--EXTRA_DEPENDENCY-->|\n <\!--EXTRA_DEPENDENCY-->|" $JBOSS_HOME/standalone/deployments/kie-server.war/WEB-INF/jboss-deployment-structure.xml + else + log_warning "QUARTZ_DRIVER env not set. Quartz might not work properly." + fi + quartzDriverDelegateSet="true" + DB_TYPE="ORACLE" + elif [[ "${KIE_SERVER_PERSISTENCE_DIALECT}" == "org.hibernate.dialect.SQLServer"* ]]; then + QUARTZ_DELEGATE_CLASS="org.quartz.impl.jdbcjobstore.MSSQLDelegate" + quartzDriverDelegateSet="true" + DB_TYPE="SQLSERVER" + + if [ "x${QUARTZ_DATABASE}" != "x" ]; then + local databaseName="${QUARTZ_DATABASE}" + fi + + if [ "x${QUARTZ_XA_CONNECTION_PROPERTY_URL}" != "x" ]; then + local databaseName="${QUARTZ_XA_CONNECTION_PROPERTY_URL#*=}" + fi + + if [ "x${QUARTZ_URL}" != "x" ]; then + local databaseName="${QUARTZ_URL#*=}" + fi + + sed -i "s|USE \[enter_db_name_here\]|USE ${databaseName}|" $JBOSS_HOME/bin/quartz_tables_sqlserver.sql + + elif [[ "${KIE_SERVER_PERSISTENCE_DIALECT}" == "org.hibernate.dialect.DB2"* ]]; then + quartzDriverDelegateSet="true" + DB_TYPE="DB2" + fi + if [ "${quartzDriverDelegateSet}" = "true" ] && [ "${quartzManagedJndiSet=}" = "true" ] && [ "${quartzNotManagedJndiSet=}" = "true" ]; then - KIE_SERVER_OPTS="${KIE_SERVER_OPTS} -Dorg.quartz.properties=${quartzPropFile}" + sed -i "s,org.quartz.jobStore.driverDelegateClass=,org.quartz.jobStore.driverDelegateClass=${QUARTZ_DELEGATE_CLASS}," ${quartzPropFile} + sed -i "s,org.quartz.dataSource.managedDS.jndiURL=,org.quartz.dataSource.managedDS.jndiURL=${DEFAULT_JNDI}," ${quartzPropFile} + sed -i "s,org.quartz.dataSource.notManagedDS.jndiURL=,org.quartz.dataSource.notManagedDS.jndiURL=${QUARTZ_JNDI}," ${quartzPropFile} + KIE_SERVER_OPTS="${KIE_SERVER_OPTS} -Dorg.quartz.properties=${quartzPropFile} -Dorg.openshift.kieserver.common.sql.dbtype=${DB_TYPE}" fi fi } diff --git a/os.kieserver.launch/added/quartz.properties b/os.kieserver.launch/added/quartz.properties index 0c18800c2..c2ec501fb 100644 --- a/os.kieserver.launch/added/quartz.properties +++ b/os.kieserver.launch/added/quartz.properties @@ -1,39 +1,41 @@ # Configure Main Scheduler Properties #============================================================================ -org.quartz.scheduler.instanceName = jBPMClusteredScheduler -org.quartz.scheduler.instanceId = AUTO +org.quartz.scheduler.instanceName=jBPMClusteredScheduler +org.quartz.scheduler.instanceId=AUTO #============================================================================ # Configure ThreadPool #============================================================================ -org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool -org.quartz.threadPool.threadCount = 5 -org.quartz.threadPool.threadPriority = 5 +org.quartz.threadPool.class=org.quartz.simpl.SimpleThreadPool +org.quartz.threadPool.threadCount=5 +org.quartz.threadPool.threadPriority=5 #============================================================================ # Configure JobStore #============================================================================ -org.quartz.jobStore.misfireThreshold = 60000 - +org.quartz.jobStore.misfireThreshold=60000 org.quartz.jobStore.class=org.quartz.impl.jdbcjobstore.JobStoreCMT -#The filed below will be configured by the kieserver-config.sh -#for mysql: org.quartz.impl.jdbcjobstore.StdJDBCDelegate -#for postgresql: org.quartz.impl.jdbcjobstore.PostgreSQLDelegate +# The property below will be configured by the kieserver-setup.sh +# for mysql: org.quartz.impl.jdbcjobstore.StdJDBCDelegate +# for postgresql: org.quartz.impl.jdbcjobstore.PostgreSQLDelegate +# for oracle: org.quartz.impl.jdbcjobstore.oracle.OracleDelegate +# for sqlserver: org.quartz.impl.jdbcjobstore.MSSQLDelegate +# for db2: org.quartz.impl.jdbcjobstore.StdJDBCDelegate org.quartz.jobStore.driverDelegateClass= org.quartz.jobStore.useProperties=false org.quartz.jobStore.dataSource=managedDS org.quartz.jobStore.nonManagedTXDataSource=notManagedDS org.quartz.jobStore.tablePrefix=QRTZ_ org.quartz.jobStore.isClustered=true -org.quartz.jobStore.clusterCheckinInterval = 20000 +org.quartz.jobStore.clusterCheckinInterval=20000 #============================================================================ # Configure Datasources #============================================================================ -#Needs to be added kieserver-config.sh script as we don't know the JNDIs +#Needs to be added by kieserver-setup.sh script as we don't know the JNDIs org.quartz.dataSource.managedDS.jndiURL= org.quartz.dataSource.notManagedDS.jndiURL= diff --git a/os.kieserver.launch/configure.sh b/os.kieserver.launch/configure.sh index ee9209cc4..8f8fe1113 100755 --- a/os.kieserver.launch/configure.sh +++ b/os.kieserver.launch/configure.sh @@ -18,8 +18,14 @@ if [ -e ${SOURCES_DIR}/jboss-bpmsuite-*-supplementary-tools.zip ]; then # Get the DDL files and copy to $JBOSS_HOME/bin/ unzip -qj ${SOURCES_DIR}/jboss-bpmsuite-*-supplementary-tools.zip jboss-brms-bpmsuite-*-supplementary-tools/ddl-scripts/mysql5/quartz_tables_mysql.sql -d ${SCRIPT_DIR} unzip -qj ${SOURCES_DIR}/jboss-bpmsuite-*-supplementary-tools.zip jboss-brms-bpmsuite-*-supplementary-tools/ddl-scripts/postgresql/quartz_tables_postgres.sql -d ${SCRIPT_DIR} + unzip -qj ${SOURCES_DIR}/jboss-bpmsuite-*-supplementary-tools.zip jboss-brms-bpmsuite-*-supplementary-tools/ddl-scripts/oracle/quartz_tables_oracle.sql -d ${SCRIPT_DIR} + unzip -qj ${SOURCES_DIR}/jboss-bpmsuite-*-supplementary-tools.zip jboss-brms-bpmsuite-*-supplementary-tools/ddl-scripts/sqlserver/quartz_tables_sqlserver.sql -d ${SCRIPT_DIR} + unzip -qj ${SOURCES_DIR}/jboss-bpmsuite-*-supplementary-tools.zip jboss-brms-bpmsuite-*-supplementary-tools/ddl-scripts/db2/quartz_tables_db2.sql -d ${SCRIPT_DIR} cp -p ${SCRIPT_DIR}/quartz_tables_mysql.sql ${JBOSS_HOME}/bin/ cp -p ${SCRIPT_DIR}/quartz_tables_postgres.sql ${JBOSS_HOME}/bin/ + cp -p ${SCRIPT_DIR}/quartz_tables_oracle.sql ${JBOSS_HOME}/bin/ + cp -p ${SCRIPT_DIR}/quartz_tables_sqlserver.sql ${JBOSS_HOME}/bin/ + cp -p ${SCRIPT_DIR}/quartz_tables_db2.sql ${JBOSS_HOME}/bin/ fi # Enforces eap70 password policy for the add-user script. diff --git a/os.kieserver.webapp/added/WEB-INF/jboss-deployment-structure-eap6x.xml b/os.kieserver.webapp/added/WEB-INF/jboss-deployment-structure-eap6x.xml index 035edf23e..4341137d5 100644 --- a/os.kieserver.webapp/added/WEB-INF/jboss-deployment-structure-eap6x.xml +++ b/os.kieserver.webapp/added/WEB-INF/jboss-deployment-structure-eap6x.xml @@ -28,6 +28,7 @@ + diff --git a/os.kieserver.webapp/added/WEB-INF/jboss-deployment-structure-eap7x.xml b/os.kieserver.webapp/added/WEB-INF/jboss-deployment-structure-eap7x.xml index bf45f56cd..d30fb20cc 100644 --- a/os.kieserver.webapp/added/WEB-INF/jboss-deployment-structure-eap7x.xml +++ b/os.kieserver.webapp/added/WEB-INF/jboss-deployment-structure-eap7x.xml @@ -26,6 +26,7 @@ the WAR depends on private modules. --> + \ No newline at end of file diff --git a/os.kieserver.webapp/configure.sh b/os.kieserver.webapp/configure.sh index 7ccec86e0..970efe168 100755 --- a/os.kieserver.webapp/configure.sh +++ b/os.kieserver.webapp/configure.sh @@ -44,9 +44,11 @@ fi cp -f -p ${SOURCES_DIR}/openshift-kieserver-common-${OPENSHIFT_KIESERVER_VERSION}.jar ${KIE_SERVER_WEBINF_DIR}/lib/openshift-kieserver-common-${OPENSHIFT_KIESERVER_VERSION}.jar cp -f -p ${SOURCES_DIR}/openshift-kieserver-jms-${OPENSHIFT_KIESERVER_VERSION}.jar ${KIE_SERVER_WEBINF_DIR}/lib/openshift-kieserver-jms-${OPENSHIFT_KIESERVER_VERSION}.jar cp -f -p ${SOURCES_DIR}/openshift-kieserver-web-${OPENSHIFT_KIESERVER_VERSION}.jar ${KIE_SERVER_WEBINF_DIR}/lib/openshift-kieserver-web-${OPENSHIFT_KIESERVER_VERSION}.jar +cp -f -p ${SOURCES_DIR}/quartz-oracle-1.8.5.jar ${KIE_SERVER_WEBINF_DIR}/lib/ chmod 664 "${KIE_SERVER_WEBINF_DIR}/lib/openshift-kieserver-common-${OPENSHIFT_KIESERVER_VERSION}.jar" chmod 664 "${KIE_SERVER_WEBINF_DIR}/lib/openshift-kieserver-jms-${OPENSHIFT_KIESERVER_VERSION}.jar" chmod 664 "${KIE_SERVER_WEBINF_DIR}/lib/openshift-kieserver-web-${OPENSHIFT_KIESERVER_VERSION}.jar" +chmod 664 "${KIE_SERVER_WEBINF_DIR}/lib/quartz-oracle-1.8.5.jar" cp -f -p ${ADDED_WEBINF_DIR}/ejb-jar.xml ${KIE_SERVER_WEBINF_DIR}/ejb-jar.xml cp -f -p ${ADDED_WEBINF_DIR}/security-filter-rules.properties ${KIE_SERVER_WEBINF_DIR}/security-filter-rules.properties diff --git a/tests/features/processserver/processserver_6_4.feature b/tests/features/processserver/processserver_6_4.feature index ef645bbd6..9217419f5 100644 --- a/tests/features/processserver/processserver_6_4.feature +++ b/tests/features/processserver/processserver_6_4.feature @@ -13,85 +13,275 @@ Feature: OpenShift Process Server 6.4 basic tests Scenario: Checks if the kie-server webapp is deployed. When container is ready - Then Then container log should contain Deployed "kie-server.war" + Then container log should contain Deployed "kie-server.war" Scenario: Test REST API is secure When container is ready Then check that page is served - | property | value | - | port | 8080 | - | path | /kie-server/services/rest/server | - | expected_status_code | 401 | + | property | value | + | port | 8080 | + | path | /kie-server/services/rest/server | + | expected_status_code | 401 | Scenario: Test REST API is available and valid When container is ready Then check that page is served - | property | value | - | port | 8080 | - | path | /kie-server/services/rest/server | - | username | kieserver | - | password | kieserver1! | - | expected_phrase | SUCCESS | + | property | value | + | port | 8080 | + | path | /kie-server/services/rest/server | + | username | kieserver | + | password | kieserver1! | + | expected_phrase | SUCCESS | - Scenario: Checks SQL Importer behaviour if QUARTZ_JNDI variable does not exists + Scenario: check ownership when started as alternative UID + When container is started as uid 26458 + Then container log should contain Running + And run id -u in container and check its output contains 26458 + And all files under /opt/eap are writeable by current user + And all files under /deployments are writeable by current user + + Scenario: Checks that CLOUD-1476 patch upgrade was successful + When container is ready + Then file /opt/eap/standalone/deployments/kie-server.war/WEB-INF/web.xml should contain org.openshift.kieserver + And file /opt/eap/standalone/deployments/kie-server.war/WEB-INF/security-filter-rules.properties should exist + And file /opt/eap/standalone/deployments/kie-server.war/WEB-INF/lib/kie-api-6.5.0.Final-redhat-2.jar should not exist + And file /opt/eap/standalone/deployments/kie-server.war/WEB-INF/lib/kie-api-6.5.0.Final-redhat-21.jar should exist + And file /opt/eap/standalone/deployments/kie-server.war/WEB-INF/lib/openshift-kieserver-common-1.2.0.Final-redhat-1.jar should exist + + Scenario: Checks SQL Importer behaviour if QUARTZ_JNDI variable does not exists When container is ready Then container log should contain QUARTZ_JNDI env not found, skipping SqlImporter + Scenario: Checks tif all quartz.sql files are present in the image, CLOUD-2297 + When container is ready + Then file /opt/eap/bin/quartz_tables_mysql.sql should exist + And file /opt/eap/bin/quartz_tables_postgres.sql should exist + And file /opt/eap/bin/quartz_tables_oracle.sql should exist + And file /opt/eap/bin/quartz_tables_sqlserver.sql should exist + And file /opt/eap/bin/quartz_tables_db2.sql should exist + Scenario: Checks if the Quartz was successfully configured with MySQL When container is started with env - | variable | value | - | DB_SERVICE_PREFIX_MAPPING | kie-app-mysql=DB,kie-app-mysql=QUARTZ | - | DB_DATABASE | mydb | - | DB_USERNAME | root | - | DB_PASSWORD | password | - | DB_JNDI | java:jboss/datasources/ExampleDS | - | QUARTZ_JNDI | java:jboss/datasources/ExampleDSNotManaged | - | QUARTZ_DATABASE | mydb | - | QUARTZ_USERNAME | root | - | QUARTZ_PASSWORD | password | - | QUARTZ_JTA | false | - | QUARTZ_NONXA | true | - | KIE_APP_MYSQL_SERVICE_HOST | 10.1.1.1 | - | KIE_APP_MYSQL_SERVICE_PORT | 3306 | + | variable | value | + | DB_SERVICE_PREFIX_MAPPING | kie-app-mysql=DB,kie-app-mysql=QUARTZ | + | KIE_SERVER_PERSISTENCE_DIALECT | org.hibernate.dialect.MySQLDialect | + | DB_DATABASE | mydb | + | DB_USERNAME | root | + | DB_PASSWORD | password | + | DB_JNDI | java:jboss/datasources/ExampleDS | + | QUARTZ_JNDI | java:jboss/datasources/ExampleDSNotManaged | + | QUARTZ_DATABASE | mydb | + | QUARTZ_USERNAME | root | + | QUARTZ_PASSWORD | password | + | QUARTZ_JTA | false | + | QUARTZ_NONXA | true | + | KIE_APP_MYSQL_SERVICE_HOST | 10.1.1.1 | + | KIE_APP_MYSQL_SERVICE_PORT | 3306 | Then XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value mysql on XPath //*[local-name()='xa-datasource']/*[local-name()='driver'] - Then XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value mysql on XPath //*[local-name()='datasource']/*[local-name()='driver'] - Then XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value java:jboss/datasources/ExampleDS on XPath //*[local-name()='xa-datasource']/@jndi-name - Then XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value java:jboss/datasources/ExampleDSNotManaged on XPath //*[local-name()='datasource']/@jndi-name - Then XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value false on XPath //*[local-name()='datasource']/@jta + And XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value mysql on XPath //*[local-name()='datasource']/*[local-name()='driver'] + And XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value java:jboss/datasources/ExampleDS on XPath //*[local-name()='xa-datasource']/@jndi-name + And XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value java:jboss/datasources/ExampleDSNotManaged on XPath //*[local-name()='datasource']/@jndi-name + And XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value false on XPath //*[local-name()='datasource']/@jta + And file /opt/eap/bin/quartz.properties should contain org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.StdJDBCDelegate + And file /opt/eap/bin/quartz.properties should contain org.quartz.dataSource.managedDS.jndiURL=java:jboss/datasources/ExampleDS + And file /opt/eap/bin/quartz.properties should contain org.quartz.dataSource.notManagedDS.jndiURL=java:jboss/datasources/ExampleDSNotManaged + And container log should contain -Dorg.quartz.properties=/opt/eap/bin/quartz.properties + And container log should contain -Dorg.openshift.kieserver.common.sql.dbtype=MYSQL Scenario: Checks if the Quartz was successfully configured with PostgreSQL When container is started with env - | variable | value | - | DB_SERVICE_PREFIX_MAPPING | kie-app-postgresql=DB,kie-app-postgresql=QUARTZ | - | DB_DATABASE | mydb | - | DB_USERNAME | root | - | DB_PASSWORD | password | - | DB_JNDI | java:jboss/datasources/ExampleDS | - | QUARTZ_JNDI | java:jboss/datasources/ExampleDSNotManaged | - | QUARTZ_DATABASE | mydb | - | QUARTZ_USERNAME | root | - | QUARTZ_PASSWORD | password | - | QUARTZ_JTA | false | - | QUARTZ_NONXA | true | - | KIE_APP_POSTGRESQL_SERVICE_HOST | 10.1.1.1 | - | KIE_APP_POSTGRESQL_SERVICE_PORT | 5432 | + | variable | value | + | DB_SERVICE_PREFIX_MAPPING | kie-app-postgresql=DB,kie-app-postgresql=QUARTZ | + | KIE_SERVER_PERSISTENCE_DIALECT | org.hibernate.dialect.PostgreSQLLDialect | + | DB_DATABASE | mydb | + | DB_USERNAME | root | + | DB_PASSWORD | password | + | DB_JNDI | java:jboss/datasources/ExampleDS | + | QUARTZ_JNDI | java:jboss/datasources/ExampleDSNotManaged | + | QUARTZ_DATABASE | mydb | + | QUARTZ_USERNAME | root | + | QUARTZ_PASSWORD | password | + | QUARTZ_JTA | false | + | QUARTZ_NONXA | true | + | KIE_APP_POSTGRESQL_SERVICE_HOST | 10.1.1.1 | + | KIE_APP_POSTGRESQL_SERVICE_PORT | 5432 | + Then XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value postgresql on XPath //*[local-name()='xa-datasource']/*[local-name()='driver'] + And XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value postgresql on XPath //*[local-name()='datasource']/*[local-name()='driver'] + And XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value java:jboss/datasources/ExampleDS on XPath //*[local-name()='xa-datasource']/@jndi-name + And XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value java:jboss/datasources/ExampleDSNotManaged on XPath //*[local-name()='datasource']/@jndi-name + And XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value false on XPath //*[local-name()='datasource']/@jta + And file /opt/eap/bin/quartz.properties should contain org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.PostgreSQLDelegate + And file /opt/eap/bin/quartz.properties should contain org.quartz.dataSource.managedDS.jndiURL=java:jboss/datasources/ExampleDS + And file /opt/eap/bin/quartz.properties should contain org.quartz.dataSource.notManagedDS.jndiURL=java:jboss/datasources/ExampleDSNotManaged + And container log should contain -Dorg.quartz.properties=/opt/eap/bin/quartz.properties + And container log should contain -Dorg.openshift.kieserver.common.sql.dbtype=POSTGRESQL + + Scenario: Checks if the Quartz was successfully configured with PostgreSQL using custom db prefix, CLOUD-2297 + When container is started with env + | variable | value | + | DB_SERVICE_PREFIX_MAPPING | kie-app-postgresql=BPMS,kie-app-postgresql=QUARTZ | + | KIE_SERVER_PERSISTENCE_DIALECT | org.hibernate.dialect.PostgreSQLLDialect | + | BPMS_DATABASE | mydb | + | BPMS_USERNAME | root | + | BPMS_PASSWORD | password | + | BPMS_JNDI | java:jboss/datasources/ExampleDS | + | QUARTZ_JNDI | java:jboss/datasources/ExampleDSNotManaged | + | QUARTZ_DATABASE | mydb | + | QUARTZ_USERNAME | root | + | QUARTZ_PASSWORD | password | + | QUARTZ_JTA | false | + | QUARTZ_NONXA | true | + | KIE_APP_POSTGRESQL_SERVICE_HOST | 10.1.1.1 | + | KIE_APP_POSTGRESQL_SERVICE_PORT | 5432 | Then XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value postgresql on XPath //*[local-name()='xa-datasource']/*[local-name()='driver'] - And XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value postgresql on XPath //*[local-name()='datasource']/*[local-name()='driver'] - And XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value java:jboss/datasources/ExampleDS on XPath //*[local-name()='xa-datasource']/@jndi-name - And XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value java:jboss/datasources/ExampleDSNotManaged on XPath //*[local-name()='datasource']/@jndi-name + And XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value postgresql on XPath //*[local-name()='datasource']/*[local-name()='driver'] + And XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value java:jboss/datasources/ExampleDS on XPath //*[local-name()='xa-datasource']/@jndi-name + And XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value java:jboss/datasources/ExampleDSNotManaged on XPath //*[local-name()='datasource']/@jndi-name + And XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value false on XPath //*[local-name()='datasource']/@jta + And file /opt/eap/bin/quartz.properties should contain org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.PostgreSQLDelegate + And file /opt/eap/bin/quartz.properties should contain org.quartz.dataSource.managedDS.jndiURL=java:jboss/datasources/ExampleDS + And file /opt/eap/bin/quartz.properties should contain org.quartz.dataSource.notManagedDS.jndiURL=java:jboss/datasources/ExampleDSNotManaged + And container log should contain -Dorg.quartz.properties=/opt/eap/bin/quartz.properties + And container log should contain -Dorg.openshift.kieserver.common.sql.dbtype=POSTGRESQL + + Scenario: Checks if the Quartz was successfully configured with Oracle, CLOUD-2297 + When container is started with env + | variable | value | + | DATASOURCES | ORACLE,QUARTZ | + | KIE_SERVER_PERSISTENCE_DIALECT | org.jbpm.persistence.jpa.hibernate.DisabledFollowOnLockOracle10gDialect | + | ORACLE_JNDI | java:jboss/datasources/jbpmDS | + | ORACLE_USERNAME | username | + | ORACLE_PASSWORD | password | + | ORACLE_NONXA | false | + | ORACLE_MIN_POOL_SIZE | 10 | + | ORACLE_MAX_POOL_SIZE | 10 | + | ORACLE_JTA | true | + | ORACLE_XA_CONNECTION_PROPERTY_URL | jdbc:oracle:thin:@10.1.1.1:1521:jbpm | + | ORACLE_DRIVER | ojdbc6.jar | + | QUARTZ_JNDI | java:jboss/datasources/jbpmDSNotManaged | + | QUARTZ_USERNAME | username | + | QUARTZ_PASSWORD | password | + | QUARTZ_NONXA | true | + | QUARTZ_MIN_POOL_SIZE | 10 | + | QUARTZ_MAX_POOL_SIZE | 10 | + | QUARTZ_JTA | false | + | QUARTZ_URL | jdbc:oracle:thin:@10.1.1.1:1521:jbpm | + | QUARTZ_DRIVER | ojdbc6.jar | + Then XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value ojdbc6.jar on XPath //*[local-name()='xa-datasource']/*[local-name()='driver'] + And XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value ojdbc6.jar on XPath //*[local-name()='datasource']/*[local-name()='driver'] + And XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value java:jboss/datasources/jbpmDS on XPath //*[local-name()='xa-datasource']/@jndi-name + And XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value java:jboss/datasources/jbpmDSNotManaged on XPath //*[local-name()='datasource']/@jndi-name + And XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value false on XPath //*[local-name()='datasource']/@jta + And file /opt/eap/bin/quartz.properties should contain org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.oracle.OracleDelegate + And file /opt/eap/bin/quartz.properties should contain org.quartz.dataSource.managedDS.jndiURL=java:jboss/datasources/jbpmDS + And file /opt/eap/bin/quartz.properties should contain org.quartz.dataSource.notManagedDS.jndiURL=java:jboss/datasources/jbpmDSNotManaged + And container log should contain -Dorg.kie.server.persistence.dialect=org.jbpm.persistence.jpa.hibernate.DisabledFollowOnLockOracle10gDialect + And file /opt/eap/standalone/deployments/kie-server.war/WEB-INF/jboss-deployment-structure.xml should contain + And container log should contain -Dorg.quartz.properties=/opt/eap/bin/quartz.properties + And container log should contain -Dorg.openshift.kieserver.common.sql.dbtype=ORACLE + + Scenario: Checks if the Quartz was successfully configured with Oracle, CLOUD-2297 + When container is started with env + | variable | value | + | DATASOURCES | ORACLE,QUARTZ | + | KIE_SERVER_PERSISTENCE_DIALECT | org.hibernate.dialect.Oracle10gDialect | + | ORACLE_JNDI | java:jboss/datasources/jbpmDS | + | ORACLE_USERNAME | username | + | ORACLE_PASSWORD | password | + | ORACLE_NONXA | false | + | ORACLE_MIN_POOL_SIZE | 10 | + | ORACLE_MAX_POOL_SIZE | 10 | + | ORACLE_JTA | true | + | ORACLE_XA_CONNECTION_PROPERTY_URL | jdbc:oracle:thin:@10.1.1.1:1521:jbpm | + | ORACLE_DRIVER | ojdbc6.jar | + | QUARTZ_JNDI | java:jboss/datasources/jbpmDSNotManaged | + | QUARTZ_USERNAME | username | + | QUARTZ_PASSWORD | password | + | QUARTZ_NONXA | true | + | QUARTZ_MIN_POOL_SIZE | 10 | + | QUARTZ_MAX_POOL_SIZE | 10 | + | QUARTZ_JTA | false | + | QUARTZ_URL | jdbc:oracle:thin:@10.1.1.1:1521:jbpm | + | QUARTZ_DRIVER | ojdbc6.jar | + Then XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value ojdbc6.jar on XPath //*[local-name()='xa-datasource']/*[local-name()='driver'] + And XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value ojdbc6.jar on XPath //*[local-name()='datasource']/*[local-name()='driver'] + And XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value java:jboss/datasources/jbpmDS on XPath //*[local-name()='xa-datasource']/@jndi-name + And XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value java:jboss/datasources/jbpmDSNotManaged on XPath //*[local-name()='datasource']/@jndi-name And XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value false on XPath //*[local-name()='datasource']/@jta + And file /opt/eap/bin/quartz.properties should contain org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.oracle.OracleDelegate + And file /opt/eap/bin/quartz.properties should contain org.quartz.dataSource.managedDS.jndiURL=java:jboss/datasources/jbpmDS + And file /opt/eap/bin/quartz.properties should contain org.quartz.dataSource.notManagedDS.jndiURL=java:jboss/datasources/jbpmDSNotManaged + And container log should contain -Dorg.kie.server.persistence.dialect=org.hibernate.dialect.Oracle10gDialect + And container log should contain For Oracle 10G use the org.jbpm.persistence.jpa.hibernate.DisabledFollowOnLockOracle10gDialect to avoid frequent Hibernate warning HHH000444 message in the logs. + And file /opt/eap/standalone/deployments/kie-server.war/WEB-INF/jboss-deployment-structure.xml should contain + And container log should contain -Dorg.quartz.properties=/opt/eap/bin/quartz.properties + And container log should contain -Dorg.openshift.kieserver.common.sql.dbtype=ORACLE - Scenario: check ownership when started as alternative UID - When container is started as uid 26458 - Then container log should contain Running - And run id -u in container and check its output contains 26458 - And all files under /opt/eap are writeable by current user - And all files under /deployments are writeable by current user + Scenario: Checks if the Quartz was successfully configured with SQL Server, CLOUD-2297 + When container is started with env + | variable | value | + | DATASOURCES | SQLSERVER,QUARTZ | + | KIE_SERVER_PERSISTENCE_DIALECT | org.hibernate.dialect.SQLServerDialect | + | SQLSERVER_JNDI | java:jboss/datasources/jbpmDS | + | SQLSERVER_USERNAME | username | + | SQLSERVER_PASSWORD | password | + | SQLSERVER_NONXA | false | + | SQLSERVER_MIN_POOL_SIZE | 10 | + | SQLSERVER_MAX_POOL_SIZE | 10 | + | SQLSERVER_JTA | true | + | SQLSERVER_XA_CONNECTION_PROPERTY_URL | jdbc:sqlserver://localhost:1433;DatabaseName=jbpm | + | SQLSERVER_DRIVER | mssql-jdbc.jar | + | QUARTZ_JNDI | java:jboss/datasources/jbpmDSNotManaged | + | QUARTZ_USERNAME | username | + | QUARTZ_PASSWORD | password | + | QUARTZ_NONXA | true | + | QUARTZ_MIN_POOL_SIZE | 10 | + | QUARTZ_MAX_POOL_SIZE | 10 | + | QUARTZ_JTA | false | + | QUARTZ_URL | jdbc:sqlserver://localhost:1433;DatabaseName=jbpm | + | QUARTZ_DRIVER | mssql-jdbc.jar | + Then XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value mssql-jdbc.jar on XPath //*[local-name()='xa-datasource']/*[local-name()='driver'] + And XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value mssql-jdbc.jar on XPath //*[local-name()='datasource']/*[local-name()='driver'] + And XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value java:jboss/datasources/jbpmDS on XPath //*[local-name()='xa-datasource']/@jndi-name + And XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value java:jboss/datasources/jbpmDSNotManaged on XPath //*[local-name()='datasource']/@jndi-name + And XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value false on XPath //*[local-name()='datasource']/@jta + And file /opt/eap/bin/quartz.properties should contain org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.MSSQLDelegate + And file /opt/eap/bin/quartz.properties should contain org.quartz.dataSource.managedDS.jndiURL=java:jboss/datasources/jbpmDS + And file /opt/eap/bin/quartz.properties should contain org.quartz.dataSource.notManagedDS.jndiURL=java:jboss/datasources/jbpmDSNotManaged + And container log should contain -Dorg.quartz.properties=/opt/eap/bin/quartz.properties + And container log should contain -Dorg.openshift.kieserver.common.sql.dbtype=SQLSERVER + And file /opt/eap/bin/quartz_tables_sqlserver.sql should contain USE jbpm - Scenario: Checks that CLOUD-1476 patch upgrade was successful - When container is ready - Then file /opt/eap/standalone/deployments/kie-server.war/WEB-INF/web.xml should contain org.openshift.kieserver - And file /opt/eap/standalone/deployments/kie-server.war/WEB-INF/security-filter-rules.properties should exist - And file /opt/eap/standalone/deployments/kie-server.war/WEB-INF/lib/kie-api-6.5.0.Final-redhat-2.jar should not exist - And file /opt/eap/standalone/deployments/kie-server.war/WEB-INF/lib/kie-api-6.5.0.Final-redhat-19.jar should exist - And file /opt/eap/standalone/deployments/kie-server.war/WEB-INF/lib/openshift-kieserver-common-1.2.0.Final-redhat-1.jar should exist + Scenario: Checks if the Quartz was successfully configured with DB2, CLOUD-2297 + When container is started with env + | variable | value | + | DATASOURCES | DB2,QUARTZ | + | KIE_SERVER_PERSISTENCE_DIALECT | org.hibernate.dialect.DB2Dialect | + | DB2_JNDI | java:jboss/datasources/jbpmDS | + | DB2_USERNAME | username | + | DB2_PASSWORD | password | + | DB2_NONXA | false | + | DB2_MIN_POOL_SIZE | 10 | + | DB2_MAX_POOL_SIZE | 10 | + | DB2_JTA | true | + | DB2_XA_CONNECTION_PROPERTY_URL | jdbc:db2://myhost:5021/mydb:jbpm | + | DB2_DRIVER | db2-jdbc.jar | + | QUARTZ_JNDI | java:jboss/datasources/jbpmDSNotManaged | + | QUARTZ_USERNAME | username | + | QUARTZ_PASSWORD | password | + | QUARTZ_NONXA | true | + | QUARTZ_MIN_POOL_SIZE | 10 | + | QUARTZ_MAX_POOL_SIZE | 10 | + | QUARTZ_JTA | false | + | QUARTZ_URL | jdbc:db2://myhost:5021/mydb:jbpm | + | QUARTZ_DRIVER | db2-jdbc.jar | + Then XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value db2-jdbc.jar on XPath //*[local-name()='xa-datasource']/*[local-name()='driver'] + And XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value db2-jdbc.jar on XPath //*[local-name()='datasource']/*[local-name()='driver'] + And XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value java:jboss/datasources/jbpmDS on XPath //*[local-name()='xa-datasource']/@jndi-name + And XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value java:jboss/datasources/jbpmDSNotManaged on XPath //*[local-name()='datasource']/@jndi-name + And XML file /opt/eap/standalone/configuration/standalone-openshift.xml should contain value false on XPath //*[local-name()='datasource']/@jta + And file /opt/eap/bin/quartz.properties should contain org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.StdJDBCDelegate + And file /opt/eap/bin/quartz.properties should contain org.quartz.dataSource.managedDS.jndiURL=java:jboss/datasources/jbpmDS + And file /opt/eap/bin/quartz.properties should contain org.quartz.dataSource.notManagedDS.jndiURL=java:jboss/datasources/jbpmDSNotManaged + And container log should contain -Dorg.quartz.properties=/opt/eap/bin/quartz.properties + And container log should contain -Dorg.openshift.kieserver.common.sql.dbtype=DB2 \ No newline at end of file