summaryrefslogtreecommitdiffstats
path: root/feature-active-standby-management/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'feature-active-standby-management/src/test')
-rw-r--r--feature-active-standby-management/src/test/java/org/onap/policy/drools/activestandby/DroolsPdpObjectTest.java8
-rw-r--r--feature-active-standby-management/src/test/java/org/onap/policy/drools/controller/test/AllSeemsWellTest.java6
-rw-r--r--feature-active-standby-management/src/test/java/org/onap/policy/drools/controller/test/StandbyStateManagementTest.java36
3 files changed, 27 insertions, 23 deletions
diff --git a/feature-active-standby-management/src/test/java/org/onap/policy/drools/activestandby/DroolsPdpObjectTest.java b/feature-active-standby-management/src/test/java/org/onap/policy/drools/activestandby/DroolsPdpObjectTest.java
index 842d6c7f..52000fd5 100644
--- a/feature-active-standby-management/src/test/java/org/onap/policy/drools/activestandby/DroolsPdpObjectTest.java
+++ b/feature-active-standby-management/src/test/java/org/onap/policy/drools/activestandby/DroolsPdpObjectTest.java
@@ -87,7 +87,7 @@ public class DroolsPdpObjectTest {
@Test
public void testNullSafeCompare() {
// self, when null
- pdp.setSiteName(null);
+ pdp.setSite(null);
assertEquals(0, pdp.comparePriority(pdp));
// both null
@@ -138,7 +138,7 @@ public class DroolsPdpObjectTest {
};
pdp2.setPdpId(PDP_ID);
- pdp2.setSiteName(SITE2);
+ pdp2.setSite(SITE2);
pdp2.setPriority(PRIORITY);
// should use overridden comparison method
@@ -152,7 +152,7 @@ public class DroolsPdpObjectTest {
private MyPdp makePdp(String id, String site, int priority) {
MyPdp pdp2 = new MyPdp();
- pdp2.setSiteName(site);
+ pdp2.setSite(site);
pdp2.setPdpId(id);
pdp2.setPriority(priority);
@@ -166,7 +166,7 @@ public class DroolsPdpObjectTest {
private boolean designated;
private int priority;
private Date updatedDate;
- private String siteName;
+ private String site;
private Date designatedDate;
}
}
diff --git a/feature-active-standby-management/src/test/java/org/onap/policy/drools/controller/test/AllSeemsWellTest.java b/feature-active-standby-management/src/test/java/org/onap/policy/drools/controller/test/AllSeemsWellTest.java
index b5b89941..5e9b360f 100644
--- a/feature-active-standby-management/src/test/java/org/onap/policy/drools/controller/test/AllSeemsWellTest.java
+++ b/feature-active-standby-management/src/test/java/org/onap/policy/drools/controller/test/AllSeemsWellTest.java
@@ -39,6 +39,7 @@ import org.junit.BeforeClass;
import org.junit.Test;
import org.onap.policy.common.im.StateManagement;
import org.onap.policy.drools.activestandby.ActiveStandbyFeatureApi;
+import org.onap.policy.drools.activestandby.ActiveStandbyFeatureApiConstants;
import org.onap.policy.drools.activestandby.ActiveStandbyProperties;
import org.onap.policy.drools.activestandby.DroolsPdpEntity;
import org.onap.policy.drools.activestandby.DroolsPdpImpl;
@@ -47,6 +48,7 @@ import org.onap.policy.drools.activestandby.DroolsPdpsElectionHandler;
import org.onap.policy.drools.activestandby.JpaDroolsPdpsConnector;
import org.onap.policy.drools.core.PolicySessionFeatureApi;
import org.onap.policy.drools.statemanagement.StateManagementFeatureApi;
+import org.onap.policy.drools.statemanagement.StateManagementFeatureApiConstants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -235,7 +237,7 @@ public class AllSeemsWellTest {
// discovered by the ActiveStandbyFeature when the election handler initializes.
StateManagementFeatureApi stateManagementFeatureApi = null;
- for (StateManagementFeatureApi feature : StateManagementFeatureApi.impl.getList()) {
+ for (StateManagementFeatureApi feature : StateManagementFeatureApiConstants.getImpl().getList()) {
((PolicySessionFeatureApi) feature).globalInit(null, configDir);
stateManagementFeatureApi = feature;
logger.debug("testAllSeemsWell stateManagementFeature.getResourceName(): {}",
@@ -255,7 +257,7 @@ public class AllSeemsWellTest {
// Create an ActiveStandbyFeature and initialize it. It will discover the StateManagementFeature
// that has been created.
ActiveStandbyFeatureApi activeStandbyFeature = null;
- for (ActiveStandbyFeatureApi feature : ActiveStandbyFeatureApi.impl.getList()) {
+ for (ActiveStandbyFeatureApi feature : ActiveStandbyFeatureApiConstants.getImpl().getList()) {
((PolicySessionFeatureApi) feature).globalInit(null, configDir);
activeStandbyFeature = feature;
logger.debug("testAllSeemsWell activeStandbyFeature.getResourceName(): {}",
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 b277850c..8bc8489a 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
@@ -44,6 +44,7 @@ import org.onap.policy.common.im.IntegrityMonitor;
import org.onap.policy.common.im.StandbyStatusException;
import org.onap.policy.common.im.StateManagement;
import org.onap.policy.drools.activestandby.ActiveStandbyFeatureApi;
+import org.onap.policy.drools.activestandby.ActiveStandbyFeatureApiConstants;
import org.onap.policy.drools.activestandby.ActiveStandbyProperties;
import org.onap.policy.drools.activestandby.DroolsPdp;
import org.onap.policy.drools.activestandby.DroolsPdpEntity;
@@ -54,6 +55,7 @@ import org.onap.policy.drools.activestandby.JpaDroolsPdpsConnector;
import org.onap.policy.drools.activestandby.PmStandbyStateChangeNotifier;
import org.onap.policy.drools.core.PolicySessionFeatureApi;
import org.onap.policy.drools.statemanagement.StateManagementFeatureApi;
+import org.onap.policy.drools.statemanagement.StateManagementFeatureApiConstants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -352,7 +354,7 @@ public class StandbyStateManagementTest {
// discovered by the ActiveStandbyFeature when the election handler initializes.
StateManagementFeatureApi stateManagementFeature = null;
- for (StateManagementFeatureApi feature : StateManagementFeatureApi.impl.getList()) {
+ for (StateManagementFeatureApi feature : StateManagementFeatureApiConstants.getImpl().getList()) {
((PolicySessionFeatureApi) feature).globalInit(null, configDir);
stateManagementFeature = feature;
logger.debug("testColdStandby stateManagementFeature.getResourceName(): {}",
@@ -471,7 +473,7 @@ public class StandbyStateManagementTest {
// discovered by the ActiveStandbyFeature when the election handler initializes.
StateManagementFeatureApi stateManagementFeature = null;
- for (StateManagementFeatureApi feature : StateManagementFeatureApi.impl.getList()) {
+ for (StateManagementFeatureApi feature : StateManagementFeatureApiConstants.getImpl().getList()) {
((PolicySessionFeatureApi) feature).globalInit(null, configDir);
stateManagementFeature = feature;
logger.debug("testComputeMostRecentPrimary stateManagementFeature.getResourceName(): {}",
@@ -620,21 +622,21 @@ public class StandbyStateManagementTest {
long designatedDateMs = new Date().getTime();
DroolsPdp pdp1 = new DroolsPdpImpl("pdp1", false, 4, new Date());
pdp1.setDesignatedDate(new Date(designatedDateMs - 2));
- pdp1.setSiteName("site1");
+ pdp1.setSite("site1");
DroolsPdp pdp2 = new DroolsPdpImpl("pdp2", false, 4, new Date());
pdp2.setDesignatedDate(new Date(designatedDateMs - 3));
- pdp2.setSiteName("site1");
+ pdp2.setSite("site1");
//oldest
DroolsPdp pdp3 = new DroolsPdpImpl("pdp3", false, 4, new Date());
pdp3.setDesignatedDate(new Date(designatedDateMs - 4));
- pdp3.setSiteName("site2");
+ pdp3.setSite("site2");
DroolsPdp pdp4 = new DroolsPdpImpl("pdp4", false, 4, new Date());
//most recent
pdp4.setDesignatedDate(new Date(designatedDateMs));
- pdp4.setSiteName("site2");
+ pdp4.setSite("site2");
ArrayList<DroolsPdp> listOfAllPdps = new ArrayList<DroolsPdp>();
listOfAllPdps.add(pdp1);
@@ -653,7 +655,7 @@ public class StandbyStateManagementTest {
// discovered by the ActiveStandbyFeature when the election handler initializes.
StateManagementFeatureApi stateManagementFeature = null;
- for (StateManagementFeatureApi feature : StateManagementFeatureApi.impl.getList()) {
+ for (StateManagementFeatureApi feature : StateManagementFeatureApiConstants.getImpl().getList()) {
((PolicySessionFeatureApi) feature).globalInit(null, configDir);
stateManagementFeature = feature;
logger.debug("testComputeDesignatedPdp stateManagementFeature.getResourceName(): {}",
@@ -793,7 +795,7 @@ public class StandbyStateManagementTest {
// discovered by the ActiveStandbyFeature when the election handler initializes.
StateManagementFeatureApi smf = null;
- for (StateManagementFeatureApi feature : StateManagementFeatureApi.impl.getList()) {
+ for (StateManagementFeatureApi feature : StateManagementFeatureApiConstants.getImpl().getList()) {
((PolicySessionFeatureApi) feature).globalInit(null, configDir);
smf = feature;
logger.debug("testColdStandby stateManagementFeature.getResourceName(): {}", smf.getResourceName());
@@ -811,7 +813,7 @@ public class StandbyStateManagementTest {
// Create an ActiveStandbyFeature and initialize it. It will discover the StateManagementFeature
// that has been created.
ActiveStandbyFeatureApi activeStandbyFeature = null;
- for (ActiveStandbyFeatureApi feature : ActiveStandbyFeatureApi.impl.getList()) {
+ for (ActiveStandbyFeatureApi feature : ActiveStandbyFeatureApiConstants.getImpl().getList()) {
((PolicySessionFeatureApi) feature).globalInit(null, configDir);
activeStandbyFeature = feature;
logger.debug("testColdStandby activeStandbyFeature.getResourceName(): {}",
@@ -924,7 +926,7 @@ public class StandbyStateManagementTest {
// discovered by the ActiveStandbyFeature when the election handler initializes.
StateManagementFeatureApi smf = null;
- for (StateManagementFeatureApi feature : StateManagementFeatureApi.impl.getList()) {
+ for (StateManagementFeatureApi feature : StateManagementFeatureApiConstants.getImpl().getList()) {
((PolicySessionFeatureApi) feature).globalInit(null, configDir);
smf = feature;
logger.debug("testHotStandby1 stateManagementFeature.getResourceName(): {}", smf.getResourceName());
@@ -942,7 +944,7 @@ public class StandbyStateManagementTest {
// Create an ActiveStandbyFeature and initialize it. It will discover the StateManagementFeature
// that has been created.
ActiveStandbyFeatureApi activeStandbyFeature = null;
- for (ActiveStandbyFeatureApi feature : ActiveStandbyFeatureApi.impl.getList()) {
+ for (ActiveStandbyFeatureApi feature : ActiveStandbyFeatureApiConstants.getImpl().getList()) {
((PolicySessionFeatureApi) feature).globalInit(null, configDir);
activeStandbyFeature = feature;
logger.debug("testHotStandby1 activeStandbyFeature.getResourceName(): {}",
@@ -1081,7 +1083,7 @@ public class StandbyStateManagementTest {
// discovered by the ActiveStandbyFeature when the election handler initializes.
StateManagementFeatureApi sm2 = null;
- for (StateManagementFeatureApi feature : StateManagementFeatureApi.impl.getList()) {
+ for (StateManagementFeatureApi feature : StateManagementFeatureApiConstants.getImpl().getList()) {
((PolicySessionFeatureApi) feature).globalInit(null, configDir);
sm2 = feature;
logger.debug("testHotStandby2 stateManagementFeature.getResourceName(): {}", sm2.getResourceName());
@@ -1099,7 +1101,7 @@ public class StandbyStateManagementTest {
// Create an ActiveStandbyFeature and initialize it. It will discover the StateManagementFeature
// that has been created.
ActiveStandbyFeatureApi activeStandbyFeature = null;
- for (ActiveStandbyFeatureApi feature : ActiveStandbyFeatureApi.impl.getList()) {
+ for (ActiveStandbyFeatureApi feature : ActiveStandbyFeatureApiConstants.getImpl().getList()) {
((PolicySessionFeatureApi) feature).globalInit(null, configDir);
activeStandbyFeature = feature;
logger.debug("testHotStandby2 activeStandbyFeature.getResourceName(): {}",
@@ -1238,7 +1240,7 @@ public class StandbyStateManagementTest {
// discovered by the ActiveStandbyFeature when the election handler initializes.
StateManagementFeatureApi sm = null;
- for (StateManagementFeatureApi feature : StateManagementFeatureApi.impl.getList()) {
+ for (StateManagementFeatureApi feature : StateManagementFeatureApiConstants.getImpl().getList()) {
((PolicySessionFeatureApi) feature).globalInit(null, configDir);
sm = feature;
logger.debug("testLocking1 stateManagementFeature.getResourceName(): {}", sm.getResourceName());
@@ -1256,7 +1258,7 @@ public class StandbyStateManagementTest {
// Create an ActiveStandbyFeature and initialize it. It will discover the StateManagementFeature
// that has been created.
ActiveStandbyFeatureApi activeStandbyFeature = null;
- for (ActiveStandbyFeatureApi feature : ActiveStandbyFeatureApi.impl.getList()) {
+ for (ActiveStandbyFeatureApi feature : ActiveStandbyFeatureApiConstants.getImpl().getList()) {
((PolicySessionFeatureApi) feature).globalInit(null, configDir);
activeStandbyFeature = feature;
logger.debug("testLocking1 activeStandbyFeature.getResourceName(): {}",
@@ -1486,7 +1488,7 @@ public class StandbyStateManagementTest {
// discovered by the ActiveStandbyFeature when the election handler initializes.
StateManagementFeatureApi sm = null;
- for (StateManagementFeatureApi feature : StateManagementFeatureApi.impl.getList()) {
+ for (StateManagementFeatureApi feature : StateManagementFeatureApiConstants.getImpl().getList()) {
((PolicySessionFeatureApi) feature).globalInit(null, configDir);
sm = feature;
logger.debug("testLocking2 stateManagementFeature.getResourceName(): {}", sm.getResourceName());
@@ -1504,7 +1506,7 @@ public class StandbyStateManagementTest {
// Create an ActiveStandbyFeature and initialize it. It will discover the StateManagementFeature
// that has been created.
ActiveStandbyFeatureApi activeStandbyFeature = null;
- for (ActiveStandbyFeatureApi feature : ActiveStandbyFeatureApi.impl.getList()) {
+ for (ActiveStandbyFeatureApi feature : ActiveStandbyFeatureApiConstants.getImpl().getList()) {
((PolicySessionFeatureApi) feature).globalInit(null, configDir);
activeStandbyFeature = feature;
logger.debug("testLocking2 activeStandbyFeature.getResourceName(): {}",