aboutsummaryrefslogtreecommitdiffstats
path: root/models-interactions/model-simulators/src/main
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2019-07-08 09:53:26 -0400
committerJim Hahn <jrh3@att.com>2019-07-08 09:53:26 -0400
commit9d4d28c05d214e906731f4bf536e1428df6925b6 (patch)
treef8275d69ba67b49cfe03094fea24d88840cf4507 /models-interactions/model-simulators/src/main
parentc5231f939d724dd59cb385d8521924a1bff19cee (diff)
Fix models due to sonar changes in common
Fixed breakages due to changes made in policy/common to satisfy sonar. Change-Id: I7de701e743664afb5963a454c59478d1a1c83e87 Issue-ID: POLICY-1791 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'models-interactions/model-simulators/src/main')
-rw-r--r--models-interactions/model-simulators/src/main/java/org/onap/policy/simulators/Util.java23
1 files changed, 12 insertions, 11 deletions
diff --git a/models-interactions/model-simulators/src/main/java/org/onap/policy/simulators/Util.java b/models-interactions/model-simulators/src/main/java/org/onap/policy/simulators/Util.java
index e5ee65004..a1d28ba23 100644
--- a/models-interactions/model-simulators/src/main/java/org/onap/policy/simulators/Util.java
+++ b/models-interactions/model-simulators/src/main/java/org/onap/policy/simulators/Util.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* simulators
* ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2019 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -24,6 +24,7 @@ package org.onap.policy.simulators;
import java.io.IOException;
import org.onap.policy.common.endpoints.http.server.HttpServletServer;
+import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance;
import org.onap.policy.common.gson.GsonMessageBodyHandler;
import org.onap.policy.common.utils.network.NetworkUtil;
@@ -55,8 +56,8 @@ public class Util {
* @throws IOException if an IO errror occurs
*/
public static HttpServletServer buildAaiSim() throws InterruptedException, IOException {
- final HttpServletServer testServer =
- HttpServletServer.factory.build(AAISIM_SERVER_NAME, LOCALHOST, AAISIM_SERVER_PORT, "/", false, true);
+ final HttpServletServer testServer = HttpServletServerFactoryInstance.getServerFactory()
+ .build(AAISIM_SERVER_NAME, LOCALHOST, AAISIM_SERVER_PORT, "/", false, true);
testServer.addServletClass("/*", AaiSimulatorJaxRs.class.getName());
testServer.waitedStart(5000);
if (!NetworkUtil.isTcpPortOpen(LOCALHOST, testServer.getPort(), 5, 10000L)) {
@@ -73,8 +74,8 @@ public class Util {
* @throws IOException if an IO errror occurs
*/
public static HttpServletServer buildSdncSim() throws InterruptedException, IOException {
- final HttpServletServer testServer =
- HttpServletServer.factory.build(SDNCSIM_SERVER_NAME, LOCALHOST, SDNCSIM_SERVER_PORT, "/", false, true);
+ final HttpServletServer testServer = HttpServletServerFactoryInstance.getServerFactory()
+ .build(SDNCSIM_SERVER_NAME, LOCALHOST, SDNCSIM_SERVER_PORT, "/", false, true);
testServer.addServletClass("/*", SdncSimulatorJaxRs.class.getName());
testServer.waitedStart(5000);
if (!NetworkUtil.isTcpPortOpen(LOCALHOST, testServer.getPort(), 5, 10000L)) {
@@ -92,8 +93,8 @@ public class Util {
* @throws IOException if an IO errror occurs
*/
public static HttpServletServer buildSoSim() throws InterruptedException, IOException {
- final HttpServletServer testServer =
- HttpServletServer.factory.build(SOSIM_SERVER_NAME, LOCALHOST, SOSIM_SERVER_PORT, "/", false, true);
+ final HttpServletServer testServer = HttpServletServerFactoryInstance.getServerFactory()
+ .build(SOSIM_SERVER_NAME, LOCALHOST, SOSIM_SERVER_PORT, "/", false, true);
testServer.addServletClass("/*", SoSimulatorJaxRs.class.getName());
testServer.waitedStart(5000);
if (!NetworkUtil.isTcpPortOpen(LOCALHOST, testServer.getPort(), 5, 10000L)) {
@@ -110,8 +111,8 @@ public class Util {
* @throws IOException if an IO errror occurs
*/
public static HttpServletServer buildVfcSim() throws InterruptedException, IOException {
- final HttpServletServer testServer =
- HttpServletServer.factory.build(VFCSIM_SERVER_NAME,LOCALHOST, VFCSIM_SERVER_PORT, "/", false, true);
+ final HttpServletServer testServer = HttpServletServerFactoryInstance.getServerFactory()
+ .build(VFCSIM_SERVER_NAME, LOCALHOST, VFCSIM_SERVER_PORT, "/", false, true);
testServer.addServletClass("/*", VfcSimulatorJaxRs.class.getName());
testServer.waitedStart(5000);
if (!NetworkUtil.isTcpPortOpen(LOCALHOST, testServer.getPort(), 5, 10000L)) {
@@ -128,8 +129,8 @@ public class Util {
* @throws IOException if an IO errror occurs
*/
public static HttpServletServer buildGuardSim() throws InterruptedException, IOException {
- HttpServletServer testServer = HttpServletServer.factory.build(GUARDSIM_SERVER_NAME, LOCALHOST,
- GUARDSIM_SERVER_PORT, "/", false, true);
+ HttpServletServer testServer = HttpServletServerFactoryInstance.getServerFactory().build(GUARDSIM_SERVER_NAME,
+ LOCALHOST, GUARDSIM_SERVER_PORT, "/", false, true);
testServer.setSerializationProvider(GsonMessageBodyHandler.class.getName());
testServer.addServletClass("/*", GuardSimulatorJaxRs.class.getName());
testServer.waitedStart(5000);