From 21788cc75a85a6e7b2097c5549957a38178a9197 Mon Sep 17 00:00:00 2001 From: Ryan Goulding Date: Wed, 6 Sep 2017 11:47:00 -0400 Subject: Fix service registration for SDNC sliPluginUtils was using a BundleActivator for Service Instantiation, which is prone to heisenbugs due to indeterminate service instantiation logic. This removes the BundleActivator and instantiates services using blueprint. Since dme2.properties are parsed using Properties instead of using a ManagedService, the decision was to just keep them immutable. Future work may involve making instance variables private in DME2, since currently Dme2Test performs direct member access on DME2 instance variables which is considered bad practices (violates encapsulation). Issue-Id: SDNC-54 Change-Id: Ib1155565e04e9a95d222bc4028a0845d9d81bd82 Signed-off-by: Ryan Goulding --- .../java/org/onap/ccsdk/sli/core/slipluginutils/Dme2Test.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'sliPluginUtils/provider/src/test/java') diff --git a/sliPluginUtils/provider/src/test/java/org/onap/ccsdk/sli/core/slipluginutils/Dme2Test.java b/sliPluginUtils/provider/src/test/java/org/onap/ccsdk/sli/core/slipluginutils/Dme2Test.java index 48c32f452..ab681ad25 100644 --- a/sliPluginUtils/provider/src/test/java/org/onap/ccsdk/sli/core/slipluginutils/Dme2Test.java +++ b/sliPluginUtils/provider/src/test/java/org/onap/ccsdk/sli/core/slipluginutils/Dme2Test.java @@ -72,8 +72,9 @@ public class Dme2Test { @Test public void createDme2EndtoEnd() { - SliPluginUtilsActivator activator = new SliPluginUtilsActivator(); - DME2 dme2 = activator.initDme2("src/test/resources/dme2.e2e.properties"); + Dme2PropertiesProvider provider = + new Dme2PropertiesProvider("src/test/resources/dme2.e2e.properties"); + DME2 dme2 = new DME2(provider); assertEquals("user@sample.com", dme2.aafUserName); assertEquals("fake", dme2.aafPassword); assertEquals("UAT", dme2.envContext); @@ -89,8 +90,9 @@ public class Dme2Test { @Test public void createDme2Prod() { - SliPluginUtilsActivator activator = new SliPluginUtilsActivator(); - DME2 dme2 = activator.initDme2("src/test/resources/dme2.prod.properties"); + Dme2PropertiesProvider provider = + new Dme2PropertiesProvider("src/test/resources/dme2.prod.properties"); + DME2 dme2 = new DME2(provider); assertEquals("user@sample.com", dme2.aafUserName); assertEquals("fake", dme2.aafPassword); assertEquals("PROD", dme2.envContext); -- cgit 1.2.3-korg