diff options
author | Smokowski, Kevin (ks6305) <kevin.smokowski@att.com> | 2019-05-17 20:41:13 +0000 |
---|---|---|
committer | Smokowski, Kevin (ks6305) <kevin.smokowski@att.com> | 2019-05-17 20:41:13 +0000 |
commit | 3afef48beebb503e466c611e2b731f3d761e81fb (patch) | |
tree | 4d7db69109acde7234f87dd7aa3f6d0ba4894db5 | |
parent | f175ecd3ba0a785ac1737ab3a4196d5141c05045 (diff) |
Make MdsalHelper.getFullPropertiesPath generic
Make MdsalHelper.getFullPropertiesPath generic and have a default for backwards compatibility
Change-Id: I0d5006b895691d2f0fb2b71803324d58c8819956
Issue-ID: CCSDK-1342
Signed-off-by: Smokowski, Kevin (ks6305) <kevin.smokowski@att.com>
-rwxr-xr-x | sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelper.java | 3 | ||||
-rwxr-xr-x | sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelperTest.java | 13 |
2 files changed, 14 insertions, 2 deletions
diff --git a/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelper.java b/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelper.java index 818077fb7..4d17f8730 100755 --- a/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelper.java +++ b/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelper.java @@ -1325,7 +1325,8 @@ public class MdsalHelper { @Deprecated public static String getFullPropertiesPath(String propertiesFileName) { - return "/opt/bvc/controller/configuration/" + propertiesFileName; + String karafHome = System.getProperty("karaf.home","/opt/lsc/controller"); + return karafHome + "/configuration/" + propertiesFileName; } // This is called when mapping a valid java enumeration back to the yang model value diff --git a/sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelperTest.java b/sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelperTest.java index 56d0369e2..744d48d70 100755 --- a/sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelperTest.java +++ b/sli/provider/src/test/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelperTest.java @@ -349,4 +349,15 @@ public class MdsalHelperTest extends TestCase { MdsalHelper.toProperties(props, address); assertEquals("/cafe:0:0:0:0:0:0:8888", props.getProperty("")); } -}
\ No newline at end of file + + public void testGetFullPropertiesPath() { + String propertiesName = "l3ucpe.properties"; + String path = MdsalHelper.getFullPropertiesPath(propertiesName); + //verify the default works + assertEquals("/opt/lsc/controller/configuration/l3ucpe.properties",path); + System.setProperty("karaf.home", "/opt/opendaylight/current"); + path = MdsalHelper.getFullPropertiesPath(propertiesName); + //verify the system property is read + assertEquals("/opt/opendaylight/current/configuration/l3ucpe.properties",path); + } +} |