From a1f049f070f230c9c4092f4062f7de2e1239de7c Mon Sep 17 00:00:00 2001 From: Naduni Pamudika Date: Tue, 23 Jan 2024 19:44:28 +0530 Subject: [PATCH] Stop servers after executing the tests --- modules/integration/tests-integration/pom.xml | 2 +- .../integration/tests/other/SOAPAPIImportExportTestCase.java | 3 +++ .../websocket/WebSocketAPIInvocationWithTracingTestCase.java | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/integration/tests-integration/pom.xml b/modules/integration/tests-integration/pom.xml index e5b236ff2f..f188ee3967 100644 --- a/modules/integration/tests-integration/pom.xml +++ b/modules/integration/tests-integration/pom.xml @@ -31,7 +31,7 @@ under the License. pom - + tests-benchmark tests-backend tests-restart diff --git a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/other/SOAPAPIImportExportTestCase.java b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/other/SOAPAPIImportExportTestCase.java index 1e52dd84f8..9ad843e699 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/other/SOAPAPIImportExportTestCase.java +++ b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/other/SOAPAPIImportExportTestCase.java @@ -220,6 +220,9 @@ public static Object[][] userModeDataProvider() { @AfterClass(alwaysRun = true) public void destroy() throws Exception { + if (wireMockServer != null) { + wireMockServer.stop(); + } restAPIPublisher.deleteAPI(newSoapToRestAPIId); userManagementClient.deleteRole(SOAPTOREST_ROLE); userManagementClient.deleteUser(SOAPTOREST_TEST_USER); diff --git a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/websocket/WebSocketAPIInvocationWithTracingTestCase.java b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/websocket/WebSocketAPIInvocationWithTracingTestCase.java index 3f84de3b67..128d6b12c0 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/websocket/WebSocketAPIInvocationWithTracingTestCase.java +++ b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/websocket/WebSocketAPIInvocationWithTracingTestCase.java @@ -330,6 +330,9 @@ private void waitForReply(WebSocketClientImpl clientSocket) { @AfterClass(alwaysRun = true) public void destroy() throws Exception { + if (server != null) { + server.stop(); + } executorService.shutdownNow(); serverConfigurationManager.restoreToLastConfiguration(); }