summaryrefslogtreecommitdiffstats
path: root/policy-utils/src/test
diff options
context:
space:
mode:
authorJorge Hernandez <jorge.hernandez-herrero@att.com>2019-02-28 10:10:49 -0600
committerJorge Hernandez <jorge.hernandez-herrero@att.com>2019-03-01 09:56:11 -0600
commitb001c1ac5a0b4d938a69adb47f4613f64dc71c1a (patch)
treea83c2887edc25fd4eb24f3f6d485e8f860069c19 /policy-utils/src/test
parent8e9ddde1bb1e3fc3f7b85af653d6251daf7e77d6 (diff)
move all hard install config to environment vars
+ support multiple system properties files with variable interpolation loaded at initialization + support of configurable JVM options (-X, etc ..). + rearrange aaf configuration to avoid {{}} installation variables and use dynamic enviroment variables. + miscellaneous clean up in areas touched and checkstyle. Change-Id: I71ad839778e17eb57c098a2c5cc2bf96e468669a Issue-ID: POLICY-1524 Signed-off-by: Jorge Hernandez <jorge.hernandez-herrero@att.com>
Diffstat (limited to 'policy-utils/src/test')
-rw-r--r--policy-utils/src/test/java/org/onap/policy/drools/utils/PropertyUtilTest.java16
1 files changed, 15 insertions, 1 deletions
diff --git a/policy-utils/src/test/java/org/onap/policy/drools/utils/PropertyUtilTest.java b/policy-utils/src/test/java/org/onap/policy/drools/utils/PropertyUtilTest.java
index 2d5d356c..f05974c6 100644
--- a/policy-utils/src/test/java/org/onap/policy/drools/utils/PropertyUtilTest.java
+++ b/policy-utils/src/test/java/org/onap/policy/drools/utils/PropertyUtilTest.java
@@ -79,7 +79,7 @@ public class PropertyUtilTest {
* Utility method to write a properties file.
*
* @param name the file name, relative to the temporary directory
- * @param the properties to store in the file
+ * @param properties to store in the file
* @return a File instance associated with the newly-created file
* @throws IOException if the file can't be created for some reason
*/
@@ -137,10 +137,24 @@ public class PropertyUtilTest {
assertEquals(prop1, prop2);
Properties prop3 = PropertyUtil.getProperties(INTERPOLATION_PROPERTIES);
+
assertEquals("no", prop3.getProperty(INTERPOLATION_NO));
assertEquals(System.getenv("HOME"), prop3.getProperty(INTERPOLATION_ENV));
assertEquals(LoggerUtil.ROOT_LOGGER, prop3.getProperty(INTERPOLATION_CONST));
assertEquals(System.getProperty("user.home"), prop3.getProperty(INTERPOLATION_SYS));
+
+ Properties prop4 = new Properties();
+ prop4.put(INTERPOLATION_NO, "no");
+ prop4.put(INTERPOLATION_ENV, "${env:HOME}");
+ prop4.put(INTERPOLATION_CONST, "${const:org.onap.policy.drools.utils.logging.LoggerUtil.ROOT_LOGGER}");
+ prop4.put(INTERPOLATION_SYS, "${sys:user.home}");
+
+ PropertyUtil.setSystemProperties(prop4);
+
+ assertEquals("no", System.getProperty(INTERPOLATION_NO));
+ assertEquals(System.getenv("HOME"), System.getProperty(INTERPOLATION_ENV));
+ assertEquals(LoggerUtil.ROOT_LOGGER, System.getProperty(INTERPOLATION_CONST));
+ assertEquals(System.getProperty("user.home"), System.getProperty(INTERPOLATION_SYS));
}
/**