Fix drools-applications due to sonar changes in common 49/91049/4
authorJim Hahn <jrh3@att.com>
Mon, 8 Jul 2019 14:56:34 +0000 (10:56 -0400)
committerJim Hahn <jrh3@att.com>
Tue, 9 Jul 2019 16:06:21 +0000 (12:06 -0400)
Fixed breakages due to changes made in policy/common to satisfy
sonar.
Repointed op.pom to correct parent, which allowed the other version to
be dropped and properties used in the rest of the pom.

Change-Id: Ib19c228c38b7f27fb9e9f508e5cf2566a8939cdd
Issue-ID: POLICY-1791
Signed-off-by: Jim Hahn <jrh3@att.com>
18 files changed:
controlloop/common/coordination/src/test/java/org/onap/policy/coordination/CoordinationDirectiveTest.java
controlloop/common/coordination/src/test/java/org/onap/policy/coordination/UtilTest.java
controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopEventManagerTest.java
controlloop/common/eventmanager/src/test/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManagerTest.java
controlloop/common/feature-controlloop-management/src/test/java/org/onap/policy/drools/server/restful/RestControlLoopManagerTest.java
controlloop/common/feature-controlloop-management/src/test/resources/op.pom
controlloop/common/feature-controlloop-utils/src/test/java/org/onap/policy/drools/apps/controlloop/feature/utils/ControlLoopUtilsFeatureTest.java
controlloop/common/guard/src/test/java/org/onap/policy/guard/PolicyGuardXacmlHelperTest.java
controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/CcvpnBwControlLoopTest.java
controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/CcvpnControlLoopTest.java
controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/ControlLoopEventCleanupTest.java
controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/ControlLoopFailureTest.java
controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VcpeControlLoopTest.java
controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VdnsControlLoopTest.java
controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VfcControlLoopTest.java
controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VfwControlLoopTest.java
controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VpciControlLoopTest.java
controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/VsonhControlLoopTest.java

index 30606d1..47d11dd 100644 (file)
 package org.onap.policy.coordination;
 
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 
 import java.util.Arrays;
-import org.assertj.core.api.Assertions;
 import org.junit.Test;
 
 public class CoordinationDirectiveTest {
index 76ae3b4..21998a7 100644 (file)
 package org.onap.policy.coordination;
 
 import static org.assertj.core.api.Assertions.assertThatNullPointerException;
-
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
-import static org.junit.Assert.fail;
 
 import org.junit.Test;
 
index 3a4b277..b7dc1f0 100644 (file)
@@ -54,7 +54,7 @@ import org.onap.policy.aai.Relationship;
 import org.onap.policy.aai.RelationshipData;
 import org.onap.policy.aai.RelationshipList;
 import org.onap.policy.aai.util.AaiException;
-import org.onap.policy.common.endpoints.http.server.HttpServletServer;
+import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance;
 import org.onap.policy.common.utils.io.Serializer;
 import org.onap.policy.controlloop.ControlLoopEventStatus;
 import org.onap.policy.controlloop.ControlLoopException;
@@ -122,7 +122,7 @@ public class ControlLoopEventManagerTest {
 
     @AfterClass
     public static void tearDownSimulator() {
-        HttpServletServer.factory.destroy();
+        HttpServletServerFactoryInstance.getServerFactory().destroy();
     }
 
     /**
index 835b4ac..13fe725 100644 (file)
@@ -53,7 +53,7 @@ import org.onap.policy.appclcm.LcmRequest;
 import org.onap.policy.appclcm.LcmRequestWrapper;
 import org.onap.policy.appclcm.LcmResponse;
 import org.onap.policy.appclcm.LcmResponseWrapper;
-import org.onap.policy.common.endpoints.http.server.HttpServletServer;
+import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance;
 import org.onap.policy.common.utils.io.Serializer;
 import org.onap.policy.controlloop.ControlLoopEventStatus;
 import org.onap.policy.controlloop.ControlLoopException;
@@ -155,7 +155,7 @@ public class ControlLoopOperationManagerTest {
     public static void tearDown() {
         em.close();
         emf.close();
-        HttpServletServer.factory.destroy();
+        HttpServletServerFactoryInstance.getServerFactory().destroy();
     }
 
     @Test
index 3d89e5a..849b418 100644 (file)
@@ -38,7 +38,7 @@ import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.kie.api.builder.ReleaseId;
-import org.onap.policy.common.endpoints.http.client.HttpClient;
+import org.onap.policy.common.endpoints.http.client.HttpClientFactoryInstance;
 import org.onap.policy.common.utils.network.NetworkUtil;
 import org.onap.policy.drools.persistence.SystemPersistence;
 import org.onap.policy.drools.properties.DroolsProperties;
@@ -100,7 +100,7 @@ public class RestControlLoopManagerTest {
         PolicyEngine.manager.createPolicyController(CONTROLLER, controllerProperties);
         PolicyEngine.manager.start();
 
-        HttpClient.factory.build(SystemPersistence.manager.getProperties(CLIENT_CONFIG));
+        HttpClientFactoryInstance.getClientFactory().build(SystemPersistence.manager.getProperties(CLIENT_CONFIG));
 
         if (!NetworkUtil.isTcpPortOpen("localhost", 9696, 6, 10000L)) {
             throw new IllegalStateException("cannot connect to port 9696");
@@ -143,30 +143,30 @@ public class RestControlLoopManagerTest {
      */
     @Test
     public void testOperationalPolicy() throws IOException {
-        assertEquals(Status.OK.getStatusCode(),
-            HttpClient.factory.get(CONTROLLER).get(URL_CONTEXT_PATH_CONTROLLOOPS).getStatus());
+        assertEquals(Status.OK.getStatusCode(), HttpClientFactoryInstance.getClientFactory().get(CONTROLLER)
+                        .get(URL_CONTEXT_PATH_CONTROLLOOPS).getStatus());
 
-        assertEquals(Status.OK.getStatusCode(),
-            HttpClient.factory.get(CONTROLLER).get(URL_CONTEXT_PATH_CONTROLLOOP).getStatus());
+        assertEquals(Status.OK.getStatusCode(), HttpClientFactoryInstance.getClientFactory().get(CONTROLLER)
+                        .get(URL_CONTEXT_PATH_CONTROLLOOP).getStatus());
 
-        assertEquals(Status.NOT_FOUND.getStatusCode(),
-            HttpClient.factory.get(CONTROLLER).get(URL_CONTEXT_PATH_CONTROLLOOP_POLICY).getStatus());
+        assertEquals(Status.NOT_FOUND.getStatusCode(), HttpClientFactoryInstance.getClientFactory().get(CONTROLLER)
+                        .get(URL_CONTEXT_PATH_CONTROLLOOP_POLICY).getStatus());
 
         String policyFromFile = new String(Files.readAllBytes(Paths.get(POLICY)));
-        HttpClient.factory.get(CONTROLLER)
-            .put(URL_CONTEXT_PATH_CONTROLLOOP_POLICY, Entity.text(policyFromFile), Collections.emptyMap());
+        HttpClientFactoryInstance.getClientFactory().get(CONTROLLER).put(URL_CONTEXT_PATH_CONTROLLOOP_POLICY,
+                        Entity.text(policyFromFile), Collections.emptyMap());
 
-        assertEquals(Status.OK.getStatusCode(),
-            HttpClient.factory.get(CONTROLLER).get(URL_CONTEXT_PATH_CONTROLLOOP_POLICY).getStatus());
+        assertEquals(Status.OK.getStatusCode(), HttpClientFactoryInstance.getClientFactory().get(CONTROLLER)
+                        .get(URL_CONTEXT_PATH_CONTROLLOOP_POLICY).getStatus());
 
-        String policyFromPdpD = HttpClient.factory.get(CONTROLLER)
+        String policyFromPdpD = HttpClientFactoryInstance.getClientFactory().get(CONTROLLER)
             .get(URL_CONTEXT_PATH_CONTROLLOOP_POLICY)
             .readEntity(String.class);
 
         assertEquals(policyFromFile, policyFromPdpD);
 
         assertEquals(Status.CONFLICT.getStatusCode(),
-            HttpClient.factory.get(CONTROLLER).put(URL_CONTEXT_PATH_CONTROLLOOP_POLICY,
+            HttpClientFactoryInstance.getClientFactory().get(CONTROLLER).put(URL_CONTEXT_PATH_CONTROLLOOP_POLICY,
                 Entity.text(policyFromFile), Collections.emptyMap()).getStatus());
     }
 
index 91b651c..517410d 100644 (file)
@@ -3,7 +3,7 @@
   ============LICENSE_START=======================================================
   ONAP
   ================================================================================
-  Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
+  Copyright (C) 2018-2019 AT&T Intellectual Property. All rights reserved.
   Modifications Copyright (C) 2019 Nordix Foundation.
   ================================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
     <modelVersion>4.0.0</modelVersion>
 
     <parent>
-        <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
-        <artifactId>model-impl</artifactId>
-        <version>2.1.0-SNAPSHOT</version>
+        <groupId>org.onap.policy.drools-applications.controlloop.common</groupId>
+        <artifactId>common</artifactId>
+        <version>1.5.1-SNAPSHOT</version>
     </parent>
 
     <groupId>org.onap.policy.drools.apps.test</groupId>
     <artifactId>op</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
 
     <dependencies>
         <dependency>
index fd73b62..899b7ce 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP
  * ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -23,7 +23,7 @@ package org.onap.policy.drools.apps.controlloop.feature.utils;
 import static org.junit.Assert.assertNotNull;
 
 import org.junit.Test;
-import org.onap.policy.common.endpoints.http.server.HttpServletServer;
+import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance;
 import org.onap.policy.drools.system.PolicyEngine;
 import org.onap.policy.drools.utils.logging.LoggerUtil;
 import org.onap.policy.simulators.Util;
@@ -39,11 +39,11 @@ public class ControlLoopUtilsFeatureTest {
         LoggerUtil.setLevel("org.eclipse.jetty", "WARN");
         final ControlLoopUtilsFeature feature = new ControlLoopUtilsFeature();
         feature.afterStart(PolicyEngine.manager);
-        assertNotNull(HttpServletServer.factory.get(Util.AAISIM_SERVER_PORT));
-        assertNotNull(HttpServletServer.factory.get(Util.SOSIM_SERVER_PORT));
-        assertNotNull(HttpServletServer.factory.get(Util.SOSIM_SERVER_PORT));
-        assertNotNull(HttpServletServer.factory.get(Util.GUARDSIM_SERVER_PORT));
-        assertNotNull(HttpServletServer.factory.get(Util.SDNCSIM_SERVER_PORT));
+        assertNotNull(HttpServletServerFactoryInstance.getServerFactory().get(Util.AAISIM_SERVER_PORT));
+        assertNotNull(HttpServletServerFactoryInstance.getServerFactory().get(Util.SOSIM_SERVER_PORT));
+        assertNotNull(HttpServletServerFactoryInstance.getServerFactory().get(Util.SOSIM_SERVER_PORT));
+        assertNotNull(HttpServletServerFactoryInstance.getServerFactory().get(Util.GUARDSIM_SERVER_PORT));
+        assertNotNull(HttpServletServerFactoryInstance.getServerFactory().get(Util.SDNCSIM_SERVER_PORT));
     }
 
 }
index 19fed30..9d252b9 100644 (file)
@@ -27,7 +27,7 @@ import java.util.Properties;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
-import org.onap.policy.common.endpoints.http.server.HttpServletServer;
+import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance;
 import org.onap.policy.drools.system.PolicyEngine;
 import org.onap.policy.drools.utils.logging.LoggerUtil;
 
@@ -48,7 +48,7 @@ public class PolicyGuardXacmlHelperTest {
         LoggerUtil.setLevel("ROOT", "INFO");
         LoggerUtil.setLevel("org.eclipse.jetty", "WARN");
 
-        HttpServletServer.factory.destroy();
+        HttpServletServerFactoryInstance.getServerFactory().destroy();
         org.onap.policy.simulators.Util.buildGuardSim();
 
         //
@@ -62,7 +62,7 @@ public class PolicyGuardXacmlHelperTest {
      */
     @AfterClass
     public static void tearDownSimulator() {
-        HttpServletServer.factory.destroy();
+        HttpServletServerFactoryInstance.getServerFactory().destroy();
 
         // Null/ Bad Connection Case
         PolicyGuardXacmlRequestAttributes xacmlReq = new PolicyGuardXacmlRequestAttributes(
index 0ac9c48..42742b2 100644 (file)
@@ -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;
@@ -90,7 +89,7 @@ public class CcvpnBwControlLoopTest 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")
@@ -137,9 +136,9 @@ public class CcvpnBwControlLoopTest implements TopicListener {
         kieSession.dispose();
 
         PolicyEngine.manager.stop();
-        HttpServletServer.factory.destroy();
+        HttpServletServerFactoryInstance.getServerFactory().destroy();
         PolicyController.factory.shutdown();
-        TopicEndpoint.manager.shutdown();
+        TopicEndpointManager.getManager().shutdown();
     }
 
     @Test
index c546248..2c2b5d8 100644 (file)
@@ -31,17 +31,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;
@@ -89,7 +88,7 @@ public class CcvpnControlLoopTest 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 CcvpnControlLoopTest implements TopicListener {
         kieSession.dispose();
 
         PolicyEngine.manager.stop();
-        HttpServletServer.factory.destroy();
+        HttpServletServerFactoryInstance.getServerFactory().destroy();
         PolicyController.factory.shutdown();
-        TopicEndpoint.manager.shutdown();
+        TopicEndpointManager.getManager().shutdown();
     }
 
     @Test
index 37e1390..928bcb8 100644 (file)
@@ -38,9 +38,9 @@ import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.kie.api.runtime.KieSession;
-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.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.VirtualControlLoopEvent;
@@ -123,7 +123,7 @@ public class ControlLoopEventCleanupTest {
                         "org.onap.policy.controlloop.VirtualControlLoopNotification");
         noopSinkProperties.put("noop.sink.topics.POLICY-CL-MGT.events.custom.gson",
                         "org.onap.policy.controlloop.util.Serialization,gsonPretty");
-        final List<TopicSink> noopTopics = TopicEndpoint.manager.addTopicSinks(noopSinkProperties);
+        final List<TopicSink> noopTopics = TopicEndpointManager.getManager().addTopicSinks(noopSinkProperties);
 
         EventProtocolCoder.manager.addEncoder(EventProtocolParams.builder()
                 .groupId("junit.groupId")
@@ -177,9 +177,9 @@ public class ControlLoopEventCleanupTest {
         kieSession.dispose();
 
         PolicyEngine.manager.stop();
-        HttpServletServer.factory.destroy();
+        HttpServletServerFactoryInstance.getServerFactory().destroy();
         PolicyController.factory.shutdown();
-        TopicEndpoint.manager.shutdown();
+        TopicEndpointManager.getManager().shutdown();
 
         if (saveGuardFlag == null) {
             PolicyEngine.manager.getEnvironment().remove(GUARD_DISABLED);
@@ -202,7 +202,7 @@ public class ControlLoopEventCleanupTest {
 
         kieSession.fireAllRules();
         List<Object> facts = getSessionObjects();
-        
+
         // should have events for both control loops
         assertEquals(2 * CL_OBJECTS, facts.size());
         assertTrue(hasEvent(facts, CONTROL_LOOP_NAME));
@@ -362,7 +362,7 @@ public class ControlLoopEventCleanupTest {
 
     /**
      * Determines if the facts contain an event for the given control loop.
-     * 
+     *
      * @param facts session facts to be checked
      * @param controlLoopName name of the control loop of interest
      * @return {@code true} if the facts contain an event for the given control loop,
index 47bbc63..6dbe17e 100644 (file)
@@ -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,7 +32,6 @@ 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;
@@ -43,10 +42,10 @@ import org.onap.policy.appclcm.LcmRequestWrapper;
 import org.onap.policy.appclcm.LcmResponse;
 import org.onap.policy.appclcm.LcmResponseWrapper;
 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;
@@ -97,7 +96,7 @@ public class ControlLoopFailureTest 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")
@@ -148,9 +147,9 @@ public class ControlLoopFailureTest implements TopicListener {
         kieSession.dispose();
 
         PolicyEngine.manager.stop();
-        HttpServletServer.factory.destroy();
+        HttpServletServerFactoryInstance.getServerFactory().destroy();
         PolicyController.factory.shutdown();
-        TopicEndpoint.manager.shutdown();
+        TopicEndpointManager.getManager().shutdown();
     }
 
     /**
@@ -205,7 +204,7 @@ public class ControlLoopFailureTest implements TopicListener {
          * a lock for a different
          */
         kieSession.fireUntilHalt();
-        
+
         // allow object clean-up
         kieSession.fireAllRules();
 
@@ -223,7 +222,7 @@ public class ControlLoopFailureTest 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
@@ -248,7 +247,7 @@ public class ControlLoopFailureTest 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"));
 
@@ -265,7 +264,7 @@ public class ControlLoopFailureTest implements TopicListener {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.onap.policy.drools.PolicyEngineListener#newEventNotification(java.lang.String)
      */
     @Override
@@ -371,7 +370,7 @@ public class ControlLoopFailureTest 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
@@ -391,7 +390,7 @@ public class ControlLoopFailureTest 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) {
index d9988b0..28706fd 100644 (file)
@@ -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,7 +32,6 @@ 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;
@@ -43,10 +42,10 @@ import org.onap.policy.appclcm.LcmRequestWrapper;
 import org.onap.policy.appclcm.LcmResponse;
 import org.onap.policy.appclcm.LcmResponseWrapper;
 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;
@@ -97,7 +96,7 @@ public class VcpeControlLoopTest 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")
@@ -147,9 +146,9 @@ public class VcpeControlLoopTest implements TopicListener {
         kieSession.dispose();
 
         PolicyEngine.manager.stop();
-        HttpServletServer.factory.destroy();
+        HttpServletServerFactoryInstance.getServerFactory().destroy();
         PolicyController.factory.shutdown();
-        TopicEndpoint.manager.shutdown();
+        TopicEndpointManager.getManager().shutdown();
     }
 
     @Test
@@ -176,7 +175,7 @@ public class VcpeControlLoopTest implements TopicListener {
         sendEvent(pair.first, requestId, ControlLoopEventStatus.ONSET, "vCPEInfraVNF13", true);
 
         kieSession.fireUntilHalt();
-        
+
         // allow object clean-up
         kieSession.fireAllRules();
 
@@ -216,7 +215,7 @@ public class VcpeControlLoopTest implements TopicListener {
 
 
         kieSession.fireUntilHalt();
-        
+
         // allow object clean-up
         kieSession.fireAllRules();
 
@@ -234,7 +233,7 @@ public class VcpeControlLoopTest 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
@@ -259,7 +258,7 @@ public class VcpeControlLoopTest 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"));
 
@@ -276,7 +275,7 @@ public class VcpeControlLoopTest implements TopicListener {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.onap.policy.drools.PolicyEngineListener#newEventNotification(java.lang.String)
      */
     @Override
@@ -367,7 +366,7 @@ public class VcpeControlLoopTest 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
@@ -410,7 +409,7 @@ public class VcpeControlLoopTest 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) {
index 3694423..3e5825b 100644 (file)
@@ -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) {
index 4c0d4f3..fdf2749 100644 (file)
@@ -33,17 +33,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;
@@ -94,7 +93,7 @@ public class VfcControlLoopTest 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")
@@ -112,7 +111,7 @@ public class VfcControlLoopTest implements TopicListener {
             fail(e.getMessage());
         }
         /*
-         * 
+         *
          * Start the kie session
          */
         try {
@@ -139,9 +138,9 @@ public class VfcControlLoopTest implements TopicListener {
         kieSession.dispose();
 
         PolicyEngine.manager.stop();
-        HttpServletServer.factory.destroy();
+        HttpServletServerFactoryInstance.getServerFactory().destroy();
         PolicyController.factory.shutdown();
-        TopicEndpoint.manager.shutdown();
+        TopicEndpointManager.getManager().shutdown();
     }
 
     @Test
@@ -168,7 +167,7 @@ public class VfcControlLoopTest implements TopicListener {
         sendEvent(pair.first, requestId, ControlLoopEventStatus.ONSET);
 
         kieSession.fireUntilHalt();
-        
+
         // allow object clean-up
         kieSession.fireAllRules();
 
@@ -219,7 +218,7 @@ public class VfcControlLoopTest implements TopicListener {
         kieSession.insert(event);
 
         kieSession.fireUntilHalt();
-        
+
         // allow object clean-up
         kieSession.fireAllRules();
 
@@ -261,7 +260,7 @@ public class VfcControlLoopTest 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"));
 
@@ -278,7 +277,7 @@ public class VfcControlLoopTest implements TopicListener {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see org.onap.policy.drools.PolicyEngineListener#newEventNotification(java.lang.String)
      */
     @Override
@@ -346,7 +345,7 @@ public class VfcControlLoopTest 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
@@ -373,7 +372,7 @@ public class VfcControlLoopTest implements TopicListener {
 
     /**
      * Dumps the kie session facts.
-     * 
+     *
      * @param kieSession input session
      */
     public static void dumpFacts(KieSession kieSession) {
index d29eabd..327a1b4 100644 (file)
@@ -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,7 +32,6 @@ 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;
@@ -42,10 +41,10 @@ import org.onap.policy.appc.Request;
 import org.onap.policy.appc.Response;
 import org.onap.policy.appc.ResponseCode;
 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;
@@ -95,7 +94,7 @@ public class VfwControlLoopTest 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")
@@ -147,9 +146,9 @@ public class VfwControlLoopTest implements TopicListener {
         kieSession.dispose();
 
         PolicyEngine.manager.stop();
-        HttpServletServer.factory.destroy();
+        HttpServletServerFactoryInstance.getServerFactory().destroy();
         PolicyController.factory.shutdown();
-        TopicEndpoint.manager.shutdown();
+        TopicEndpointManager.getManager().shutdown();
     }
 
     @Test
@@ -177,10 +176,10 @@ public class VfwControlLoopTest implements TopicListener {
 
         try {
             kieSession.fireUntilHalt();
-            
+
             // allow object clean-up
             kieSession.fireAllRules();
-            
+
         } catch (Exception e) {
             e.printStackTrace();
             logger.warn(e.toString());
@@ -223,10 +222,10 @@ public class VfwControlLoopTest implements TopicListener {
         sendEvent(pair.first, requestId, ControlLoopEventStatus.ONSET, "error");
         try {
             kieSession.fireUntilHalt();
-            
+
             // allow object clean-up
             kieSession.fireAllRules();
-            
+
         } catch (Exception e) {
             e.printStackTrace();
             logger.warn(e.toString());
@@ -257,10 +256,10 @@ public class VfwControlLoopTest implements TopicListener {
 
         try {
             kieSession.fireUntilHalt();
-            
+
             // allow object clean-up
             kieSession.fireAllRules();
-            
+
         } catch (Exception e) {
             e.printStackTrace();
             logger.warn(e.toString());
@@ -280,7 +279,7 @@ public class VfwControlLoopTest 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
@@ -305,7 +304,7 @@ public class VfwControlLoopTest 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"));
 
@@ -406,7 +405,7 @@ public class VfwControlLoopTest 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
@@ -426,7 +425,7 @@ public class VfwControlLoopTest 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
@@ -445,7 +444,7 @@ public class VfwControlLoopTest 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) {
index 3247aa5..3278d43 100644 (file)
@@ -8,9 +8,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.
@@ -33,17 +33,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;
@@ -98,7 +97,7 @@ public class VpciControlLoopTest 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")
@@ -146,9 +145,9 @@ public class VpciControlLoopTest implements TopicListener {
         kieSession.dispose();
 
         PolicyEngine.manager.stop();
-        HttpServletServer.factory.destroy();
+        HttpServletServerFactoryInstance.getServerFactory().destroy();
         PolicyController.factory.shutdown();
-        TopicEndpoint.manager.shutdown();
+        TopicEndpointManager.getManager().shutdown();
     }
 
     @Test
@@ -175,7 +174,7 @@ public class VpciControlLoopTest implements TopicListener {
         sendEvent(pair.first, requestId, ControlLoopEventStatus.ONSET, true);
 
         kieSession.fireUntilHalt();
-        
+
         // allow object clean-up
         kieSession.fireAllRules();
 
@@ -215,7 +214,7 @@ public class VpciControlLoopTest implements TopicListener {
         sendEvent(pair.first, requestId, ControlLoopEventStatus.ONSET, false);
 
         kieSession.fireUntilHalt();
-        
+
         // allow object clean-up
         kieSession.fireAllRules();
 
@@ -233,7 +232,7 @@ public class VpciControlLoopTest implements TopicListener {
 
     /**
      * This method will start a kie session and instantiate the Policy Engine.
-     * 
+     *
      * @param droolsTemplate
      *            the DRL rules file
      * @param yamlFile
@@ -283,7 +282,7 @@ public class VpciControlLoopTest implements TopicListener {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see
      * org.onap.policy.drools.PolicyEngineListener#newEventNotification(java.lang.
      * String)
@@ -384,7 +383,7 @@ public class VpciControlLoopTest implements TopicListener {
     /**
      * This method is used to simulate event messages from DCAE that start the
      * control loop (onset message).
-     * 
+     *
      * @param policy
      *            the controlLoopName comes from the policy
      * @param requestId
@@ -423,7 +422,7 @@ public class VpciControlLoopTest implements TopicListener {
 
     /**
      * This method will dump all the facts in the working memory.
-     * 
+     *
      * @param kieSession
      *            the session containing the facts
      */
index 871755d..3859b74 100644 (file)
@@ -3,13 +3,14 @@
  * demo
  * ================================================================================
  * Copyright (C) 2019 Wipro Limited Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * 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 +33,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;
@@ -97,7 +97,7 @@ public class VsonhControlLoopTest 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")
@@ -145,9 +145,9 @@ public class VsonhControlLoopTest implements TopicListener {
         kieSession.dispose();
 
         PolicyEngine.manager.stop();
-        HttpServletServer.factory.destroy();
+        HttpServletServerFactoryInstance.getServerFactory().destroy();
         PolicyController.factory.shutdown();
-        TopicEndpoint.manager.shutdown();
+        TopicEndpointManager.getManager().shutdown();
     }
 
     @Test
@@ -174,7 +174,7 @@ public class VsonhControlLoopTest implements TopicListener {
         sendEvent(pair.first, requestId, ControlLoopEventStatus.ONSET, true);
 
         kieSession.fireUntilHalt();
-        
+
         // allow object clean-up
         kieSession.fireAllRules();
 
@@ -214,7 +214,7 @@ public class VsonhControlLoopTest implements TopicListener {
         sendEvent(pair.first, requestId, ControlLoopEventStatus.ONSET, false);
 
         kieSession.fireUntilHalt();
-        
+
         // allow object clean-up
         kieSession.fireAllRules();
 
@@ -232,7 +232,7 @@ public class VsonhControlLoopTest implements TopicListener {
 
     /**
      * This method will start a kie session and instantiate the Policy Engine.
-     * 
+     *
      * @param droolsTemplate
      *            the DRL rules file
      * @param yamlFile
@@ -282,7 +282,7 @@ public class VsonhControlLoopTest implements TopicListener {
 
     /*
      * (non-Javadoc)
-     * 
+     *
      * @see
      * org.onap.policy.drools.PolicyEngineListener#newEventNotification(java.lang.
      * String)
@@ -387,7 +387,7 @@ public class VsonhControlLoopTest implements TopicListener {
     /**
      * This method is used to simulate event messages from DCAE that start the
      * control loop (onset message).
-     * 
+     *
      * @param policy
      *            the controlLoopName comes from the policy
      * @param requestId
@@ -429,7 +429,7 @@ public class VsonhControlLoopTest implements TopicListener {
 
     /**
      * This method will dump all the facts in the working memory.
-     * 
+     *
      * @param kieSession
      *            the session containing the facts
      */