aboutsummaryrefslogtreecommitdiffstats
path: root/controlloop/common/simulators
diff options
context:
space:
mode:
Diffstat (limited to 'controlloop/common/simulators')
-rw-r--r--controlloop/common/simulators/src/main/java/org/onap/policy/simulators/SoSimulatorJaxRs.java2
-rw-r--r--controlloop/common/simulators/src/main/java/org/onap/policy/simulators/Util.java90
2 files changed, 48 insertions, 44 deletions
diff --git a/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/SoSimulatorJaxRs.java b/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/SoSimulatorJaxRs.java
index e70a88517..eb12362ee 100644
--- a/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/SoSimulatorJaxRs.java
+++ b/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/SoSimulatorJaxRs.java
@@ -34,7 +34,7 @@ public class SoSimulatorJaxRs {
@Path("/v5/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules")
@Consumes(MediaType.APPLICATION_JSON)
@Produces("application/json")
- public String SoPostQuery(@PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId)
+ public String soPostQuery(@PathParam("serviceInstanceId") String serviceInstanceId, @PathParam("vnfInstanceId") String vnfInstanceId)
{
// the requestID contained in the SO Response is a newly generated requestID
diff --git a/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/Util.java b/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/Util.java
index cd45d3134..05afd1179 100644
--- a/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/Util.java
+++ b/controlloop/common/simulators/src/main/java/org/onap/policy/simulators/Util.java
@@ -26,52 +26,56 @@ import org.onap.policy.drools.http.server.HttpServletServer;
import org.onap.policy.drools.utils.NetworkUtil;
public class Util {
- public static final String AAISIM_SERVER_NAME = "aaiSim";
- public static final String SOSIM_SERVER_NAME = "soSim";
- public static final String VFCSIM_SERVER_NAME = "vfcSim";
- public static final String GUARDSIM_SERVER_NAME = "guardSim";
+ private Util() {
+ // Prevent instantiation of thic class
+ }
- public static final int AAISIM_SERVER_PORT = 6666;
- public static final int SOSIM_SERVER_PORT = 6667;
- public static final int VFCSIM_SERVER_PORT = 6668;
- public static final int GUARDSIM_SERVER_PORT = 6669;
+ public static final String AAISIM_SERVER_NAME = "aaiSim";
+ public static final String SOSIM_SERVER_NAME = "soSim";
+ public static final String VFCSIM_SERVER_NAME = "vfcSim";
+ public static final String GUARDSIM_SERVER_NAME = "guardSim";
- public static HttpServletServer buildAaiSim() throws InterruptedException, IOException {
- final HttpServletServer testServer = HttpServletServer.factory.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))
- throw new IllegalStateException("cannot connect to port " + testServer.getPort());
- return testServer;
- }
+ public static final int AAISIM_SERVER_PORT = 6666;
+ public static final int SOSIM_SERVER_PORT = 6667;
+ public static final int VFCSIM_SERVER_PORT = 6668;
+ public static final int GUARDSIM_SERVER_PORT = 6669;
- public static HttpServletServer buildSoSim() throws InterruptedException, IOException {
- final HttpServletServer testServer = HttpServletServer.factory.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))
- throw new IllegalStateException("cannot connect to port " + testServer.getPort());
- return testServer;
- }
+ public static HttpServletServer buildAaiSim() throws InterruptedException, IOException {
+ final HttpServletServer testServer = HttpServletServer.factory.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))
+ throw new IllegalStateException("cannot connect to port " + testServer.getPort());
+ return testServer;
+ }
- public static HttpServletServer buildVfcSim() throws InterruptedException, IOException {
- final HttpServletServer testServer = HttpServletServer.factory.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))
- throw new IllegalStateException("cannot connect to port " + testServer.getPort());
- return testServer;
- }
+ public static HttpServletServer buildSoSim() throws InterruptedException, IOException {
+ final HttpServletServer testServer = HttpServletServer.factory.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))
+ throw new IllegalStateException("cannot connect to port " + testServer.getPort());
+ return testServer;
+ }
- public static HttpServletServer buildGuardSim() throws InterruptedException, IOException {
- HttpServletServer testServer = HttpServletServer.factory.build(GUARDSIM_SERVER_NAME, "localhost", GUARDSIM_SERVER_PORT, "/", false, true);
- testServer.addServletClass("/*", GuardSimulatorJaxRs.class.getName());
- testServer.waitedStart(5000);
- if (!NetworkUtil.isTcpPortOpen("localhost", testServer.getPort(), 5, 10000L))
- throw new IllegalStateException("cannot connect to port " + testServer.getPort());
- return testServer;
- }
+ public static HttpServletServer buildVfcSim() throws InterruptedException, IOException {
+ final HttpServletServer testServer = HttpServletServer.factory.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))
+ throw new IllegalStateException("cannot connect to port " + testServer.getPort());
+ return testServer;
+ }
+
+ public static HttpServletServer buildGuardSim() throws InterruptedException, IOException {
+ HttpServletServer testServer = HttpServletServer.factory.build(GUARDSIM_SERVER_NAME, "localhost", GUARDSIM_SERVER_PORT, "/", false, true);
+ testServer.addServletClass("/*", GuardSimulatorJaxRs.class.getName());
+ testServer.waitedStart(5000);
+ if (!NetworkUtil.isTcpPortOpen("localhost", testServer.getPort(), 5, 10000L))
+ throw new IllegalStateException("cannot connect to port " + testServer.getPort());
+ return testServer;
+ }
}