diff options
author | 2019-08-14 17:31:50 -0400 | |
---|---|---|
committer | 2019-08-21 13:49:54 -0400 | |
commit | dfe8fa8bc3e75c186589d21b619baa55454ef8a2 (patch) | |
tree | ca3c7dbbe53815afdacb1c97e62ee97ace3f867c /feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/ActiveStandbyFeature.java | |
parent | 59e9b9a8b56d563814ef21a23716959f772f9194 (diff) |
Use pseudo time for junits
Modified feature-active-standby-management and feature-lifecycle
to be able to use TestTimeMulti, eliminating the need for sleep()
calls in the junit tests and speeding the tests up significantly.
Also modified feature-active-standby-management to use a memory DB
for its junit tests.
Change-Id: I6d7ae61bb73cbb19ff405b8d9fb660e92732edbb
Issue-ID: POLICY-1968
Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/ActiveStandbyFeature.java')
-rw-r--r-- | feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/ActiveStandbyFeature.java | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/ActiveStandbyFeature.java b/feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/ActiveStandbyFeature.java index d7c153db..91d30d74 100644 --- a/feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/ActiveStandbyFeature.java +++ b/feature-active-standby-management/src/main/java/org/onap/policy/drools/activestandby/ActiveStandbyFeature.java @@ -21,14 +21,12 @@ package org.onap.policy.drools.activestandby; import java.io.IOException; -import java.util.Date; import java.util.HashMap; import java.util.Map; import java.util.Properties; - import javax.persistence.EntityManagerFactory; import javax.persistence.Persistence; - +import org.onap.policy.common.im.MonitorTime; import org.onap.policy.drools.core.PolicySessionFeatureApi; import org.onap.policy.drools.features.PolicyEngineFeatureApi; import org.onap.policy.drools.statemanagement.StateManagementFeatureApi; @@ -163,7 +161,7 @@ public class ActiveStandbyFeature implements ActiveStandbyFeatureApi, synchronized (myPdpSync) { if (myPdp == null) { - myPdp = new DroolsPdpImpl(resourceName,false,4,new Date()); + myPdp = new DroolsPdpImpl(resourceName,false,4,MonitorTime.getInstance().getDate()); } String siteName = ActiveStandbyProperties.getProperty(ActiveStandbyProperties.SITE_NAME); if (siteName == null) { |