From a89bf9b671ab1836e1ae111084b02d73965851f4 Mon Sep 17 00:00:00 2001 From: Kevin McKiou Date: Thu, 10 May 2018 18:19:44 -0500 Subject: Update of StandbyStateManagementTest Patch 1: This change modifies StandbyStateManagementTest testPMStandbyStateChangeNotifer() to use a fresh instance of StateManagement to avoid interaction with previous tests. Issue-ID: POLICY-790 Change-Id: I5907ba6b50091bc4f7789f102f48a853d8498ed5 Signed-off-by: Kevin McKiou --- .../test/StandbyStateManagementTest.java | 25 ++++++---------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/feature-active-standby-management/src/test/java/org/onap/policy/drools/controller/test/StandbyStateManagementTest.java b/feature-active-standby-management/src/test/java/org/onap/policy/drools/controller/test/StandbyStateManagementTest.java index 0ad21f03..b79deeb0 100644 --- a/feature-active-standby-management/src/test/java/org/onap/policy/drools/controller/test/StandbyStateManagementTest.java +++ b/feature-active-standby-management/src/test/java/org/onap/policy/drools/controller/test/StandbyStateManagementTest.java @@ -219,27 +219,14 @@ public class StandbyStateManagementTest { Properties activeStandbyProperties = new Properties(); activeStandbyProperties.load(new FileInputStream(new File( configDir + "/feature-active-standby-management.properties"))); + + String resourceName = "testPMS"; + activeStandbyProperties.setProperty("resource.name", resourceName); ActiveStandbyProperties.initProperties(activeStandbyProperties); - String thisPdpId = ActiveStandbyProperties.getProperty(ActiveStandbyProperties.NODE_NAME); - logger.debug("testPMStandbyStateChangeNotifier: Getting StateManagementFeatureAPI"); - - StateManagementFeatureAPI sm = null; - for (StateManagementFeatureAPI feature : StateManagementFeatureAPI.impl.getList()) - { - ((PolicySessionFeatureAPI) feature).globalInit(null, configDir); - sm = feature; - logger.debug("testPMStandbyStateChangeNotifier stateManagementFeature.getResourceName(): {}", sm.getResourceName()); - break; - } - if(sm == null){ - logger.error("testPMStandbyStateChangeNotifier failed to initialize. " - + "Unable to get instance of StateManagementFeatureAPI " - + "with resourceID: {}", thisPdpId); - logger.debug("testPMStandbyStateChangeNotifier failed to initialize. " - + "Unable to get instance of StateManagementFeatureAPI " - + "with resourceID: {}", thisPdpId); - } + logger.debug("testPMStandbyStateChangeNotifier: Getting StateManagement instance"); + + StateManagement sm = new StateManagement(emfx, resourceName); //Create an instance of the Observer PMStandbyStateChangeNotifier pmNotifier = new PMStandbyStateChangeNotifier(); -- cgit 1.2.3-korg