diff options
author | 2019-07-08 15:30:51 -0400 | |
---|---|---|
committer | 2019-07-08 15:30:51 -0400 | |
commit | 27f6bacd9c7ef76557a8a653142ed8e67a091a5a (patch) | |
tree | 177bd4e8e465686e8c8feb9d028735704c4c29a5 /main/src/test/java | |
parent | a0cc5811862052694918a16fdd8ebfd47ce8ec7b (diff) |
Fix pap due to sonar changes in common
Fixed breakages due to changes made in policy/common to satisfy
sonar.
Issue-ID: POLICY-1791
Signed-off-by: jrh3 <jrh3@att.com>
Change-Id: If8685462e1dd5cbbe58c329defff74ff2accf559
Diffstat (limited to 'main/src/test/java')
5 files changed, 19 insertions, 19 deletions
diff --git a/main/src/test/java/org/onap/policy/pap/main/comm/PublisherTest.java b/main/src/test/java/org/onap/policy/pap/main/comm/PublisherTest.java index cadae12b..d399f635 100644 --- a/main/src/test/java/org/onap/policy/pap/main/comm/PublisherTest.java +++ b/main/src/test/java/org/onap/policy/pap/main/comm/PublisherTest.java @@ -36,7 +36,7 @@ import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; 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.utils.ParameterUtils; import org.onap.policy.common.utils.coder.Coder; @@ -91,15 +91,15 @@ public class PublisherTest extends Threaded { final PapCommandLineArguments arguments = new PapCommandLineArguments(papConfigParameters); final PapParameterGroup parameterGroup = new PapParameterHandler().getParameters(arguments); Properties props = ParameterUtils.getTopicProperties(parameterGroup.getTopicParameterGroup()); - TopicEndpoint.manager.shutdown(); + TopicEndpointManager.getManager().shutdown(); - TopicEndpoint.manager.addTopics(props); - TopicEndpoint.manager.start(); + TopicEndpointManager.getManager().addTopics(props); + TopicEndpointManager.getManager().start(); } @AfterClass public static void tearDownAfterClass() throws Exception { - TopicEndpoint.manager.shutdown(); + TopicEndpointManager.getManager().shutdown(); } /** @@ -114,7 +114,7 @@ public class PublisherTest extends Threaded { pub = new Publisher(PapConstants.TOPIC_POLICY_PDP_PAP); listener = new MyListener(); - TopicEndpoint.manager.getNoopTopicSink(PapConstants.TOPIC_POLICY_PDP_PAP).register(listener); + TopicEndpointManager.getManager().getNoopTopicSink(PapConstants.TOPIC_POLICY_PDP_PAP).register(listener); } /** @@ -124,7 +124,7 @@ public class PublisherTest extends Threaded { */ @After public void tearDown() throws Exception { - TopicEndpoint.manager.getNoopTopicSink(PapConstants.TOPIC_POLICY_PDP_PAP).unregister(listener); + TopicEndpointManager.getManager().getNoopTopicSink(PapConstants.TOPIC_POLICY_PDP_PAP).unregister(listener); super.tearDown(); } diff --git a/main/src/test/java/org/onap/policy/pap/main/rest/CommonPapRestServer.java b/main/src/test/java/org/onap/policy/pap/main/rest/CommonPapRestServer.java index 4abe6f10..91245084 100644 --- a/main/src/test/java/org/onap/policy/pap/main/rest/CommonPapRestServer.java +++ b/main/src/test/java/org/onap/policy/pap/main/rest/CommonPapRestServer.java @@ -43,8 +43,8 @@ import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; -import org.onap.policy.common.endpoints.event.comm.TopicEndpoint; -import org.onap.policy.common.endpoints.http.server.HttpServletServer; +import org.onap.policy.common.endpoints.event.comm.TopicEndpointManager; +import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance; import org.onap.policy.common.gson.GsonMessageBodyHandler; import org.onap.policy.common.utils.network.NetworkUtil; import org.onap.policy.common.utils.services.Registry; @@ -94,8 +94,8 @@ public class CommonPapRestServer { makeConfigFile(); - HttpServletServer.factory.destroy(); - TopicEndpoint.manager.shutdown(); + HttpServletServerFactoryInstance.getServerFactory().destroy(); + TopicEndpointManager.getManager().shutdown(); CommonTestData.newDb(); diff --git a/main/src/test/java/org/onap/policy/pap/main/rest/e2e/End2EndContext.java b/main/src/test/java/org/onap/policy/pap/main/rest/e2e/End2EndContext.java index fe0f682a..38ffe8db 100644 --- a/main/src/test/java/org/onap/policy/pap/main/rest/e2e/End2EndContext.java +++ b/main/src/test/java/org/onap/policy/pap/main/rest/e2e/End2EndContext.java @@ -33,7 +33,7 @@ import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.LinkedBlockingQueue; import lombok.Getter; 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.bus.NoopTopicSource; import org.onap.policy.common.endpoints.listeners.MessageTypeDispatcher; @@ -129,9 +129,9 @@ public class End2EndContext { * Constructs the object. */ public End2EndContext() { - toPapTopic = TopicEndpoint.manager.getNoopTopicSource(PapConstants.TOPIC_POLICY_PDP_PAP); + toPapTopic = TopicEndpointManager.getManager().getNoopTopicSource(PapConstants.TOPIC_POLICY_PDP_PAP); - TopicEndpoint.manager.getNoopTopicSink(PapConstants.TOPIC_POLICY_PDP_PAP).register(topicListener); + TopicEndpointManager.getManager().getNoopTopicSink(PapConstants.TOPIC_POLICY_PDP_PAP).register(topicListener); dispatcher = new MessageTypeDispatcher("messageName"); dispatcher.register(PdpMessageType.PDP_UPDATE.name(), new UpdateListener()); @@ -200,7 +200,7 @@ public class End2EndContext { toPap.clear(); pdps.forEach(pdp -> toPap.add(DONE)); - TopicEndpoint.manager.getNoopTopicSink(PapConstants.TOPIC_POLICY_PDP_PAP).unregister(topicListener); + TopicEndpointManager.getManager().getNoopTopicSink(PapConstants.TOPIC_POLICY_PDP_PAP).unregister(topicListener); } /** diff --git a/main/src/test/java/org/onap/policy/pap/main/startstop/TestMain.java b/main/src/test/java/org/onap/policy/pap/main/startstop/TestMain.java index 016e120d..2658b36c 100644 --- a/main/src/test/java/org/onap/policy/pap/main/startstop/TestMain.java +++ b/main/src/test/java/org/onap/policy/pap/main/startstop/TestMain.java @@ -28,7 +28,7 @@ import static org.junit.Assert.assertTrue; import org.junit.After; import org.junit.Before; 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.common.utils.services.Registry; import org.onap.policy.pap.main.PapConstants; import org.onap.policy.pap.main.PolicyPapException; @@ -48,7 +48,7 @@ public class TestMain { @Before public void setUp() { Registry.newRegistry(); - HttpServletServer.factory.destroy(); + HttpServletServerFactoryInstance.getServerFactory().destroy(); } /** diff --git a/main/src/test/java/org/onap/policy/pap/main/startstop/TestPapActivator.java b/main/src/test/java/org/onap/policy/pap/main/startstop/TestPapActivator.java index fe2e8374..2ebd234c 100644 --- a/main/src/test/java/org/onap/policy/pap/main/startstop/TestPapActivator.java +++ b/main/src/test/java/org/onap/policy/pap/main/startstop/TestPapActivator.java @@ -32,7 +32,7 @@ import java.util.Properties; import org.junit.After; import org.junit.Before; 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.common.endpoints.utils.ParameterUtils; import org.onap.policy.common.utils.services.Registry; import org.onap.policy.pap.main.PapConstants; @@ -61,7 +61,7 @@ public class TestPapActivator { @Before public void setUp() throws Exception { Registry.newRegistry(); - HttpServletServer.factory.destroy(); + HttpServletServerFactoryInstance.getServerFactory().destroy(); final String[] papConfigParameters = {"-c", "parameters/PapConfigParameters.json"}; final PapCommandLineArguments arguments = new PapCommandLineArguments(papConfigParameters); |