diff options
author | Kevin McKiou <km097d@att.com> | 2018-05-10 18:19:44 -0500 |
---|---|---|
committer | Kevin McKiou <km097d@att.com> | 2018-05-10 18:20:13 -0500 |
commit | a89bf9b671ab1836e1ae111084b02d73965851f4 (patch) | |
tree | 75b0d393260a2394d978d47ce23866a3fe7fc905 /feature-active-standby-management/src | |
parent | 49e77b6405ef7d286bdd667f2a689b20022351fc (diff) |
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 <km097d@att.com>
Diffstat (limited to 'feature-active-standby-management/src')
-rw-r--r-- | feature-active-standby-management/src/test/java/org/onap/policy/drools/controller/test/StandbyStateManagementTest.java | 25 |
1 files 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(); |