From 69e393da4cce52a0491fffff2dc81fbe59aeca08 Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Wed, 17 Feb 2021 15:25:45 -0500 Subject: Add new EnvProperties class Added new class EnvProperties, which extends java.util.Properties and supports property values containing embedded environment variable references. Updated code to use this class to load svclogic.properties, and updated dmaap listener to use that class to load dmaap listener configuration. Issue-ID: SDNC-1482 Signed-off-by: Dan Timoney Change-Id: I7538b719631d8c10c27d059aeb4f70ce92760ebd --- northbound/lcm/provider/pom.xml | 27 ++++++++++++++++++++++ .../onap/ccsdk/sli/northbound/TestLcmProvider.java | 3 ++- .../src/test/resources/svclogic.properties | 8 +++---- 3 files changed, 33 insertions(+), 5 deletions(-) (limited to 'northbound/lcm') diff --git a/northbound/lcm/provider/pom.xml b/northbound/lcm/provider/pom.xml index bd6f762d0..57c75fe7c 100755 --- a/northbound/lcm/provider/pom.xml +++ b/northbound/lcm/provider/pom.xml @@ -89,4 +89,31 @@ test + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + dummyUser + dummyPassword + dummyDatabase + + + + + org.apache.maven.plugins + maven-failsafe-plugin + + + dummyUser + dummyPassword + dummyDatabase + + + + + diff --git a/northbound/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java b/northbound/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java index 85325cb56..09cf97cc4 100644 --- a/northbound/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java +++ b/northbound/lcm/provider/src/test/java/org/onap/ccsdk/sli/northbound/TestLcmProvider.java @@ -20,6 +20,7 @@ import org.onap.ccsdk.sli.core.sli.SvcLogicStoreFactory; import org.onap.ccsdk.sli.core.sli.provider.SvcLogicClassResolver; import org.onap.ccsdk.sli.core.sli.provider.SvcLogicPropertiesProviderImpl; import org.onap.ccsdk.sli.core.sli.provider.SvcLogicServiceImpl; +import org.onap.ccsdk.sli.core.utils.common.EnvProperties; import org.opendaylight.mdsal.binding.api.NotificationPublishService; import org.opendaylight.mdsal.binding.api.RpcProviderService; import org.opendaylight.mdsal.dom.api.DOMDataBroker; @@ -134,7 +135,7 @@ public class TestLcmProvider { // Load svclogic.properties and get a SvcLogicStore InputStream propStr = TestLcmProvider.class.getResourceAsStream("/svclogic.properties"); - Properties svcprops = new Properties(); + Properties svcprops = new EnvProperties(); svcprops.load(propStr); SvcLogicStore store = SvcLogicStoreFactory.getSvcLogicStore(svcprops); diff --git a/northbound/lcm/provider/src/test/resources/svclogic.properties b/northbound/lcm/provider/src/test/resources/svclogic.properties index 426960f76..85818d7b6 100644 --- a/northbound/lcm/provider/src/test/resources/svclogic.properties +++ b/northbound/lcm/provider/src/test/resources/svclogic.properties @@ -20,8 +20,8 @@ ### org.onap.ccsdk.sli.dbtype = jdbc -org.onap.ccsdk.sli.jdbc.url=jdbc:derby:memory:sdnctl;create=true +org.onap.ccsdk.sli.jdbc.url=jdbc:derby:memory:${MYSQL_DATABASE};create=true org.onap.ccsdk.sli.jdbc.driver=org.apache.derby.jdbc.EmbeddedDriver -org.onap.ccsdk.sli.jdbc.database = sdnctl -org.onap.ccsdk.sli.jdbc.user = test -org.onap.ccsdk.sli.jdbc.password = test +org.onap.ccsdk.sli.jdbc.database = ${MYSQL_DATABASE} +org.onap.ccsdk.sli.jdbc.user = ${MYSQL_USER} +org.onap.ccsdk.sli.jdbc.password = ${MYSQL_PASSWORD} -- cgit 1.2.3-korg