summaryrefslogtreecommitdiffstats
path: root/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VdnsControlLoopTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VdnsControlLoopTest.java')
-rw-r--r--controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VdnsControlLoopTest.java33
1 files changed, 16 insertions, 17 deletions
diff --git a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VdnsControlLoopTest.java b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VdnsControlLoopTest.java
index 3694423c0..3e5825bc1 100644
--- a/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VdnsControlLoopTest.java
+++ b/controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VdnsControlLoopTest.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -32,17 +32,16 @@ import java.util.HashMap;
import java.util.List;
import java.util.Properties;
import java.util.UUID;
-
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.kie.api.runtime.KieSession;
import org.kie.api.runtime.rule.FactHandle;
import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
-import org.onap.policy.common.endpoints.event.comm.TopicEndpoint;
+import org.onap.policy.common.endpoints.event.comm.TopicEndpointManager;
import org.onap.policy.common.endpoints.event.comm.TopicListener;
import org.onap.policy.common.endpoints.event.comm.TopicSink;
-import org.onap.policy.common.endpoints.http.server.HttpServletServer;
+import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance;
import org.onap.policy.common.endpoints.properties.PolicyEndPointProperties;
import org.onap.policy.controlloop.ControlLoopEventStatus;
import org.onap.policy.controlloop.ControlLoopNotificationType;
@@ -91,7 +90,7 @@ public class VdnsControlLoopTest implements TopicListener {
"org.onap.policy.controlloop.VirtualControlLoopNotification");
noopSinkProperties.put("noop.sink.topics.POLICY-CL-MGT.events.custom.gson",
"org.onap.policy.controlloop.util.Serialization,gsonPretty");
- noopTopics = TopicEndpoint.manager.addTopicSinks(noopSinkProperties);
+ noopTopics = TopicEndpointManager.getManager().addTopicSinks(noopSinkProperties);
EventProtocolCoder.manager.addEncoder(EventProtocolParams.builder()
.groupId("junit.groupId")
@@ -136,9 +135,9 @@ public class VdnsControlLoopTest implements TopicListener {
kieSession.dispose();
PolicyEngine.manager.stop();
- HttpServletServer.factory.destroy();
+ HttpServletServerFactoryInstance.getServerFactory().destroy();
PolicyController.factory.shutdown();
- TopicEndpoint.manager.shutdown();
+ TopicEndpointManager.getManager().shutdown();
}
@Test
@@ -165,7 +164,7 @@ public class VdnsControlLoopTest implements TopicListener {
sendEvent(pair.first, requestId, ControlLoopEventStatus.ONSET);
kieSession.fireUntilHalt();
-
+
// allow object clean-up
kieSession.fireAllRules();
@@ -204,7 +203,7 @@ public class VdnsControlLoopTest implements TopicListener {
sendEvent(pair.first, requestId, ControlLoopEventStatus.ONSET, "error");
kieSession.fireUntilHalt();
-
+
// allow object clean-up
kieSession.fireAllRules();
@@ -244,10 +243,10 @@ public class VdnsControlLoopTest implements TopicListener {
try {
kieSession.fireUntilHalt();
-
+
// allow object clean-up
kieSession.fireAllRules();
-
+
} catch (Exception e) {
e.printStackTrace();
logger.warn(e.toString());
@@ -268,7 +267,7 @@ public class VdnsControlLoopTest implements TopicListener {
/**
* This method will start a kie session and instantiate the Policy Engine.
- *
+ *
* @param droolsTemplate the DRL rules file
* @param yamlFile the yaml file containing the policies
* @param policyScope scope for policy
@@ -293,7 +292,7 @@ public class VdnsControlLoopTest implements TopicListener {
/*
* Construct a kie session
*/
- final KieSession kieSession = SupportUtil.buildContainer(droolsTemplate,
+ final KieSession kieSession = SupportUtil.buildContainer(droolsTemplate,
pair.first.getControlLoop().getControlLoopName(),
policyScope, policyName, policyVersion, URLEncoder.encode(pair.second, "UTF-8"));
@@ -310,7 +309,7 @@ public class VdnsControlLoopTest implements TopicListener {
/*
* (non-Javadoc)
- *
+ *
* @see org.onap.policy.drools.PolicyEngineListener#newEventNotification(java.lang.String)
*/
@Override
@@ -380,7 +379,7 @@ public class VdnsControlLoopTest implements TopicListener {
/**
* This method is used to simulate event messages from DCAE that start the control loop (onset
* message) or end the control loop (abatement message).
- *
+ *
* @param policy the controlLoopName comes from the policy
* @param requestId the requestId for this event
* @param status could be onset or abated
@@ -414,7 +413,7 @@ public class VdnsControlLoopTest implements TopicListener {
/**
* This method will dump all the facts in the working memory.
- *
+ *
* @param kieSession the session containing the facts
*/
public void dumpFacts(KieSession kieSession) {