aboutsummaryrefslogtreecommitdiffstats
path: root/models-interactions/model-simulators/src/main/java/org/onap/policy/simulators/Util.java
diff options
context:
space:
mode:
authorFrancescoFioraEst <francesco.fiora@est.tech>2023-08-30 15:19:32 +0100
committerFrancesco Fiora <francesco.fiora@est.tech>2023-08-30 15:04:51 +0000
commit568108055e1c8fcd1bccacc515056f4f434f27b9 (patch)
treed46c6e50250de4be8dd2cab2515b1e57a66ad4a2 /models-interactions/model-simulators/src/main/java/org/onap/policy/simulators/Util.java
parentf302b69e3af1779b77142f20110947d4d189f298 (diff)
Fix Simulator Buildersjava-17
Simulator Builders have to return a HttpServletServer Object because are used by drools-applications. Issue-ID: POLICY-4814 Change-Id: If3dbe5db437464d291c7b3e14183159aa6b35cbb Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
Diffstat (limited to 'models-interactions/model-simulators/src/main/java/org/onap/policy/simulators/Util.java')
-rw-r--r--models-interactions/model-simulators/src/main/java/org/onap/policy/simulators/Util.java15
1 files changed, 10 insertions, 5 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 bfbacc697..f5408c410 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
@@ -60,12 +60,13 @@ public final class Util {
*
* @throws InterruptedException if a thread is interrupted
*/
- public static void buildAaiSim() throws InterruptedException {
+ public static HttpServletServer buildAaiSim() throws InterruptedException {
final HttpServletServer testServer = HttpServletServerFactoryInstance.getServerFactory()
.build(AAISIM_SERVER_NAME, LOCALHOST, AAISIM_SERVER_PORT, "/", false, true);
testServer.addServletClass("/*", AaiSimulatorJaxRs.class.getName());
testServer.waitedStart(5000);
waitForServerToListen(testServer.getPort());
+ return testServer;
}
/**
@@ -87,12 +88,13 @@ public final class Util {
*
* @throws InterruptedException if a thread is interrupted
*/
- public static void buildSdncSim() throws InterruptedException {
+ public static HttpServletServer buildSdncSim() throws InterruptedException {
final HttpServletServer testServer = HttpServletServerFactoryInstance.getServerFactory()
.build(SDNCSIM_SERVER_NAME, LOCALHOST, SDNCSIM_SERVER_PORT, "/", false, true);
testServer.addServletClass("/*", SdncSimulatorJaxRs.class.getName());
testServer.waitedStart(5000);
waitForServerToListen(testServer.getPort());
+ return testServer;
}
@@ -101,12 +103,13 @@ public final class Util {
*
* @throws InterruptedException if a thread is interrupted
*/
- public static void buildSoSim() throws InterruptedException {
+ public static HttpServletServer buildSoSim() throws InterruptedException {
final HttpServletServer testServer = HttpServletServerFactoryInstance.getServerFactory()
.build(SOSIM_SERVER_NAME, LOCALHOST, SOSIM_SERVER_PORT, "/", false, true);
testServer.addServletClass("/*", SoSimulatorJaxRs.class.getName());
testServer.waitedStart(5000);
waitForServerToListen(testServer.getPort());
+ return testServer;
}
/**
@@ -114,12 +117,13 @@ public final class Util {
*
* @throws InterruptedException if a thread is interrupted
*/
- public static void buildVfcSim() throws InterruptedException {
+ public static HttpServletServer buildVfcSim() throws InterruptedException {
final HttpServletServer testServer = HttpServletServerFactoryInstance.getServerFactory()
.build(VFCSIM_SERVER_NAME, LOCALHOST, VFCSIM_SERVER_PORT, "/", false, true);
testServer.addServletClass("/*", VfcSimulatorJaxRs.class.getName());
testServer.waitedStart(5000);
waitForServerToListen(testServer.getPort());
+ return testServer;
}
/**
@@ -127,12 +131,13 @@ public final class Util {
*
* @throws InterruptedException if a thread is interrupted
*/
- public static void buildXacmlSim() throws InterruptedException {
+ public static HttpServletServer buildXacmlSim() throws InterruptedException {
HttpServletServer testServer = HttpServletServerFactoryInstance.getServerFactory().build(XACMLSIM_SERVER_NAME,
LOCALHOST, XACMLSIM_SERVER_PORT, "/", false, true);
testServer.addServletClass("/*", XacmlSimulatorJaxRs.class.getName());
testServer.waitedStart(5000);
waitForServerToListen(testServer.getPort());
+ return testServer;
}
/**