From 9b5c5d98fa80fb2ac7d54002b6fdf35ca70b8a18 Mon Sep 17 00:00:00 2001 From: Rosen Silva Date: Fri, 3 Mar 2023 09:14:29 +0530 Subject: [PATCH] Revert "Add tests to registry resource parameter deployment with CAPP" --- .../RegistryResourceDeploymentTestCase.java | 93 ------------------- ...regresCompositeExporter_1.0.0-SNAPSHOT.car | 0 .../src/test/resources/testng.xml | 1 - 3 files changed, 94 deletions(-) delete mode 100644 integration/mediation-tests/tests-patches/src/test/java/org/wso2/carbon/esb/car/deployment/test/RegistryResourceDeploymentTestCase.java delete mode 100644 integration/mediation-tests/tests-patches/src/test/resources/artifacts/ESB/car/regresCompositeExporter_1.0.0-SNAPSHOT.car diff --git a/integration/mediation-tests/tests-patches/src/test/java/org/wso2/carbon/esb/car/deployment/test/RegistryResourceDeploymentTestCase.java b/integration/mediation-tests/tests-patches/src/test/java/org/wso2/carbon/esb/car/deployment/test/RegistryResourceDeploymentTestCase.java deleted file mode 100644 index 3d4211e61a..0000000000 --- a/integration/mediation-tests/tests-patches/src/test/java/org/wso2/carbon/esb/car/deployment/test/RegistryResourceDeploymentTestCase.java +++ /dev/null @@ -1,93 +0,0 @@ -/** - Copyright (c) 2023, WSO2 LLC. (http://wso2.com) All Rights Reserved. - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - */ - -package org.wso2.carbon.esb.car.deployment.test; - -import junit.framework.Assert; -import org.apache.http.HttpResponse; -import org.awaitility.Awaitility; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; -import org.wso2.carbon.integration.common.admin.client.LogViewerClient; -import org.wso2.carbon.logging.view.data.xsd.LogEvent; -import org.wso2.esb.integration.common.utils.ESBIntegrationTest; -import org.wso2.esb.integration.common.utils.clients.SimpleHttpClient; - -import javax.activation.DataHandler; -import javax.activation.FileDataSource; -import java.io.File; -import java.nio.file.Paths; -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.Callable; -import java.util.concurrent.TimeUnit; - -import static org.testng.Assert.assertTrue; - -public class RegistryResourceDeploymentTestCase extends ESBIntegrationTest { - - private LogViewerClient logViewer; - @BeforeClass(alwaysRun = true) - protected void uploadRegistryResourceCarFileTest() throws Exception { - super.init(); - deployCar(); - logViewer = new LogViewerClient(contextUrls.getBackEndUrl(), getSessionCookie()); - } - @Test(groups = "wso2.esb", enabled = true, description = "Test registry resources with properties are deployed " + - "with a CAPP") - public void testRegistryResourcePropertiesDeployed() throws Exception { - logViewer.clearLogs(); - String proxyHttpUrl = getProxyServiceURLHttp("readRegistryProperty"); - SimpleHttpClient simpleHttpClient = new SimpleHttpClient(); - Map headers = new HashMap<>(); - deployCar(); - Awaitility.await() - .pollInterval(50, TimeUnit.MILLISECONDS) - .atMost(60, TimeUnit.SECONDS) - .until(isProxyExist()); - HttpResponse httpResponse = simpleHttpClient.doGet(proxyHttpUrl, headers); - Assert.assertEquals(200, httpResponse.getStatusLine().getStatusCode()); - LogEvent[] logs = logViewer.getAllRemoteSystemLogs(); - int afterLogSize = logs.length; - boolean proxyhostEntryFound = false; - for (int i = 0; i < afterLogSize; i++) { - if (logs[i].getMessage().contains("regValue")) { - proxyhostEntryFound = true; - break; - } - } - assertTrue(proxyhostEntryFound); - } - - private Callable isProxyExist() { - return new Callable() { - @Override - public Boolean call() throws Exception { - return esbUtils.isProxyServiceExist(contextUrls.getBackEndUrl(), sessionCookie, "readRegistryProperty"); - } - }; - } - - @AfterTest(alwaysRun = true) - public void cleanupEnvironment() throws Exception { - super.cleanup(); - } - - private void deployCar() throws Exception { - String cAppPath = - Paths.get(getESBResourceLocation(), "car", "regresCompositeExporter_1.0.0-SNAPSHOT.car").toString(); - uploadCapp("regresCompositeExporter_1.0.0-SNAPSHOT.car", - new DataHandler(new FileDataSource(new File( cAppPath)))); - } -} diff --git a/integration/mediation-tests/tests-patches/src/test/resources/artifacts/ESB/car/regresCompositeExporter_1.0.0-SNAPSHOT.car b/integration/mediation-tests/tests-patches/src/test/resources/artifacts/ESB/car/regresCompositeExporter_1.0.0-SNAPSHOT.car deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/integration/mediation-tests/tests-patches/src/test/resources/testng.xml b/integration/mediation-tests/tests-patches/src/test/resources/testng.xml index c61e6f809b..35e40fb71e 100644 --- a/integration/mediation-tests/tests-patches/src/test/resources/testng.xml +++ b/integration/mediation-tests/tests-patches/src/test/resources/testng.xml @@ -165,7 +165,6 @@ -