From f4bd2f5aa122bc790540799cd13c3f19ac394376 Mon Sep 17 00:00:00 2001 From: AnuGayan Date: Wed, 6 Mar 2024 23:27:57 +0530 Subject: [PATCH] Update Test framework with profiles --- modules/integration/tests-integration/pom.xml | 43 ++++++++++++++++--- .../tests/util/APIMCarbonServerExtension.java | 4 -- .../tests-integration/tests-restart/pom.xml | 5 +++ .../server/restart/ServerRestartTestCase.java | 2 +- 4 files changed, 43 insertions(+), 11 deletions(-) diff --git a/modules/integration/tests-integration/pom.xml b/modules/integration/tests-integration/pom.xml index f4c17a4ee9..15a92d26ff 100644 --- a/modules/integration/tests-integration/pom.xml +++ b/modules/integration/tests-integration/pom.xml @@ -30,10 +30,41 @@ under the License. org.wso2.carbon.am.integration.test pom - - - tests-backend - - - + + + default + + true + + + tests-benchmark + tests-backend + tests-restart + + + + without-restart + + tests-backend + + + + benchmark-restart + + tests-benchmark + tests-restart + + + + benchmark-test + + tests-benchmark + + + + skip-test + + + + diff --git a/modules/integration/tests-integration/tests-benchmark/src/test/java/org/wso2/am/integration/tests/util/APIMCarbonServerExtension.java b/modules/integration/tests-integration/tests-benchmark/src/test/java/org/wso2/am/integration/tests/util/APIMCarbonServerExtension.java index 363a200bae..f7280ad84a 100644 --- a/modules/integration/tests-integration/tests-benchmark/src/test/java/org/wso2/am/integration/tests/util/APIMCarbonServerExtension.java +++ b/modules/integration/tests-integration/tests-benchmark/src/test/java/org/wso2/am/integration/tests/util/APIMCarbonServerExtension.java @@ -139,14 +139,10 @@ public void configureServer() throws AutomationFrameworkException { WebAppDeploymentUtil.copyWebApp(relativeResourcePath + File.separator + "war" + File.separator + APIMIntegrationConstants.JAXRS_BASIC_WEB_APP_NAME + ".war", webappsPath + APIMIntegrationConstants.JAXRS_BASIC_WEB_APP_NAME); - WebAppDeploymentUtil.waitForWebappToDeploy( - webappsPath + APIMIntegrationConstants.JAXRS_BASIC_WEB_APP_NAME + ".war", 120000L); WebAppDeploymentUtil.copyWebApp(relativeResourcePath + File.separator + "war" + File.separator + APIMIntegrationConstants.AM_MONITORING_WEB_APP_NAME + ".war", webappsPath + APIMIntegrationConstants.AM_MONITORING_WEB_APP_NAME); - WebAppDeploymentUtil.waitForWebappToDeploy( - webappsPath + APIMIntegrationConstants.AM_MONITORING_WEB_APP_NAME + ".war", 120000L); log.info("Web Apps Deployed"); } catch (IOException e) { diff --git a/modules/integration/tests-integration/tests-restart/pom.xml b/modules/integration/tests-integration/tests-restart/pom.xml index 508497c9b5..ef748542a1 100644 --- a/modules/integration/tests-integration/tests-restart/pom.xml +++ b/modules/integration/tests-integration/tests-restart/pom.xml @@ -662,6 +662,11 @@ under the License. xmlunit-core test + + net.minidev + json-smart + test + org.xmlunit xmlunit-matchers diff --git a/modules/integration/tests-integration/tests-restart/src/test/java/org/wso2/am/integration/tests/server/restart/ServerRestartTestCase.java b/modules/integration/tests-integration/tests-restart/src/test/java/org/wso2/am/integration/tests/server/restart/ServerRestartTestCase.java index d5465b32e5..cb9bd083c8 100644 --- a/modules/integration/tests-integration/tests-restart/src/test/java/org/wso2/am/integration/tests/server/restart/ServerRestartTestCase.java +++ b/modules/integration/tests-integration/tests-restart/src/test/java/org/wso2/am/integration/tests/server/restart/ServerRestartTestCase.java @@ -616,7 +616,7 @@ public void setEnvironment(ITestContext ctx) throws Exception { HttpResponse apiLoggingLoggingResponse = HTTPSClientUtils.doGet(getStoreURLHttps() + "api/am/devops/v0/tenant-logs/carbon.super/apis?log-level=full", apiLoggingHeader); Assert.assertEquals(apiLoggingLoggingResponse.getData(), "{\"apis\":[{\"context\":\"/" + "apiloggingtest" + "/" + "1.0.0" + "\"," - + "\"logLevel\":\"FULL\",\"apiId\":\"" + apiLoggingApiId + "\"}]}"); + + "\"logLevel\":\"FULL\",\"apiId\":\"" + apiLoggingApiId + "\",\"resourceMethod\":null,\"resourcePath\":null}]}"); ctx.setAttribute("apiLoggingApplicationId", apiLoggingApplicationId); /*