diff options
author | Jorge Hernandez <jorge.hernandez-herrero@att.com> | 2019-04-16 22:07:38 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-04-16 22:07:38 +0000 |
commit | b4aa71d0d93749593d564936ef0a0ac5f5a06199 (patch) | |
tree | 74878c5a9ca8b1dd633beb0b6b377f38db29d5f4 /main/src | |
parent | 241aa508172037a7fd5a17d4d9217e660a2bad48 (diff) | |
parent | 326ec8210cd8849aa113a5eb615778b6bc987222 (diff) |
Merge "Clear servlets at the start of tests"
Diffstat (limited to 'main/src')
3 files changed, 7 insertions, 0 deletions
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 32eb3b2c..e7b412dc 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 @@ -42,6 +42,7 @@ import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; +import org.onap.policy.common.endpoints.http.server.HttpServletServer; import org.onap.policy.common.gson.GsonMessageBodyHandler; import org.onap.policy.common.utils.coder.Coder; import org.onap.policy.common.utils.coder.StandardCoder; @@ -95,6 +96,8 @@ public class CommonPapRestServer { makeConfigFile(); + HttpServletServer.factory.destroy(); + startMain(); } 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 650e8243..5ed94a36 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,6 +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.utils.services.Registry; import org.onap.policy.pap.main.PapConstants; import org.onap.policy.pap.main.PolicyPapException; @@ -47,6 +48,7 @@ public class TestMain { @Before public void setUp() { Registry.newRegistry(); + HttpServletServer.factory.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 6c9e092e..f369488a 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 @@ -33,6 +33,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.utils.services.Registry; import org.onap.policy.pap.main.PapConstants; import org.onap.policy.pap.main.PolicyPapException; @@ -60,6 +61,7 @@ public class TestPapActivator { @Before public void setUp() throws Exception { Registry.newRegistry(); + HttpServletServer.factory.destroy(); final String[] papConfigParameters = {"-c", "parameters/PapConfigParameters.json", "-p", "parameters/topic.properties"}; |