aboutsummaryrefslogtreecommitdiffstats
path: root/main/src
diff options
context:
space:
mode:
authorkrishnajinka <krishna.jinka@gmail.com>2018-09-02 23:12:33 +0900
committerramverma <ram.krishna.verma@ericsson.com>2018-09-03 12:15:42 +0100
commit15dc61dfb2fc43c3d8b1a95e51e9cab5d18f6e81 (patch)
tree5229290a5461c610621050fcc38aa210fe018716 /main/src
parente705197bb18af558fb7ea853b01e1297521763f2 (diff)
Set Activator alive to false in terminate
During terminate the alive status should be set to false instead of true Adding test case to cover the scenario Issue-ID: POLICY-1017 Change-Id: I5c1d13172902cc75da8d0819e6e107b4e8d1b246 Signed-off-by: krisjinka <kris.jinka@samsung.com> Signed-off-by: ramverma <ram.krishna.verma@ericsson.com>
Diffstat (limited to 'main/src')
-rw-r--r--main/src/main/java/org/onap/policy/distribution/main/startstop/DistributionActivator.java2
-rw-r--r--main/src/test/java/org/onap/policy/distribution/main/startstop/TestDistributionActivator.java3
2 files changed, 4 insertions, 1 deletions
diff --git a/main/src/main/java/org/onap/policy/distribution/main/startstop/DistributionActivator.java b/main/src/main/java/org/onap/policy/distribution/main/startstop/DistributionActivator.java
index 70724a12..e68a37d5 100644
--- a/main/src/main/java/org/onap/policy/distribution/main/startstop/DistributionActivator.java
+++ b/main/src/main/java/org/onap/policy/distribution/main/startstop/DistributionActivator.java
@@ -113,7 +113,7 @@ public class DistributionActivator {
}
receptionHandlersMap.clear();
deregisterToParameterService(distributionParameterGroup);
- DistributionActivator.setAlive(true);
+ DistributionActivator.setAlive(false);
// Stop the distribution rest server
restServer.stop();
diff --git a/main/src/test/java/org/onap/policy/distribution/main/startstop/TestDistributionActivator.java b/main/src/test/java/org/onap/policy/distribution/main/startstop/TestDistributionActivator.java
index c901b5d9..294f9081 100644
--- a/main/src/test/java/org/onap/policy/distribution/main/startstop/TestDistributionActivator.java
+++ b/main/src/test/java/org/onap/policy/distribution/main/startstop/TestDistributionActivator.java
@@ -21,6 +21,7 @@
package org.onap.policy.distribution.main.startstop;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
@@ -49,6 +50,7 @@ public class TestDistributionActivator {
final DistributionActivator activator = new DistributionActivator(parGroup);
activator.initialize();
assertTrue(activator.getParameterGroup().isValid());
+ assertTrue(DistributionActivator.isAlive());
assertEquals(CommonTestData.DISTRIBUTION_GROUP_NAME, activator.getParameterGroup().getName());
assertEquals(CommonTestData.RECEPTION_HANDLER_TYPE,
activator.getParameterGroup().getReceptionHandlerParameters()
@@ -62,5 +64,6 @@ public class TestDistributionActivator {
.get(CommonTestData.DUMMY_RECEPTION_HANDLER_KEY).getPluginHandlerParameters()
.getPolicyForwarders().get(CommonTestData.DUMMY_ENGINE_FORWARDER_KEY).getForwarderType());
activator.terminate();
+ assertFalse(DistributionActivator.isAlive());
}
}