Skip to content

Commit

Permalink
[CLOUD-3549] Placeholder ##DEFAULT_DATASOURCE## is not replaced durin…
Browse files Browse the repository at this point in the history
…g the container startup process
  • Loading branch information
yersan committed Apr 6, 2020
1 parent bae8f11 commit e3feb15
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,16 @@ function writeEEDefaultDatasource() {

# Set the default datasource
local defaultEEDatasourceConfMode
getConfigurationMode "<!-- ##DEFAULT_DATASOURCE## -->" "defaultEEDatasourceConfMode"
getConfigurationMode "##DEFAULT_DATASOURCE##" "defaultEEDatasourceConfMode"
if [ "${defaultEEDatasourceConfMode}" = "xml" ]; then
writeEEDefaultDatasourceXml
elif [ "${defaultEEDatasourceConfMode}" = "cli" ]; then
writeEEDefaultDatasourceCli
else
getConfigurationMode "<!-- ##DEFAULT_DATASOURCE## -->" "defaultEEDatasourceConfMode"
if [ "${defaultEEDatasourceConfMode}" = "xml" ]; then
writeEEDefaultDatasourceXml
elif [ "${defaultEEDatasourceConfMode}" = "cli" ]; then
writeEEDefaultDatasourceCli
fi
fi
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,9 @@ assert_datasources() {
local xpath="//*[local-name()='datasources']"
assert_xml $JBOSS_HOME/standalone/configuration/standalone-openshift.xml "$xpath" $BATS_TEST_DIRNAME/expectations/$expected
}

assert_defaut_bindings() {
local expected=$1
local xpath="//*[local-name()='default-bindings']"
assert_xml $JBOSS_HOME/standalone/configuration/standalone-openshift.xml "$xpath" $BATS_TEST_DIRNAME/expectations/$expected
}
Original file line number Diff line number Diff line change
Expand Up @@ -356,3 +356,11 @@ load common

assert_datasources "no-datasource-enabled-default.xml"
}

@test "inject_datasources: DATASOURCES - DEFAULT BINDINGS" {
ENABLE_GENERATE_DEFAULT_DATASOURCE="true"
run inject_datasources

[ "$status" -eq 0 ]
assert_defaut_bindings "default_bindings_placeholder.xml"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0"?>
<default-bindings context-service="java:jboss/ee/concurrency/context/default"
datasource="java:jboss/datasources/ExampleDS"
jms-connection-factory="##DEFAULT_JMS##"
managed-executor-service="java:jboss/ee/concurrency/executor/default"
managed-scheduled-executor-service="java:jboss/ee/concurrency/scheduler/default"
managed-thread-factory="java:jboss/ee/concurrency/factory/default"/>

0 comments on commit e3feb15

Please sign in to comment.