diff options
author | Jim Hahn <jrh3@att.com> | 2019-08-13 15:52:22 -0400 |
---|---|---|
committer | Jim Hahn <jrh3@att.com> | 2019-08-15 09:21:28 -0400 |
commit | fdaae76549bafb2e482c02fb26de719c69431b48 (patch) | |
tree | a3f477da55f80fe7e4bed3d959d8089cf1971438 /controlloop/common/feature-controlloop-trans/src | |
parent | 9e8023a455633c7daf0dd291c6268986e39352d7 (diff) |
Modify to work with new drools-pdp
Due to sonar fixes, drools-pdp changed in a way that requires changes
to drools-applications. In the case of template.demo, lots of test cases
had to be modified, so they were refactored to extract common setup and
tear down code.
Fixed checkstyle issues.
Fixed license date.
Change-Id: Ie9e0239b95916ae7ef8c1b669987f7bb07d841b9
Issue-ID: POLICY-1968
Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'controlloop/common/feature-controlloop-trans/src')
2 files changed, 10 insertions, 12 deletions
diff --git a/controlloop/common/feature-controlloop-trans/src/main/java/org/onap/policy/drools/apps/controlloop/feature/trans/CacheBasedControlLoopMetricsManager.java b/controlloop/common/feature-controlloop-trans/src/main/java/org/onap/policy/drools/apps/controlloop/feature/trans/CacheBasedControlLoopMetricsManager.java index b2a82a29e..9dc4c5ad3 100644 --- a/controlloop/common/feature-controlloop-trans/src/main/java/org/onap/policy/drools/apps/controlloop/feature/trans/CacheBasedControlLoopMetricsManager.java +++ b/controlloop/common/feature-controlloop-trans/src/main/java/org/onap/policy/drools/apps/controlloop/feature/trans/CacheBasedControlLoopMetricsManager.java @@ -24,7 +24,6 @@ import com.google.common.cache.CacheBuilder; import com.google.common.cache.CacheLoader; import com.google.common.cache.LoadingCache; import com.google.common.cache.RemovalListener; - import java.time.Instant; import java.time.ZonedDateTime; import java.util.ArrayList; @@ -32,10 +31,9 @@ import java.util.List; import java.util.Properties; import java.util.UUID; import java.util.concurrent.TimeUnit; - import org.onap.policy.controlloop.ControlLoopOperation; import org.onap.policy.controlloop.VirtualControlLoopNotification; -import org.onap.policy.drools.persistence.SystemPersistence; +import org.onap.policy.drools.persistence.SystemPersistenceConstants; import org.onap.policy.drools.system.PolicyController; import org.onap.policy.drools.utils.logging.MdcTransaction; import org.slf4j.Logger; @@ -57,8 +55,8 @@ class CacheBasedControlLoopMetricsManager implements ControlLoopMetrics { public CacheBasedControlLoopMetricsManager() { - Properties properties = - SystemPersistence.manager.getProperties(ControlLoopMetricsFeature.CONFIGURATION_PROPERTIES_NAME); + Properties properties = SystemPersistenceConstants.getManager() + .getProperties(ControlLoopMetricsFeature.CONFIGURATION_PROPERTIES_NAME); /* cache size */ diff --git a/controlloop/common/feature-controlloop-trans/src/test/java/org/onap/policy/drools/apps/controlloop/feature/trans/ControlLoopMetricsFeatureTest.java b/controlloop/common/feature-controlloop-trans/src/test/java/org/onap/policy/drools/apps/controlloop/feature/trans/ControlLoopMetricsFeatureTest.java index bbbcc132f..b416736ab 100644 --- a/controlloop/common/feature-controlloop-trans/src/test/java/org/onap/policy/drools/apps/controlloop/feature/trans/ControlLoopMetricsFeatureTest.java +++ b/controlloop/common/feature-controlloop-trans/src/test/java/org/onap/policy/drools/apps/controlloop/feature/trans/ControlLoopMetricsFeatureTest.java @@ -36,9 +36,9 @@ import org.junit.Test; import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure; import org.onap.policy.controlloop.ControlLoopNotificationType; import org.onap.policy.controlloop.VirtualControlLoopNotification; -import org.onap.policy.drools.persistence.SystemPersistence; +import org.onap.policy.drools.persistence.SystemPersistenceConstants; import org.onap.policy.drools.system.PolicyController; -import org.onap.policy.drools.system.PolicyEngine; +import org.onap.policy.drools.system.PolicyEngineConstants; /** * ControlLoopMetrics Tests. @@ -46,7 +46,7 @@ import org.onap.policy.drools.system.PolicyEngine; public class ControlLoopMetricsFeatureTest { private static final String POLICY_CL_MGT = "POLICY-CL-MGT"; - private static final Path configPath = SystemPersistence.manager.getConfigurationPath(); + private static final Path configPath = SystemPersistenceConstants.getManager().getConfigurationPath(); private static PolicyController testController; /** @@ -54,14 +54,14 @@ public class ControlLoopMetricsFeatureTest { */ @BeforeClass public static void setUp() { - SystemPersistence.manager.setConfigurationDir("src/test/resources"); - testController = PolicyEngine.manager.createPolicyController("metrics", - SystemPersistence.manager.getControllerProperties("metrics")); + SystemPersistenceConstants.getManager().setConfigurationDir("src/test/resources"); + testController = PolicyEngineConstants.getManager().createPolicyController("metrics", + SystemPersistenceConstants.getManager().getControllerProperties("metrics")); } @AfterClass public static void tearDown() { - SystemPersistence.manager.setConfigurationDir(configPath.toString()); + SystemPersistenceConstants.getManager().setConfigurationDir(configPath.toString()); } @Test |