summaryrefslogtreecommitdiffstats
path: root/plugins/grToolkit
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2021-02-17 15:25:45 -0500
committerDan Timoney <dtimoney@att.com>2021-02-18 16:05:55 -0500
commit69e393da4cce52a0491fffff2dc81fbe59aeca08 (patch)
tree404cc750fa69ba2a89c7a2fce921da34db5edda4 /plugins/grToolkit
parent56c27daf1656fd6436f8c818c771cf803079e1ea (diff)
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 <dtimoney@att.com> Change-Id: I7538b719631d8c10c27d059aeb4f70ce92760ebd
Diffstat (limited to 'plugins/grToolkit')
-rwxr-xr-xplugins/grToolkit/provider/pom.xml20
-rwxr-xr-xplugins/grToolkit/provider/src/main/java/org/onap/ccsdk/sli/plugins/grtoolkit/GrToolkitProvider.java3
-rwxr-xr-xplugins/grToolkit/provider/src/main/resources/gr-toolkit.properties2
-rwxr-xr-xplugins/grToolkit/provider/src/test/resources/gr-toolkit.properties2
-rwxr-xr-xplugins/grToolkit/provider/src/test/resources/single/gr-toolkit.properties2
-rwxr-xr-xplugins/grToolkit/provider/src/test/resources/six/gr-toolkit.properties2
-rwxr-xr-xplugins/grToolkit/provider/src/test/resources/three/gr-toolkit.properties2
7 files changed, 27 insertions, 6 deletions
diff --git a/plugins/grToolkit/provider/pom.xml b/plugins/grToolkit/provider/pom.xml
index 5c77331c0..b44436697 100755
--- a/plugins/grToolkit/provider/pom.xml
+++ b/plugins/grToolkit/provider/pom.xml
@@ -118,6 +118,26 @@
</instructions>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <environmentVariables>
+ <ODL_USER>admin</ODL_USER>
+ <ODL_PASSWORD>admin</ODL_PASSWORD>
+ </environmentVariables>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-failsafe-plugin</artifactId>
+ <configuration>
+ <environmentVariables>
+ <ODL_USER>admin</ODL_USER>
+ <ODL_PASSWORD>admin</ODL_PASSWORD>
+ </environmentVariables>
+ </configuration>
+ </plugin>
</plugins>
</build>
</project>
diff --git a/plugins/grToolkit/provider/src/main/java/org/onap/ccsdk/sli/plugins/grtoolkit/GrToolkitProvider.java b/plugins/grToolkit/provider/src/main/java/org/onap/ccsdk/sli/plugins/grtoolkit/GrToolkitProvider.java
index 5a8730bff..8da2f09ae 100755
--- a/plugins/grToolkit/provider/src/main/java/org/onap/ccsdk/sli/plugins/grtoolkit/GrToolkitProvider.java
+++ b/plugins/grToolkit/provider/src/main/java/org/onap/ccsdk/sli/plugins/grtoolkit/GrToolkitProvider.java
@@ -45,6 +45,7 @@ import org.apache.commons.lang.StringUtils;
import org.json.JSONArray;
import org.json.JSONObject;
import org.onap.ccsdk.sli.core.dblib.DbLibService;
+import org.onap.ccsdk.sli.core.utils.common.EnvProperties;
import org.onap.ccsdk.sli.plugins.grtoolkit.connection.ConnectionManager;
import org.onap.ccsdk.sli.plugins.grtoolkit.connection.ConnectionResponse;
import org.onap.ccsdk.sli.plugins.grtoolkit.data.AdminHealth;
@@ -183,7 +184,7 @@ public class GrToolkitProvider implements AutoCloseable, GrToolkitService, DataT
*/
private void setProperties() {
log.info("Loading properties from {}", PROPERTIES_FILE);
- properties = new Properties();
+ properties = new EnvProperties();
File propertiesFile = new File(PROPERTIES_FILE);
if(!propertiesFile.exists()) {
log.warn("setProperties(): Properties file not found.");
diff --git a/plugins/grToolkit/provider/src/main/resources/gr-toolkit.properties b/plugins/grToolkit/provider/src/main/resources/gr-toolkit.properties
index e3463df08..bce40620e 100755
--- a/plugins/grToolkit/provider/src/main/resources/gr-toolkit.properties
+++ b/plugins/grToolkit/provider/src/main/resources/gr-toolkit.properties
@@ -24,7 +24,7 @@ adm.fqdn=
adm.healthcheck=/healthcheck
adm.port.http=8181
adm.port.ssl=8443
-controller.credentials=admin:admin
+controller.credentials=${ODL_USER}:${ODL_PASSWORD}
controller.useSsl=true
controller.port.http=8181
controller.port.ssl=8443
diff --git a/plugins/grToolkit/provider/src/test/resources/gr-toolkit.properties b/plugins/grToolkit/provider/src/test/resources/gr-toolkit.properties
index 52b19bf51..d3b15e70e 100755
--- a/plugins/grToolkit/provider/src/test/resources/gr-toolkit.properties
+++ b/plugins/grToolkit/provider/src/test/resources/gr-toolkit.properties
@@ -24,7 +24,7 @@ adm.fqdn=localhost
adm.healthcheck=/adm/healthcheck
adm.port.http=9999
adm.port.ssl=19999
-controller.credentials=admin:admin
+controller.credentials=${ODL_USER}:${ODL_PASSWORD}
controller.useSsl=false
controller.port.http=9999
controller.port.ssl=19999
diff --git a/plugins/grToolkit/provider/src/test/resources/single/gr-toolkit.properties b/plugins/grToolkit/provider/src/test/resources/single/gr-toolkit.properties
index cc7820e90..040f082df 100755
--- a/plugins/grToolkit/provider/src/test/resources/single/gr-toolkit.properties
+++ b/plugins/grToolkit/provider/src/test/resources/single/gr-toolkit.properties
@@ -23,7 +23,7 @@ adm.fqdn=localhost
adm.healthcheck=/adm/healthcheck
adm.port.http=9999
adm.port.ssl=19999
-controller.credentials=admin:admin
+controller.credentials=${ODL_USER}:${ODL_PASSWORD}
controller.useSsl=false
controller.port.http=9999
controller.port.ssl=19999
diff --git a/plugins/grToolkit/provider/src/test/resources/six/gr-toolkit.properties b/plugins/grToolkit/provider/src/test/resources/six/gr-toolkit.properties
index 54c9af742..f078634d3 100755
--- a/plugins/grToolkit/provider/src/test/resources/six/gr-toolkit.properties
+++ b/plugins/grToolkit/provider/src/test/resources/six/gr-toolkit.properties
@@ -23,7 +23,7 @@ adm.fqdn=localhost
adm.healthcheck=/adm/healthcheck
adm.port.http=9999
adm.port.ssl=19999
-controller.credentials=admin:admin
+controller.credentials=${ODL_USER}:${ODK_PASSWORD}
controller.useSsl=false
controller.port.http=9999
controller.port.ssl=19999
diff --git a/plugins/grToolkit/provider/src/test/resources/three/gr-toolkit.properties b/plugins/grToolkit/provider/src/test/resources/three/gr-toolkit.properties
index cc7820e90..040f082df 100755
--- a/plugins/grToolkit/provider/src/test/resources/three/gr-toolkit.properties
+++ b/plugins/grToolkit/provider/src/test/resources/three/gr-toolkit.properties
@@ -23,7 +23,7 @@ adm.fqdn=localhost
adm.healthcheck=/adm/healthcheck
adm.port.http=9999
adm.port.ssl=19999
-controller.credentials=admin:admin
+controller.credentials=${ODL_USER}:${ODL_PASSWORD}
controller.useSsl=false
controller.port.http=9999
controller.port.ssl=19999