From aa5a8a36f066bcc14f9637771320ed25221a0cef Mon Sep 17 00:00:00 2001 From: moremind Date: Mon, 13 Nov 2023 21:58:16 +0800 Subject: [PATCH] [type:refactor] refactor module --- shenyu-e2e/shenyu-e2e-case/pom.xml | 1 - .../shenyu-e2e-case-brpc/pom.xml | 31 -- .../e2e/testcase/brpc/BrpcPluginCases.java | 358 -------------- .../e2e/testcase/brpc/BrpcPluginTest.java | 138 ------ .../src/test/resources/admin-application.yml | 123 ----- .../test/resources/bootstrap-application.yml | 335 ------------- .../test/resources/docker-compose.mysql.yml | 144 ------ .../src/test/resources/admin-application.yml | 123 ----- .../test/resources/bootstrap-application.yml | 335 ------------- .../test/resources/docker-compose.mysql.yml | 127 ----- .../e2e/engine/annotation/ShenYuTest1.java | 143 ------ .../engine/config/ShenYuEngineConfigure1.java | 460 ------------------ 12 files changed, 2318 deletions(-) delete mode 100644 shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-brpc/pom.xml delete mode 100644 shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-brpc/src/test/java/org/apache/shenyu/e2e/testcase/brpc/BrpcPluginCases.java delete mode 100644 shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-brpc/src/test/java/org/apache/shenyu/e2e/testcase/brpc/BrpcPluginTest.java delete mode 100755 shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-brpc/src/test/resources/admin-application.yml delete mode 100644 shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-brpc/src/test/resources/bootstrap-application.yml delete mode 100644 shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-brpc/src/test/resources/docker-compose.mysql.yml delete mode 100755 shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-sofa/src/test/resources/admin-application.yml delete mode 100644 shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-sofa/src/test/resources/bootstrap-application.yml delete mode 100644 shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-sofa/src/test/resources/docker-compose.mysql.yml delete mode 100644 shenyu-e2e/shenyu-e2e-engine/src/main/java/org/apache/shenyu/e2e/engine/annotation/ShenYuTest1.java delete mode 100644 shenyu-e2e/shenyu-e2e-engine/src/main/java/org/apache/shenyu/e2e/engine/config/ShenYuEngineConfigure1.java diff --git a/shenyu-e2e/shenyu-e2e-case/pom.xml b/shenyu-e2e/shenyu-e2e-case/pom.xml index 56b996301026..c14d2cc15dce 100644 --- a/shenyu-e2e/shenyu-e2e-case/pom.xml +++ b/shenyu-e2e/shenyu-e2e-case/pom.xml @@ -37,7 +37,6 @@ shenyu-e2e-case-sofa shenyu-e2e-case-motan shenyu-e2e-case-grpc - shenyu-e2e-case-brpc shenyu-e2e-case-websocket diff --git a/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-brpc/pom.xml b/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-brpc/pom.xml deleted file mode 100644 index 0ea83f027618..000000000000 --- a/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-brpc/pom.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - org.apache.shenyu - shenyu-e2e-case - 0.0.1-SNAPSHOT - - 4.0.0 - - shenyu-e2e-case-brpc - - \ No newline at end of file diff --git a/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-brpc/src/test/java/org/apache/shenyu/e2e/testcase/brpc/BrpcPluginCases.java b/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-brpc/src/test/java/org/apache/shenyu/e2e/testcase/brpc/BrpcPluginCases.java deleted file mode 100644 index 38de2dc9f84c..000000000000 --- a/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-brpc/src/test/java/org/apache/shenyu/e2e/testcase/brpc/BrpcPluginCases.java +++ /dev/null @@ -1,358 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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.apache.shenyu.e2e.testcase.brpc; - -import com.google.common.collect.Lists; -import io.restassured.http.Method; -import org.apache.shenyu.e2e.engine.scenario.ShenYuScenarioProvider; -import org.apache.shenyu.e2e.engine.scenario.specification.ScenarioSpec; -import org.apache.shenyu.e2e.engine.scenario.specification.ShenYuAfterEachSpec; -import org.apache.shenyu.e2e.engine.scenario.specification.ShenYuBeforeEachSpec; -import org.apache.shenyu.e2e.engine.scenario.specification.ShenYuCaseSpec; -import org.apache.shenyu.e2e.engine.scenario.specification.ShenYuScenarioSpec; -import org.apache.shenyu.e2e.model.Plugin; -import org.apache.shenyu.e2e.model.data.Condition; - -import java.util.List; -import java.util.concurrent.ConcurrentHashMap; - -import static org.apache.shenyu.e2e.engine.scenario.function.HttpCheckers.exists; -import static org.apache.shenyu.e2e.engine.scenario.function.HttpCheckers.notExists; -import static org.apache.shenyu.e2e.template.ResourceDataTemplate.newCondition; -import static org.apache.shenyu.e2e.template.ResourceDataTemplate.newConditions; -import static org.apache.shenyu.e2e.template.ResourceDataTemplate.newRuleBuilder; -import static org.apache.shenyu.e2e.template.ResourceDataTemplate.newSelectorBuilder; - -public class BrpcPluginCases implements ShenYuScenarioProvider { - - @Override - public List get() { - return Lists.newArrayList( - testWithUriEquals(), - testWithUriPathPattern(), - testWithUriStartWith(), - testWithEndWith(), - testWithMethodGet(), - testWithMethodPost(), - testWithMethodPut(), - testWithMethodDelete() - ); - } - - /** - * test with uri equal. - * - * @return ShenYuScenarioSpec - */ - public ShenYuScenarioSpec testWithUriEquals() { - ConcurrentHashMap body = new ConcurrentHashMap<>(); - body.put("userId", 127); - return ShenYuScenarioSpec.builder() - .name("single-brpc uri =]") - .beforeEachSpec( - ShenYuBeforeEachSpec.builder() - .addSelectorAndRule( - newSelectorBuilder("selector", Plugin.BRPC) - .conditionList(newConditions(Condition.ParamType.URI, Condition.Operator.EQUAL, "/brpc/getUser")) - .build(), - newRuleBuilder("rule") - .conditionList(newConditions(Condition.ParamType.URI, Condition.Operator.EQUAL, "/brpc/getUser")) - .build() - ) - .checker(notExists("/brpc/testchecker")) - .waiting(exists(Method.POST, "/brpc/getUser", body)) - .build() - ) - .caseSpec( - ShenYuCaseSpec.builder() - .addExists(Method.POST, "/brpc/getUser", body) - .addNotExists("/brpc/fin") - .addNotExists("/put") - .addNotExists("/get") - .build()) - .afterEachSpec(ShenYuAfterEachSpec.builder().deleteWaiting(notExists("/brpc/testchecker")).build()) - .build(); - } - - /** - * test case with uri path pattern. - * - * @return ShenYuScenarioSpec - */ - public ShenYuScenarioSpec testWithUriPathPattern() { - ConcurrentHashMap body = new ConcurrentHashMap<>(); - body.put("userId", 127); - return ShenYuScenarioSpec.builder() - .name("single-brpc uri path_pattern]") - .beforeEachSpec( - ShenYuBeforeEachSpec.builder() - .addSelectorAndRule( - newSelectorBuilder("selector", Plugin.BRPC) - .conditionList(newConditions(Condition.ParamType.URI, Condition.Operator.PATH_PATTERN, "/brpc/**")) - .build(), - newRuleBuilder("rule") - .conditionList(newConditions(Condition.ParamType.URI, Condition.Operator.PATH_PATTERN, "/brpc/**")) - .build() - ) - .checker(notExists("/brpc/testchecker")) - .waiting(exists(Method.POST, "/brpc/getUser", body)) - .build() - ).caseSpec( - ShenYuCaseSpec.builder() - .addExists(Method.POST, "/brpc/getUser", body) - .addNotExists("/brp") - .addNotExists(Method.PUT, "/brpc/testP") - .addNotExists(Method.DELETE, "/brpc/testD") - .build()) - .afterEachSpec(ShenYuAfterEachSpec.builder().deleteWaiting(notExists("/brpc/testchecker")).build()) - .build(); - } - - /** - * test case with uri start with. - * - * @return ShenYuScenarioSpec - */ - public ShenYuScenarioSpec testWithUriStartWith() { - ConcurrentHashMap body = new ConcurrentHashMap<>(); - body.put("userId", 127); - return ShenYuScenarioSpec.builder() - .name("single-brpc uri starts_with]") - .beforeEachSpec( - ShenYuBeforeEachSpec.builder() - .addSelectorAndRule( - newSelectorBuilder("selector", Plugin.BRPC) - .conditionList(newConditions(Condition.ParamType.URI, Condition.Operator.STARTS_WITH, "/brpc/")) - .build(), - newRuleBuilder("rule") - .conditionList(newConditions(Condition.ParamType.URI, Condition.Operator.STARTS_WITH, "/brpc/")) - .build() - ) - .checker(notExists("/brpc/testcheck")) - .waiting(exists(Method.POST, "/brpc/getUser", body)) - .build() - ) - .caseSpec( - ShenYuCaseSpec.builder() - .addExists(Method.POST, "/brpc/getUser", body) - .addNotExists("/brpc/de") - .addNotExists(Method.POST, "/brpc/testpost") - .addNotExists(Method.PUT, "/brpc/testput") - .addNotExists(Method.DELETE, "/brpc/tesdelete") - .build()) - .afterEachSpec(ShenYuAfterEachSpec.builder().deleteWaiting(notExists("/brpc/testcheck")).build()) - .build(); - } - - /** - * test case with uri end with. - * - * @return ShenYuScenarioSpec - */ - public ShenYuScenarioSpec testWithEndWith() { - ConcurrentHashMap body = new ConcurrentHashMap<>(); - body.put("userId", 127); - return ShenYuScenarioSpec.builder() - .name("single-brpc uri ends_with]") - .beforeEachSpec( - ShenYuBeforeEachSpec.builder() - .addSelectorAndRule( - newSelectorBuilder("selector", Plugin.BRPC) - .conditionList(newConditions(Condition.ParamType.URI, Condition.Operator.ENDS_WITH, "/getUser")) - .build(), - newRuleBuilder("rule") - .conditionList(newConditions(Condition.ParamType.URI, Condition.Operator.ENDS_WITH, "/getUser")) - .build() - ) - .waiting(exists(Method.POST, "/brpc/getUser", body)) - .checker(notExists("/brpc/testcheck")) - .build() - ) - .caseSpec( - ShenYuCaseSpec.builder() - .addExists(Method.POST, "/brpc/getUser", body) - .addNotExists("/brpc/find") - .addNotExists(Method.POST, "/brpc/testPost") - .addNotExists(Method.PUT, "/brpc/testPut") - .addNotExists(Method.DELETE, "/brpc/testDelete") - .build()) - .afterEachSpec(ShenYuAfterEachSpec.builder().deleteWaiting(notExists("/brpc/testcheck")).build()) - .build(); - } - - /** - * test with uri method get. - * - * @return ShenYuScenarioSpec - */ - public ShenYuScenarioSpec testWithMethodGet() { - ConcurrentHashMap body = new ConcurrentHashMap<>(); - body.put("userId", 127); - return ShenYuScenarioSpec.builder() - .name("single-brpc uri method GET]") - .beforeEachSpec( - ShenYuBeforeEachSpec.builder() - .addSelectorAndRule( - newSelectorBuilder("selector", Plugin.BRPC) - .conditionList(Lists.newArrayList( - newCondition(Condition.ParamType.METHOD, Condition.Operator.EQUAL, "GET"), - newCondition(Condition.ParamType.URI, Condition.Operator.EQUAL, "/brpc/bigObject0") - )) - .build(), - newRuleBuilder("rule") - .conditionList(Lists.newArrayList( - newCondition(Condition.ParamType.METHOD, Condition.Operator.EQUAL, "GET"), - newCondition(Condition.ParamType.URI, Condition.Operator.EQUAL, "/brpc/bigObject0") - )) - .build() - ) - .checker(notExists(Method.GET, "/brpc/tesget")) - .waiting(exists(Method.GET, "/brpc/bigObject0")) - .build() - ) - .caseSpec( - ShenYuCaseSpec.builder() - .addExists(Method.GET, "/brpc/bigObject0") - .addNotExists(Method.GET, "/brpc/testget") - .addNotExists(Method.POST, "/brpc/testpod") - .addNotExists(Method.PUT, "/brpc/testput") - .addNotExists(Method.DELETE, "/brpc/testdelete") - .build()) - .afterEachSpec(ShenYuAfterEachSpec.builder().deleteWaiting(notExists(Method.GET, "/brpc/tesget")).build()) - .build(); - } - - /** - * test with uri method post. - * - * @return ShenYuScenarioSpec - */ - public ShenYuScenarioSpec testWithMethodPost() { - ConcurrentHashMap body = new ConcurrentHashMap<>(); - body.put("userId", 127); - return ShenYuScenarioSpec.builder() - .name("single-brpc uri method POST]") - .beforeEachSpec( - ShenYuBeforeEachSpec.builder() - .addSelectorAndRule( - newSelectorBuilder("selector", Plugin.BRPC) - .conditionList(Lists.newArrayList( - newCondition(Condition.ParamType.METHOD, Condition.Operator.EQUAL, "POST"), - newCondition(Condition.ParamType.URI, Condition.Operator.EQUAL, "/brpc/userMap") - )) - .build(), - newRuleBuilder("rule") - .conditionList(Lists.newArrayList( - newCondition(Condition.ParamType.METHOD, Condition.Operator.EQUAL, "POST"), - newCondition(Condition.ParamType.URI, Condition.Operator.EQUAL, "/brpc/userMap") - )) - .build() - ) - .checker(notExists(Method.POST, "/brpc/testpost")) - .waiting(exists(Method.POST, "/brpc/userMap", body)) - .build() - ) - .caseSpec( - ShenYuCaseSpec.builder() - .addExists(Method.POST, "/brpc/userMap", body) - .addNotExists(Method.POST, "/brpc/testpost") - .addNotExists(Method.PUT, "/brpc/testput") - .addNotExists(Method.DELETE, "/brpc/testdelete") - .build()) - .afterEachSpec(ShenYuAfterEachSpec.builder().deleteWaiting(notExists(Method.POST, "/brpc/testpost")).build()) - .build(); - } - - /** - * test with uri method put. - * - * @return ShenYuScenarioSpec - */ - public ShenYuScenarioSpec testWithMethodPut() { - return ShenYuScenarioSpec.builder() - .name("single-brpc uri method PUT]") - .beforeEachSpec( - ShenYuBeforeEachSpec.builder() - .addSelectorAndRule( - newSelectorBuilder("selector", Plugin.BRPC) - .conditionList(Lists.newArrayList( - newCondition(Condition.ParamType.METHOD, Condition.Operator.EQUAL, "PUT"), - newCondition(Condition.ParamType.URI, Condition.Operator.EQUAL, "/brpc/allName") - )) - .build(), - newRuleBuilder("rule") - .conditionList(Lists.newArrayList( - newCondition(Condition.ParamType.METHOD, Condition.Operator.EQUAL, "PUT"), - newCondition(Condition.ParamType.URI, Condition.Operator.EQUAL, "/brpc/allName") - )) - .build() - ) - .checker(notExists(Method.PUT, "/brpc/testput")) - .waiting(notExists(Method.GET, "/brpc/allName")) - .build() - ) - .caseSpec( - ShenYuCaseSpec.builder() - .addNotExists(Method.GET, "/brpc/allName") - .addNotExists(Method.PUT, "/brpc/testput") - .addNotExists(Method.POST, "/brpc/testpost") - .addNotExists(Method.DELETE, "/brpc/testdelete") - .build()) - .afterEachSpec(ShenYuAfterEachSpec.builder().deleteWaiting(notExists(Method.PUT, "/brpc/testput")).build()) - .build(); - } - - /** - * test with uri method delete. - * - * @return ShenYuScenarioSpec - */ - public ShenYuScenarioSpec testWithMethodDelete() { - return ShenYuScenarioSpec.builder() - .name("single-brpc uri method DELETE]") - .beforeEachSpec( - ShenYuBeforeEachSpec.builder() - .addSelectorAndRule( - newSelectorBuilder("selector", Plugin.BRPC) - .conditionList(Lists.newArrayList( - newCondition(Condition.ParamType.METHOD, Condition.Operator.EQUAL, "DELETE"), - newCondition(Condition.ParamType.URI, Condition.Operator.EQUAL, "/brpc/allName") - )) - .build(), - newRuleBuilder("rule") - .conditionList(Lists.newArrayList( - newCondition(Condition.ParamType.METHOD, Condition.Operator.EQUAL, "DELETE"), - newCondition(Condition.ParamType.URI, Condition.Operator.EQUAL, "/brpc/allName") - )) - .build() - ) - .checker(notExists(Method.DELETE, "/brpc/testdelete")) - .waiting(notExists(Method.GET, "/brpc/allName")) - .build() - ) - .caseSpec( - ShenYuCaseSpec.builder() - .addNotExists(Method.GET, "/brpc/allName") - .addNotExists(Method.DELETE, "/brpc/find") - .addNotExists(Method.POST, "/brpc/testpost") - .addNotExists(Method.PUT, "/brpc/testput") - .build()) - .afterEachSpec(ShenYuAfterEachSpec.builder().deleteWaiting(notExists(Method.DELETE, "/brpc/testdelete")).build()) - .build(); - } -} diff --git a/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-brpc/src/test/java/org/apache/shenyu/e2e/testcase/brpc/BrpcPluginTest.java b/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-brpc/src/test/java/org/apache/shenyu/e2e/testcase/brpc/BrpcPluginTest.java deleted file mode 100644 index 8962d03986ff..000000000000 --- a/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-brpc/src/test/java/org/apache/shenyu/e2e/testcase/brpc/BrpcPluginTest.java +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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.apache.shenyu.e2e.testcase.brpc; - -//import org.apache.shenyu.e2e.client.WaitDataSync; -//import org.apache.shenyu.e2e.client.admin.AdminClient; -//import org.apache.shenyu.e2e.client.gateway.GatewayClient; -//import org.apache.shenyu.e2e.engine.annotation.ShenYuScenario; -//import org.apache.shenyu.e2e.engine.annotation.ShenYuTest; -//import org.apache.shenyu.e2e.engine.config.ShenYuEngineConfigure; -//import org.apache.shenyu.e2e.engine.scenario.specification.AfterEachSpec; -//import org.apache.shenyu.e2e.engine.scenario.specification.BeforeEachSpec; -//import org.apache.shenyu.e2e.engine.scenario.specification.CaseSpec; -//import org.apache.shenyu.e2e.model.ResourcesData; -//import org.apache.shenyu.e2e.model.response.SelectorDTO; -//import org.junit.jupiter.api.AfterAll; -//import org.junit.jupiter.api.AfterEach; -//import org.junit.jupiter.api.Assertions; -//import org.junit.jupiter.api.BeforeAll; -//import org.junit.jupiter.api.BeforeEach; -//import org.springframework.util.LinkedMultiValueMap; -//import org.springframework.util.MultiValueMap; -//import org.testcontainers.shaded.com.google.common.collect.Lists; -// -//import java.util.List; -// -//@ShenYuTest( -// mode = ShenYuEngineConfigure.Mode.DOCKER, -// services = { -// @ShenYuTest.ServiceConfigure( -// serviceName = "admin", -// port = 9095, -// baseUrl = "http://{hostname:localhost}:9095", -// parameters = { -// @ShenYuTest.Parameter(key = "username", value = "admin"), -// @ShenYuTest.Parameter(key = "password", value = "123456"), -// @ShenYuTest.Parameter(key = "dataSyn", value = "admin_websocket") -// } -// ), -// @ShenYuTest.ServiceConfigure( -// serviceName = "gateway", -// port = 9195, -// baseUrl = "http://{hostname:localhost}:9195", -// type = ShenYuEngineConfigure.ServiceType.SHENYU_GATEWAY, -// parameters = { -// @ShenYuTest.Parameter(key = "dataSyn", value = "gateway_websocket") -// } -// ) -// }, -// dockerComposeFile = "classpath:./docker-compose.mysql.yml" -//) -///** -// * Testing brpc plugin. -// */ -//public class BrpcPluginTest { -// private List selectorIds = Lists.newArrayList(); -// -// @BeforeAll -// static void setup(final AdminClient adminClient, final GatewayClient gatewayClient) throws Exception { -// adminClient.login(); -// WaitDataSync.waitAdmin2GatewayDataSyncEquals(adminClient::listAllRules, gatewayClient::getRuleCache, adminClient); -// adminClient.syncPluginAll(); -// WaitDataSync.waitAdmin2GatewayDataSyncEquals(adminClient::listAllSelectors, gatewayClient::getSelectorCache, adminClient); -// WaitDataSync.waitAdmin2GatewayDataSyncEquals(adminClient::listAllMetaData, gatewayClient::getMetaDataCache, adminClient); -// WaitDataSync.waitAdmin2GatewayDataSyncEquals(adminClient::listAllRules, gatewayClient::getRuleCache, adminClient); -// List selectorDTOList = adminClient.listAllSelectors(); -// -// MultiValueMap formData = new LinkedMultiValueMap<>(); -// formData.add("id", "41"); -// formData.add("name", "brpc"); -// formData.add("enabled", "true"); -// formData.add("role", "Proxy"); -// formData.add("sort", "310"); -// formData.add("config", "{\"address\":\"127.0.0.1\",\"port\":\"8005\",\"corethreads\":0,\"threads\":2147483647,\"queues\":0,\"threadpool\":\"shared\"}"); -// adminClient.changePluginStatus("41", formData); -// adminClient.deleteAllSelectors(); -// selectorDTOList = adminClient.listAllSelectors(); -// Assertions.assertEquals(0, selectorDTOList.size()); -// } -// -// @BeforeEach -// void before(final AdminClient client, final GatewayClient gateway, final BeforeEachSpec spec) { -// spec.getChecker().check(gateway); -// -// ResourcesData resources = spec.getResources(); -// for (ResourcesData.Resource res : resources.getResources()) { -// SelectorDTO dto = client.create(res.getSelector()); -// selectorIds.add(dto.getId()); -// -// res.getRules().forEach(rule -> { -// rule.setSelectorId(dto.getId()); -// client.create(rule); -// }); -// } -// -// spec.getWaiting().waitFor(gateway); -// } -// -// @ShenYuScenario(provider = BrpcPluginCases.class) -// void testBrpc(final GatewayClient gateway, final CaseSpec spec) { -// spec.getVerifiers().forEach(verifier -> verifier.verify(gateway.getHttpRequesterSupplier().get())); -// } -// -// @AfterEach -// void after(final AdminClient client, final GatewayClient gateway, final AfterEachSpec spec) { -// spec.getDeleter().delete(client, selectorIds); -// spec.deleteWaiting().waitFor(gateway); -// selectorIds = Lists.newArrayList(); -// } -// -// @AfterAll -// static void teardown(final AdminClient client) { -// client.deleteAllSelectors(); -// MultiValueMap formData = new LinkedMultiValueMap<>(); -// formData.add("id", "41"); -// formData.add("name", "brpc"); -// formData.add("enabled", "false"); -// formData.add("role", "Proxy"); -// formData.add("sort", "310"); -// client.changePluginStatus("41", formData); -// } -//} - diff --git a/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-brpc/src/test/resources/admin-application.yml b/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-brpc/src/test/resources/admin-application.yml deleted file mode 100755 index 146a1b43cd70..000000000000 --- a/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-brpc/src/test/resources/admin-application.yml +++ /dev/null @@ -1,123 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. - -server: - port: 9095 - address: 0.0.0.0 - -spring: - profiles: - active: h2 - thymeleaf: - cache: true - encoding: utf-8 - enabled: true - prefix: classpath:/static/ - suffix: .html - mvc: - pathmatch: - matching-strategy: ant_path_matcher - jackson: - time-zone: GMT+8 # GMT , Asia/Shanghai - messages: - basename: message/i18n - -management: - health: - mail: - enabled: off - endpoints: - web: - exposure: - include: - - 'health' - - 'prometheus' - enabled-by-default: true - -mybatis: - config-location: classpath:/mybatis/mybatis-config.xml - mapper-locations: classpath:/mappers/*.xml - -shenyu: - register: - registerType: http #http #zookeeper #etcd #nacos #consul - serverLists: #localhost:2181 #http://localhost:2379 #localhost:8848 - props: - sessionTimeout: 5000 - connectionTimeout: 2000 - checked: true - zombieCheckThreads: 10 - zombieCheckTimes: 5 - scheduledTime: 10 - nacosNameSpace: ShenyuRegisterCenter - sync: - websocket: - enabled: true - messageMaxSize: 10240 - allowOrigins: ws://localhost:9095;ws://localhost:9195; - ldap: - enabled: false - url: ldap://xxxx:xxx - bind-dn: cn=xxx,dc=xxx,dc=xxx - password: xxxx - base-dn: ou=xxx,dc=xxx,dc=xxx - object-class: person - login-field: cn - jwt: - expired-seconds: 86400000 - shiro: - white-list: - - / - - /favicon.* - - /static/** - - /index** - - /platform/login - - /websocket - - /error - - /actuator/health - - /actuator/health/** # /actuator/health/readiness /actuator/health/liveness - - /actuator/prometheus - - /swagger-ui.html - - /webjars/** - - /swagger-resources/** - - /v2/api-docs - - /csrf - - /alert/report - swagger: - enable: true - dashboard: - core: - onlySuperAdminPermission: - - system:manager:add - - system:manager:edit - - system:manager:delete - - system:role:add - - system:role:edit - - system:role:delete - - system:resource:addButton - - system:resource:addMenu - - system:resource:editButton - - system:resource:editMenu - - system:resource:deleteButton - - system:resource:deleteMenu - -logging: - level: - root: info - org.springframework.boot: info - org.apache.ibatis: info - org.apache.shenyu.bonuspoint: info - org.apache.shenyu.lottery: info - org.apache.shenyu: info diff --git a/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-brpc/src/test/resources/bootstrap-application.yml b/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-brpc/src/test/resources/bootstrap-application.yml deleted file mode 100644 index 350c2294e89e..000000000000 --- a/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-brpc/src/test/resources/bootstrap-application.yml +++ /dev/null @@ -1,335 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. - -server: - port: 9195 - address: 0.0.0.0 - compression: - enabled: true - minResponseSize: 1048576 # If the response data is greater than 1M, enable compression. - -spring: - main: - allow-bean-definition-overriding: true - application: - name: shenyu-bootstrap - codec: - max-in-memory-size: 2MB - cloud: - discovery: - enabled: false - nacos: - discovery: - server-addr: 127.0.0.1:8848 # Spring Cloud Alibaba Dubbo use this. - enabled: false - namespace: ShenyuRegisterCenter - -# if you want use ribbon please config every server. -#springCloud-test: -# ribbon: -# NIWSServerListClassName: com.netflix.niws.loadbalancer.DiscoveryEnabledNIWSServerList - -eureka: - client: - enabled: false - serviceUrl: - defaultZone: http://localhost:8761/eureka/ - instance: - prefer-ip-address: true - -# security: -# oauth2: -# client: -# registration: -# : -# client-id: -# client-secret: -# provider: -# : -# authorization-uri: -# token-uri: -# user-info-uri: -# jwk-set-uri: - -management: - health: - redis: - enabled: false - elasticsearch: - enabled: false - endpoint: - health: - enabled: true - show-details: always - endpoints: - web: - exposure: - include: "*" # or health,info - - -shenyu: - selectorMatchCache: - ## selector L1 cache - cache: - enabled: false - initialCapacity: 10000 # initial capacity in cache - maximumSize: 10000 # max size in cache - ## selector L2 cache, use trie as L2 cache - trie: - enabled: false - cacheSize: 128 # the number of plug-ins - matchMode: antPathMatch - ruleMatchCache: - ## rule L1 cache - cache: - enabled: true - initialCapacity: 10000 # initial capacity in cache - maximumSize: 65536 # max size in cache - ## rule L2 cache, use trie as L2 cache - trie: - enabled: false - cacheSize: 1024 # the number of selectors - matchMode: antPathMatch - netty: - http: - # set to false, user can custom the netty tcp server config. - webServerFactoryEnabled: true - selectCount: 1 - workerCount: 8 - accessLog: false - serverSocketChannel: - soRcvBuf: 87380 - soBackLog: 128 - soReuseAddr: false - connectTimeoutMillis: 10000 - writeBufferHighWaterMark: 65536 - writeBufferLowWaterMark: 32768 - writeSpinCount: 16 - autoRead: false - allocType: "pooled" - messageSizeEstimator: 8 - singleEventExecutorPerGroup: true - socketChannel: - soKeepAlive: false - soReuseAddr: false - soLinger: -1 - tcpNoDelay: true - soRcvBuf: 87380 - soSndBuf: 16384 - ipTos: 0 - allowHalfClosure: false - connectTimeoutMillis: 10000 - writeBufferHighWaterMark: 65536 - writeBufferLowWaterMark: 32768 - writeSpinCount: 16 - autoRead: false - allocType: "pooled" - messageSizeEstimator: 8 - singleEventExecutorPerGroup: true - sni: - enabled: false - mod: k8s #manul - defaultK8sSecretNamespace: shenyu-ingress - defaultK8sSecretName: default-cert - # mod: manual - # certificates: - # - domain: 'localhost' - # keyCertChainFile: '/Users/zhukunshuai/Desktop/cert/example.com+1.pem' - # keyFile: '/Users/zhukunshuai/Desktop/cert/example.com+1-key.pem' - # - domain: 'example.com' - # keyCertChainFile: '/Users/zhukunshuai/Desktop/cert/example.com+1.pem' - # keyFile: '/Users/zhukunshuai/Desktop/cert/example.com+1-key.pem' - # httpclient: - # strategy: netty # webClient - # connectTimeout: 45000 - # responseTimeout: 3000 - # readerIdleTime: 3000 - # writerIdleTime: 3000 - # allIdleTime: 3000 - # readTimeout: 3000 - # writeTimeout: 3000 - # wiretap: false - # keepAlive: false - # maxInMemorySize: 1 #1mb - # pool: - # type: ELASTIC - # name: proxy - # maxConnections: 16 - # acquireTimeout: 45000 - # maxIdleTime: 3000 - # proxy: - # host: - # port: - # username: - # password: - # nonProxyHostsPattern: - # ssl: - # useInsecureTrustManager: true - # keyStoreType: PKCS12 - # keyStorePath: classpath:keystore.p12 - # keyStorePassword: 123456 - # keyStoreProvider: - # keyPassword: 123456 - # trustedX509Certificates: - # handshakeTimeout: - # closeNotifyFlushTimeout: - # closeNotifyReadTimeout: - # defaultConfigurationType: - # threadPool: - # prefix: shenyu - # selectCount: 1 - # workerCount: 8 - # daemon: true - register: - enabled: false - registerType: zookeeper #etcd #consul - serverLists: localhost:2181 #http://localhost:2379 #localhost:8848 - props: - cross: - enabled: true - allowedHeaders: - allowedMethods: "*" - allowedAnyOrigin: true # the same of Access-Control-Allow-Origin: "*" - # allowedOrigin: - # format : schema://prefix spacer domain - # Access-Control-Allow-Origin: "http://a.apache.org,http://b.apache.org" - # spacer: "." - # domain: apache.org - # prefixes: - # - a # a.apache.org - # - b # b.apache.org - # origins: - # - c.apache.org - # - d.apache.org - # - http://e.apache.org - # originRegex: ^http(|s)://(.*\.|)abc.com$ - allowedExpose: "" - maxAge: "18000" - allowCredentials: true - - switchConfig: - local: true - collapseSlashes: false - file: - enabled: true - maxSize : 10 - sync: - websocket: - urls: ws://localhost:9095/websocket - allowOrigin: ws://localhost:9195 - # apollo: - # appId: shenyu - # meta: http://localhost:8080 - # env: dev - # clusterName: test - # namespace: application - # zookeeper: - # url: localhost:2181 - # sessionTimeout: 5000 - # connectionTimeout: 2000 - # http: - # url: http://localhost:9095 - # username: - # password: - # nacos: - # url: localhost:8848 - # namespace: 1c10d748-af86-43b9-8265-75f487d20c6c - # username: - # password: - # acm: - # enabled: false - # endpoint: acm.aliyun.com - # namespace: - # accessKey: - # secretKey: - # etcd: - # url: http://localhost:2379 - # consul: - # url: http://localhost:8500 - # waitTime: 1000 - # watchDelay: 1000 - exclude: - enabled: false - paths: - - /favicon.ico - fallback: - enabled: false - paths: - - /fallback/hystrix - - /fallback/resilience4j - - /fallback/sentinel - health: - enabled: true - paths: - - /actuator - - /health_check - alert: - enabled: true - admins: localhost:9095 - extPlugin: - path: - enabled: true - threads: 1 - scheduleTime: 300 - scheduleDelay: 30 - scheduler: - enabled: false - type: fixed - threads: 16 - upstreamCheck: - enabled: false - poolSize: 10 - timeout: 3000 - healthyThreshold: 1 - unhealthyThreshold: 1 - interval: 5000 - printEnabled: true - printInterval: 60000 - springCloudCache: - enabled: false - ribbon: - serverListRefreshInterval: 10000 - metrics: - enabled: false - name : prometheus - host: 127.0.0.1 - port: 8090 - jmxConfig: - props: - jvm_enabled: true - # plugins: - # rate-limiter.enabled: false - local: - enabled: false - sha512Key: "BA3253876AED6BC22D4A6FF53D8406C6AD864195ED144AB5C87621B6C233B548BAEAE6956DF346EC8C17F5EA10F35EE3CBC514797ED7DDD3145464E2A0BAB413" -# sharedPool: -# enable: true -# prefix: "shenyu-shared" -# corePoolSize: 200 -# maximumPoolSize: 2000 -# keepAliveTime: 60000 -# # 1GB -# maxWorkQueueMemory: 1073741824 -# # 256MB -# maxFreeMemory: 268435456 - -logging: - level: - root: info - org.springframework.boot: info - org.apache.ibatis: info - org.apache.shenyu.bonuspoint: info - org.apache.shenyu.lottery: info - org.apache.shenyu: info diff --git a/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-brpc/src/test/resources/docker-compose.mysql.yml b/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-brpc/src/test/resources/docker-compose.mysql.yml deleted file mode 100644 index e782e7c32464..000000000000 --- a/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-brpc/src/test/resources/docker-compose.mysql.yml +++ /dev/null @@ -1,144 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# - -version: '2.3' - -services: - zookeeper: - image: zookeeper:3.8.0 - restart: always - expose: - - 2181 - healthcheck: - test: ["CMD-SHELL", "echo srvr | nc localhost 2181"] - interval: 10s - timeout: 5s - retries: 3 - start_period: 40s - - nacos: - image: nacos/nacos-server:v2.2.3 - environment: - - TZ=Asia/Shanghai - - MODE=standalone - expose: - - 8848 - - 9848 - - 9849 - healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:8848/nacos/actuator/health"] - interval: 10s - timeout: 5s - retries: 3 - start_period: 30s - - etcd: - image: bitnami/etcd:3.5 - environment: - - TZ=Asia/Shanghai - - ALLOW_NONE_AUTHENTICATION=yes - - ETCD_ADVERTISE_CLIENT_URLS=http://etcd:2379 - expose: - - 2379 - - 2380 - healthcheck: - test: [ "CMD", "etcdctl", "endpoint", "health" ] - interval: 10s - timeout: 5s - retries: 3 - start_period: 30s - - admin: - image: shenyu/admin:latest - expose: - - 9095 - ports: - - "9095:9095" - depends_on: - zookeeper: - condition: service_healthy - nacos: - condition: service_healthy - mysql: - condition: service_healthy - etcd: - condition: service_healthy - volumes: - - ../../target/test-classes/admin-application.yml:/opt/shenyu-admin/conf/application.yml - - /tmp/shenyu-e2e/mysql/mysql-connector.jar:/opt/shenyu-admin/ext-lib/mysql-connector.jar - environment: - - SPRING_PROFILES_ACTIVE=mysql - - spring.datasource.username=shenyue2e - - spring.datasource.password=123456 - - spring.datasource.url=jdbc:mysql://mysql:3306/shenyu?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai&zeroDateTimeBehavior=convertToNull - healthcheck: - test: [ "CMD-SHELL", "wget -q -O - http://admin:9095/actuator/health | grep UP || exit 1" ] - timeout: 2s - retries: 3 - start_period: 10s - - brpc: - image: shenyu-examples-brpc-service:latest - restart: always - environment: - - shenyu.register.serverLists=http://admin:9095 - healthcheck: - test: ["CMD", "nc", "-z", "localhost", "8005"] - timeout: 2s - retries: 3 - start_period: 10s - expose: - - 55290 - - 8080 - ports: - - "8011:8011" - - "8005:8005" - depends_on: - admin: - condition: service_healthy - - gateway: - image: shenyu/bootstrap:latest - expose: - - 9195 - ports: - - "9195:9195" - depends_on: - brpc: - condition: service_healthy - volumes: - - ../../target/test-classes/bootstrap-application.yml:/opt/shenyu-bootstrap/conf/application.yml - healthcheck: - test: [ "CMD", "wget", "-q", "-O", "-", "http://gateway:9195/actuator/health" ] - timeout: 2s - retries: 3 - start_period: 5s - - mysql: - image: mysql:8 - environment: - - MYSQL_ROOT_PASSWORD=123123 - - MYSQL_USER=shenyue2e - - MYSQL_PASSWORD=123456 - healthcheck: - test: "/usr/bin/mysql --user=root --password=123123 --execute \"SHOW DATABASES;\"" - interval: 2s - timeout: 20s - retries: 10 - start_period: 60s - volumes: - - /tmp/shenyu-e2e/mysql/schema.sql:/docker-entrypoint-initdb.d/schema.sql \ No newline at end of file diff --git a/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-sofa/src/test/resources/admin-application.yml b/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-sofa/src/test/resources/admin-application.yml deleted file mode 100755 index 146a1b43cd70..000000000000 --- a/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-sofa/src/test/resources/admin-application.yml +++ /dev/null @@ -1,123 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. - -server: - port: 9095 - address: 0.0.0.0 - -spring: - profiles: - active: h2 - thymeleaf: - cache: true - encoding: utf-8 - enabled: true - prefix: classpath:/static/ - suffix: .html - mvc: - pathmatch: - matching-strategy: ant_path_matcher - jackson: - time-zone: GMT+8 # GMT , Asia/Shanghai - messages: - basename: message/i18n - -management: - health: - mail: - enabled: off - endpoints: - web: - exposure: - include: - - 'health' - - 'prometheus' - enabled-by-default: true - -mybatis: - config-location: classpath:/mybatis/mybatis-config.xml - mapper-locations: classpath:/mappers/*.xml - -shenyu: - register: - registerType: http #http #zookeeper #etcd #nacos #consul - serverLists: #localhost:2181 #http://localhost:2379 #localhost:8848 - props: - sessionTimeout: 5000 - connectionTimeout: 2000 - checked: true - zombieCheckThreads: 10 - zombieCheckTimes: 5 - scheduledTime: 10 - nacosNameSpace: ShenyuRegisterCenter - sync: - websocket: - enabled: true - messageMaxSize: 10240 - allowOrigins: ws://localhost:9095;ws://localhost:9195; - ldap: - enabled: false - url: ldap://xxxx:xxx - bind-dn: cn=xxx,dc=xxx,dc=xxx - password: xxxx - base-dn: ou=xxx,dc=xxx,dc=xxx - object-class: person - login-field: cn - jwt: - expired-seconds: 86400000 - shiro: - white-list: - - / - - /favicon.* - - /static/** - - /index** - - /platform/login - - /websocket - - /error - - /actuator/health - - /actuator/health/** # /actuator/health/readiness /actuator/health/liveness - - /actuator/prometheus - - /swagger-ui.html - - /webjars/** - - /swagger-resources/** - - /v2/api-docs - - /csrf - - /alert/report - swagger: - enable: true - dashboard: - core: - onlySuperAdminPermission: - - system:manager:add - - system:manager:edit - - system:manager:delete - - system:role:add - - system:role:edit - - system:role:delete - - system:resource:addButton - - system:resource:addMenu - - system:resource:editButton - - system:resource:editMenu - - system:resource:deleteButton - - system:resource:deleteMenu - -logging: - level: - root: info - org.springframework.boot: info - org.apache.ibatis: info - org.apache.shenyu.bonuspoint: info - org.apache.shenyu.lottery: info - org.apache.shenyu: info diff --git a/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-sofa/src/test/resources/bootstrap-application.yml b/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-sofa/src/test/resources/bootstrap-application.yml deleted file mode 100644 index 856280361681..000000000000 --- a/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-sofa/src/test/resources/bootstrap-application.yml +++ /dev/null @@ -1,335 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. - -server: - port: 9195 - address: 0.0.0.0 - compression: - enabled: true - minResponseSize: 1048576 # If the response data is greater than 1M, enable compression. - -spring: - main: - allow-bean-definition-overriding: true - application: - name: shenyu-bootstrap - codec: - max-in-memory-size: 2MB - cloud: - discovery: - enabled: false - nacos: - discovery: - server-addr: 127.0.0.1:8848 # Spring Cloud Alibaba Dubbo use this. - enabled: false - namespace: ShenyuRegisterCenter - -# if you want use ribbon please config every server. -#springCloud-test: -# ribbon: -# NIWSServerListClassName: com.netflix.niws.loadbalancer.DiscoveryEnabledNIWSServerList - -eureka: - client: - enabled: false - serviceUrl: - defaultZone: http://localhost:8761/eureka/ - instance: - prefer-ip-address: true - -# security: -# oauth2: -# client: -# registration: -# : -# client-id: -# client-secret: -# provider: -# : -# authorization-uri: -# token-uri: -# user-info-uri: -# jwk-set-uri: - -management: - health: - redis: - enabled: false - elasticsearch: - enabled: false - endpoint: - health: - enabled: true - show-details: always - endpoints: - web: - exposure: - include: "*" # or health,info - - -shenyu: - selectorMatchCache: - ## selector L1 cache - cache: - enabled: false - initialCapacity: 10000 # initial capacity in cache - maximumSize: 10000 # max size in cache - ## selector L2 cache, use trie as L2 cache - trie: - enabled: false - cacheSize: 128 # the number of plug-ins - matchMode: antPathMatch - ruleMatchCache: - ## rule L1 cache - cache: - enabled: true - initialCapacity: 10000 # initial capacity in cache - maximumSize: 65536 # max size in cache - ## rule L2 cache, use trie as L2 cache - trie: - enabled: false - cacheSize: 1024 # the number of selectors - matchMode: antPathMatch - netty: - http: - # set to false, user can custom the netty tcp server config. - webServerFactoryEnabled: true - selectCount: 1 - workerCount: 8 - accessLog: false - serverSocketChannel: - soRcvBuf: 87380 - soBackLog: 128 - soReuseAddr: false - connectTimeoutMillis: 10000 - writeBufferHighWaterMark: 65536 - writeBufferLowWaterMark: 32768 - writeSpinCount: 16 - autoRead: false - allocType: "pooled" - messageSizeEstimator: 8 - singleEventExecutorPerGroup: true - socketChannel: - soKeepAlive: false - soReuseAddr: false - soLinger: -1 - tcpNoDelay: true - soRcvBuf: 87380 - soSndBuf: 16384 - ipTos: 0 - allowHalfClosure: false - connectTimeoutMillis: 10000 - writeBufferHighWaterMark: 65536 - writeBufferLowWaterMark: 32768 - writeSpinCount: 16 - autoRead: false - allocType: "pooled" - messageSizeEstimator: 8 - singleEventExecutorPerGroup: true - sni: - enabled: false - mod: k8s #manul - defaultK8sSecretNamespace: shenyu-ingress - defaultK8sSecretName: default-cert - # mod: manual - # certificates: - # - domain: 'localhost' - # keyCertChainFile: '/Users/zhukunshuai/Desktop/cert/example.com+1.pem' - # keyFile: '/Users/zhukunshuai/Desktop/cert/example.com+1-key.pem' - # - domain: 'example.com' - # keyCertChainFile: '/Users/zhukunshuai/Desktop/cert/example.com+1.pem' - # keyFile: '/Users/zhukunshuai/Desktop/cert/example.com+1-key.pem' - # httpclient: - # strategy: netty # webClient - # connectTimeout: 45000 - # responseTimeout: 3000 - # readerIdleTime: 3000 - # writerIdleTime: 3000 - # allIdleTime: 3000 - # readTimeout: 3000 - # writeTimeout: 3000 - # wiretap: false - # keepAlive: false - # maxInMemorySize: 1 #1mb - # pool: - # type: ELASTIC - # name: proxy - # maxConnections: 16 - # acquireTimeout: 45000 - # maxIdleTime: 3000 - # proxy: - # host: - # port: - # username: - # password: - # nonProxyHostsPattern: - # ssl: - # useInsecureTrustManager: true - # keyStoreType: PKCS12 - # keyStorePath: classpath:keystore.p12 - # keyStorePassword: 123456 - # keyStoreProvider: - # keyPassword: 123456 - # trustedX509Certificates: - # handshakeTimeout: - # closeNotifyFlushTimeout: - # closeNotifyReadTimeout: - # defaultConfigurationType: - # threadPool: - # prefix: shenyu - # selectCount: 1 - # workerCount: 8 - # daemon: true - register: - enabled: false - registerType: zookeeper #etcd #consul - serverLists: localhost:2181 #http://localhost:2379 #localhost:8848 - props: - cross: - enabled: true - allowedHeaders: - allowedMethods: "*" - allowedAnyOrigin: true # the same of Access-Control-Allow-Origin: "*" - # allowedOrigin: - # format : schema://prefix spacer domain - # Access-Control-Allow-Origin: "http://a.apache.org,http://b.apache.org" - # spacer: "." - # domain: apache.org - # prefixes: - # - a # a.apache.org - # - b # b.apache.org - # origins: - # - c.apache.org - # - d.apache.org - # - http://e.apache.org - # originRegex: ^http(|s)://(.*\.|)abc.com$ - allowedExpose: "" - maxAge: "18000" - allowCredentials: true - - switchConfig: - local: true - collapseSlashes: false - file: - enabled: true - maxSize : 10 - sync: - websocket: - urls: ws://localhost:9095/websocket - allowOrigin: ws://localhost:9195 - # apollo: - # appId: shenyu - # meta: http://localhost:8080 - # env: dev - # clusterName: test - # namespace: application - # zookeeper: - # url: localhost:2181 - # sessionTimeout: 5000 - # connectionTimeout: 2000 - # http: - # url: http://localhost:9095 - # username: - # password: - # nacos: - # url: localhost:8848 - # namespace: 1c10d748-af86-43b9-8265-75f487d20c6c - # username: - # password: - # acm: - # enabled: false - # endpoint: acm.aliyun.com - # namespace: - # accessKey: - # secretKey: - # etcd: - # url: http://localhost:2379 - # consul: - # url: http://localhost:8500 - # waitTime: 1000 - # watchDelay: 1000 - exclude: - enabled: false - paths: - - /favicon.ico - fallback: - enabled: false - paths: - - /fallback/hystrix - - /fallback/resilience4j - - /fallback/sentinel - health: - enabled: true - paths: - - /actuator - - /health_check - alert: - enabled: true - admins: localhost:9095 - extPlugin: - path: - enabled: true - threads: 1 - scheduleTime: 300 - scheduleDelay: 30 - scheduler: - enabled: false - type: fixed - threads: 16 - upstreamCheck: - enabled: false - poolSize: 10 - timeout: 3000 - healthyThreshold: 1 - unhealthyThreshold: 1 - interval: 5000 - printEnabled: true - printInterval: 60000 - springCloudCache: - enabled: false - ribbon: - serverListRefreshInterval: 10000 - metrics: - enabled: false - name : prometheus - host: 127.0.0.1 - port: 8090 - jmxConfig: - props: - jvm_enabled: true - # plugins: - # rate-limiter.enabled: false - local: - enabled: false - sha512Key: "BA3253876AED6BC22D4A6FF53D8406C6AD864195ED144AB5C87621B6C233B548BAEAE6956DF346EC8C17F5EA10F35EE3CBC514797ED7DDD3145464E2A0BAB413" -# sharedPool: -# enable: true -# prefix: "shenyu-shared" -# corePoolSize: 200 -# maximumPoolSize: 2000 -# keepAliveTime: 60000 -# # 1GB -# maxWorkQueueMemory: 1073741824 -# # 256MB -# maxFreeMemory: 268435456 - -logging: - level: - root: info - org.springframework.boot: info - org.apache.ibatis: info - org.apache.shenyu.bonuspoint: info - org.apache.shenyu.lottery: info - org.apache.shenyu: info diff --git a/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-sofa/src/test/resources/docker-compose.mysql.yml b/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-sofa/src/test/resources/docker-compose.mysql.yml deleted file mode 100644 index 051991ef9f0d..000000000000 --- a/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-sofa/src/test/resources/docker-compose.mysql.yml +++ /dev/null @@ -1,127 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You 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. -# - -version: '2.3' - -services: - zookeeper: - image: zookeeper:3.8.0 - restart: always - expose: - - 2181 - healthcheck: - test: ["CMD-SHELL", "echo srvr | nc localhost 2181"] - interval: 10s - timeout: 5s - retries: 3 - start_period: 40s - - nacos: - image: nacos/nacos-server:v2.2.3 - environment: - - TZ=Asia/Shanghai - - MODE=standalone - expose: - - 8848 - - 9848 - - 9849 - healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:8848/nacos/actuator/health"] - interval: 10s - timeout: 5s - retries: 3 - start_period: 30s - - admin: - image: shenyu/admin:latest - expose: - - 9095 - ports: - - "9095:9095" - depends_on: - zookeeper: - condition: service_healthy - nacos: - condition: service_healthy - mysql: - condition: service_healthy - volumes: - - ../../target/test-classes/admin-application.yml:/opt/shenyu-admin/conf/application.yml - - /tmp/shenyu-e2e/mysql/mysql-connector.jar:/opt/shenyu-admin/ext-lib/mysql-connector.jar - environment: - - SPRING_PROFILES_ACTIVE=mysql - - spring.datasource.username=shenyue2e - - spring.datasource.password=123456 - - spring.datasource.url=jdbc:mysql://mysql:3306/shenyu?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai&zeroDateTimeBehavior=convertToNull - healthcheck: - test: [ "CMD-SHELL", "wget -q -O - http://admin:9095/actuator/health | grep UP || exit 1" ] - timeout: 2s - retries: 3 - start_period: 10s - - sofa: - image: shenyu-examples-sofa:latest - restart: always - environment: - - shenyu.register.serverLists=http://admin:9095 - - com.alipay.sofa.rpc.registry-address=zookeeper://zookeeper:2181 - healthcheck: - test: ["CMD", "nc", "-z", "localhost", "28011"] - timeout: 2s - retries: 3 - start_period: 10s - expose: - - 28011 - - 8888 - ports: - - "28011:28011" - - "8888:8888" - depends_on: - admin: - condition: service_healthy - - gateway: - image: shenyu/bootstrap:latest - expose: - - 9195 - ports: - - "9195:9195" - depends_on: - sofa: - condition: service_healthy - volumes: - - ../../target/test-classes/bootstrap-application.yml:/opt/shenyu-bootstrap/conf/application.yml - healthcheck: - test: [ "CMD", "wget", "-q", "-O", "-", "http://gateway:9195/actuator/health" ] - timeout: 2s - retries: 3 - start_period: 5s - - mysql: - image: mysql:8 - environment: - - MYSQL_ROOT_PASSWORD=123123 - - MYSQL_USER=shenyue2e - - MYSQL_PASSWORD=123456 - healthcheck: - test: "/usr/bin/mysql --user=root --password=123123 --execute \"SHOW DATABASES;\"" - interval: 2s - timeout: 20s - retries: 10 - start_period: 60s - volumes: - - /tmp/shenyu-e2e/mysql/schema.sql:/docker-entrypoint-initdb.d/schema.sql diff --git a/shenyu-e2e/shenyu-e2e-engine/src/main/java/org/apache/shenyu/e2e/engine/annotation/ShenYuTest1.java b/shenyu-e2e/shenyu-e2e-engine/src/main/java/org/apache/shenyu/e2e/engine/annotation/ShenYuTest1.java deleted file mode 100644 index 9b6ce22332ad..000000000000 --- a/shenyu-e2e/shenyu-e2e-engine/src/main/java/org/apache/shenyu/e2e/engine/annotation/ShenYuTest1.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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.apache.shenyu.e2e.engine.annotation; - -//import org.apache.shenyu.e2e.engine.ShenYuExtension; -//import org.apache.shenyu.e2e.engine.ShenYuLogExtension; -//import org.apache.shenyu.e2e.engine.config.ShenYuEngineConfigure.Mode; -//import org.apache.shenyu.e2e.engine.config.ShenYuEngineConfigure.ServiceType; -//import org.junit.jupiter.api.TestInstance; -//import org.junit.jupiter.api.TestInstance.Lifecycle; -//import org.junit.jupiter.api.extension.ExtendWith; -// -//import java.lang.annotation.ElementType; -//import java.lang.annotation.Retention; -//import java.lang.annotation.RetentionPolicy; -//import java.lang.annotation.Target; -// -//@Target(ElementType.TYPE) -//@Retention(RetentionPolicy.RUNTIME) -//@ExtendWith({ShenYuExtension.class, ShenYuLogExtension.class}) -//@TestInstance(Lifecycle.PER_CLASS) -//public @interface ShenYuTest { -// -// /** -// *

-// * Indices whether the depended on services run under ShenYu e2e engine managed. -// *

-// *

-// * Mode.DOCKER: under ShenYu e2e engine managed. -// *

-// *

-// * Mode.HOST: ShenYu e2e engine unmanaged the services. -// *

-// * -// * {@code Mode} -// * @return Mode -// */ -// @ShenYuValue("{shenyu.e2e.mode}") -// Mode mode() default Mode.DOCKER; -// -// /** -// * services configs. -// * @return ServiceConfigure[] -// */ -// ServiceConfigure[] services() default {}; -// -// /** -// * share key. -// * @return String -// */ -// String sharedKey() default "global"; -// -// /** -// * docker compose file. -// * @return String -// */ -// @ShenYuValue("{shenyu.e2e.docker-compose}") -// String dockerComposeFile() default "docker-compose.yml"; -// -// @Target(ElementType.TYPE) -// @Retention(RetentionPolicy.RUNTIME) -// @interface ServiceConfigure { -// -// /** -// * Indices the service's name. -// * @return String service name. -// */ -// @ShenYuValue("{shenyu.e2e.services[].serviceName}") -// String serviceName(); -// -// /** -// *

-// * Indices the HTTP schema to access to service. -// *

-// * That is available for {@link Mode#DOCKER} -// * @return String schema -// */ -// @ShenYuValue("{shenyu.e2e.services[].schema}") -// String schema() default "http"; -// -// /** -// *

-// * Indices the port of service. -// *

-// * That is available for {@link Mode#DOCKER} -// * TODO to support multi ports for service -// * @return int port -// */ -// @ShenYuValue("{shenyu.e2e.services[].port}") -// int port() default -1; -// -// /** -// *

-// * Indices the baseUrl of service. -// *

-// * That is available for {@link Mode#HOST} -// * @return String base url -// */ -// @ShenYuValue("{shenyu.e2e.services[].baseUrl}") -// String baseUrl() default ""; -// -// /** -// *

-// * Indices the service type of service. -// *

-// * {@code ServiceType} -// * @return ServiceType -// */ -// @ShenYuValue("{shenyu.e2e.services[].type}") -// ServiceType type() default ServiceType.SHENYU_ADMIN; -// -// /** -// * Indices more configures about connection. -// * @return Parameter[] -// */ -// Parameter[] parameters() default {}; -// } -// -// @Target(ElementType.TYPE) -// @Retention(RetentionPolicy.RUNTIME) -// @interface Parameter { -// -// String key(); -// -// String value(); -// } -// -//} diff --git a/shenyu-e2e/shenyu-e2e-engine/src/main/java/org/apache/shenyu/e2e/engine/config/ShenYuEngineConfigure1.java b/shenyu-e2e/shenyu-e2e-engine/src/main/java/org/apache/shenyu/e2e/engine/config/ShenYuEngineConfigure1.java deleted file mode 100644 index 0c816097ef4e..000000000000 --- a/shenyu-e2e/shenyu-e2e-engine/src/main/java/org/apache/shenyu/e2e/engine/config/ShenYuEngineConfigure1.java +++ /dev/null @@ -1,460 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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.apache.shenyu.e2e.engine.config; - -//import com.fasterxml.jackson.annotation.JsonValue; -//import com.fasterxml.jackson.databind.ObjectMapper; -//import com.google.common.base.Preconditions; -//import com.google.common.base.Strings; -//import org.apache.shenyu.e2e.engine.annotation.ShenYuTest; -//import org.apache.shenyu.e2e.engine.annotation.ShenYuTest.Parameter; -//import org.apache.shenyu.e2e.engine.annotation.ShenYuTest.ServiceConfigure; -//import org.apache.shenyu.e2e.engine.annotation.ShenYuValue; -//import org.apache.shenyu.e2e.engine.config.ShenYuEngineConfigure.DockerConfigure.DockerServiceConfigure; -//import org.apache.shenyu.e2e.engine.config.ShenYuEngineConfigure.HostConfigure.HostServiceConfigure; -// -//import java.lang.reflect.Proxy; -//import java.util.ArrayList; -//import java.util.Arrays; -//import java.util.List; -//import java.util.Properties; -//import java.util.regex.Matcher; -//import java.util.regex.Pattern; -// -///** -// * ShenYu engine configure. -// */ -//public class ShenYuEngineConfigure { -// -// private static final Pattern EXTRACTOR_PATTERN = Pattern.compile("\\{(.*?)\\}"); -// -// private static final ObjectMapper MAPPER = new ObjectMapper(); -// -// private Mode mode; -// -// private HostConfigure hostConfigure; -// -// private DockerConfigure dockerConfigure; -// -// /** -// * is run on host mode. -// * @return boolean -// */ -// public boolean isRunOnHost() { -// return Mode.HOST == mode; -// } -// -// /** -// * is run on docker mode. -// * @return boolean -// */ -// public boolean isRunOnDocker() { -// return Mode.DOCKER == mode; -// } -// -// /** -// * get mode. -// * -// * @return mode -// */ -// public Mode getMode() { -// return mode; -// } -// -// /** -// * get hostConfigure. -// * -// * @return hostConfigure -// */ -// public HostConfigure getHostConfigure() { -// return hostConfigure; -// } -// -// /** -// * get dockerConfigure. -// * -// * @return dockerConfigure -// */ -// public DockerConfigure getDockerConfigure() { -// return dockerConfigure; -// } -// -// /** -// * get engine configure from annotation. -// * @param annotation annotation -// * @return ShenYuEngineConfigure -// */ -// public static ShenYuEngineConfigure fromAnnotation(final ShenYuTest annotation) { -// final ShenYuTest annotationProxy = newShenYuTestProxy(annotation); -// -// ServiceConfigure[] services = annotationProxy.services(); -// ServiceConfigure[] serviceProxies = new ServiceConfigure[services.length]; -// for (int i = 0; i < services.length; i++) { -// serviceProxies[i] = newServiceConfigureProxy(i, services[i]); -// } -// -// ShenYuEngineConfigure configure = new ShenYuEngineConfigure(); -// configure.mode = annotationProxy.mode(); -// if (Mode.DOCKER == annotationProxy.mode()) { -// configure.dockerConfigure = parseDockerServiceConfigures( -// annotationProxy.dockerComposeFile(), -// serviceProxies -// ); -// } else { -// configure.hostConfigure = parseHostServiceConfigures(serviceProxies); -// } -// return configure; -// } -// -// private static HostConfigure parseHostServiceConfigures(final ServiceConfigure[] serviceConfigures) { -// HostServiceConfigure admin = null; -// HostServiceConfigure gateway = null; -// List services = new ArrayList<>(); -// for (ServiceConfigure configure : serviceConfigures) { -// switch (configure.type()) { -// case SHENYU_ADMIN: -// admin = parseHostServiceConfigure(configure); -// break; -// case SHENYU_GATEWAY: -// gateway = parseHostServiceConfigure(configure); -// break; -// default: -// services.add(parseHostServiceConfigure(configure)); -// } -// } -// return new HostConfigure(admin, gateway, services); -// } -// -// private static HostServiceConfigure parseHostServiceConfigure(final ServiceConfigure configure) { -// Preconditions.checkNotNull(configure.serviceName(), "serviceName is non-nullable"); -// Preconditions.checkNotNull(configure.baseUrl(), "baseUrl is non-nullable in docker-compose mode"); -// -// return new HostServiceConfigure(configure.serviceName(), configure.baseUrl(), toProperties(configure.parameters())); -// } -// -// private static DockerConfigure parseDockerServiceConfigures(final String dockerComposeFile, final ServiceConfigure[] serviceConfigures) { -// Preconditions.checkNotNull(Strings.emptyToNull(dockerComposeFile), "dockerComposeFile is required in docker-compose mode"); -// -// DockerServiceConfigure admin = null; -// DockerServiceConfigure gateway = null; -// List services = new ArrayList<>(); -// for (ServiceConfigure configure : serviceConfigures) { -// switch (configure.type()) { -// case SHENYU_ADMIN: -// admin = parseDockerServiceConfigure(configure); -// break; -// case SHENYU_GATEWAY: -// gateway = parseDockerServiceConfigure(configure); -// break; -// default: -// services.add(parseDockerServiceConfigure(configure)); -// } -// } -// return new DockerConfigure(dockerComposeFile, admin, gateway, services); -// } -// -// private static DockerServiceConfigure parseDockerServiceConfigure(final ServiceConfigure configure) { -// Preconditions.checkNotNull(configure.serviceName(), "serviceName is non-nullable"); -// -// return new DockerServiceConfigure(configure.schema(), configure.serviceName(), configure.port(), toProperties(configure.parameters())); -// } -// -// private static Properties toProperties(final Parameter[] parameters) { -// Properties properties = new Properties(); -// Arrays.stream(parameters).forEach(p -> properties.put(p.key(), p.value())); -// return properties; -// } -// -// private static ShenYuTest newShenYuTestProxy(final ShenYuTest shenYuTest) { -// return (ShenYuTest) Proxy.newProxyInstance( -// ShenYuTest.class.getClassLoader(), -// new Class[]{ShenYuTest.class}, -// (proxy, method, args) -> { -// if (method.isAnnotationPresent(ShenYuValue.class)) { -// ShenYuValue annotation = method.getAnnotation(ShenYuValue.class); -// -// String propertyKey = annotation.value(); -// propertyKey = propertyKey.substring(1, propertyKey.length() - 1); -// String property = System.getProperty(propertyKey); -// if (!Strings.isNullOrEmpty(property)) { -// return MAPPER.readValue("\"" + property + "\"", method.getReturnType()); -// } -// } -// return normal(method.invoke(shenYuTest), method.getReturnType()); -// }); -// } -// -// private static ServiceConfigure newServiceConfigureProxy(final int index, final ServiceConfigure serviceConfigure) { -// return (ServiceConfigure) Proxy.newProxyInstance( -// ServiceConfigure.class.getClassLoader(), -// new Class[]{ServiceConfigure.class}, -// (proxy, method, args) -> { -// if (method.isAnnotationPresent(ShenYuValue.class)) { -// ShenYuValue annotation = method.getAnnotation(ShenYuValue.class); -// -// String rawKey = annotation.value(); -// String propertyKey = rawKey.replace("[]", "[" + index + "]") -// .substring(1, rawKey.length() - 1); -// -// String property = System.getProperty(propertyKey); -// if (!Strings.isNullOrEmpty(property)) { -// return MAPPER.readValue("\"" + property + "\"", method.getReturnType()); -// } -// } -// return normal(method.invoke(serviceConfigure), method.getReturnType()); -// }); -// } -// -// private static Object normal(final Object obj, final Class returnType) { -// if (String.class == returnType) { -// String result = obj.toString(); -// -// Matcher matcher = EXTRACTOR_PATTERN.matcher(result); -// while (matcher.find()) { -// String pattern = matcher.group(1); -// String key = pattern; -// String val = "null"; -// -// if (pattern.contains(":")) { -// String[] kv = pattern.split(":"); -// key = kv[0]; -// val = kv[1]; -// } -// -// result = result.replace(matcher.group(0), System.getProperty(key, val)); -// } -// return result; -// } -// return obj; -// } -// -// public enum Mode { -// -// HOST, DOCKER; -// -// /** -// * value. -// * @return String -// */ -// @JsonValue -// public String value() { -// return name(); -// } -// } -// -// public enum ServiceType { -// -// SHENYU_ADMIN, -// -// SHENYU_GATEWAY, -// -// EXTERNAL_SERVICE, -// } -// -// public static class HostConfigure { -// -// private final HostServiceConfigure admin; -// -// private final HostServiceConfigure gateway; -// -// private final List externalServices; -// -// public HostConfigure(final HostServiceConfigure admin, final HostServiceConfigure gateway, final List externalServices) { -// this.admin = admin; -// this.gateway = gateway; -// this.externalServices = externalServices; -// } -// -// /** -// * get admin. -// * -// * @return admin -// */ -// public HostServiceConfigure getAdmin() { -// return admin; -// } -// -// /** -// * get gateway. -// * -// * @return gateway -// */ -// public HostServiceConfigure getGateway() { -// return gateway; -// } -// -// /** -// * get externalServices. -// * -// * @return externalServices -// */ -// public List getExternalServices() { -// return externalServices; -// } -// -// public static class HostServiceConfigure { -// -// private final String serviceName; -// -// private final String baseUrl; -// -// private final Properties properties; -// -// public HostServiceConfigure(final String serviceName, final String baseUrl, final Properties properties) { -// this.serviceName = serviceName; -// this.baseUrl = baseUrl; -// this.properties = properties; -// } -// -// /** -// * get serviceName. -// * -// * @return serviceName -// */ -// public String getServiceName() { -// return serviceName; -// } -// -// /** -// * get baseUrl. -// * -// * @return baseUrl -// */ -// public String getBaseUrl() { -// return baseUrl; -// } -// -// /** -// * get properties. -// * -// * @return properties -// */ -// public Properties getProperties() { -// return properties; -// } -// } -// } -// -// public static class DockerConfigure { -// -// private final String dockerComposeFile; -// -// private final DockerServiceConfigure admin; -// -// private final DockerServiceConfigure gateway; -// -// private final List externalServices; -// -// public DockerConfigure(final String dockerComposeFile, final DockerServiceConfigure admin, final DockerServiceConfigure gateway, final List externalServices) { -// this.dockerComposeFile = dockerComposeFile; -// this.admin = admin; -// this.gateway = gateway; -// this.externalServices = externalServices; -// } -// -// /** -// * get dockerComposeFile. -// * -// * @return dockerComposeFile -// */ -// public String getDockerComposeFile() { -// return dockerComposeFile; -// } -// -// /** -// * get admin. -// * -// * @return admin -// */ -// public DockerServiceConfigure getAdmin() { -// return admin; -// } -// -// /** -// * get gateway. -// * -// * @return gateway -// */ -// public DockerServiceConfigure getGateway() { -// return gateway; -// } -// -// /** -// * get externalServices. -// * -// * @return List -// */ -// public List getExternalServices() { -// return externalServices; -// } -// -// public static class DockerServiceConfigure { -// -// private final String schema; -// -// private final String serviceName; -// -// private final int port; -// -// private final Properties properties; -// -// public DockerServiceConfigure(final String schema, final String serviceName, final int port, final Properties properties) { -// this.schema = schema; -// this.serviceName = serviceName; -// this.port = port; -// this.properties = properties; -// } -// -// /** -// * get schema. -// * -// * @return schema -// */ -// public String getSchema() { -// return schema; -// } -// -// /** -// * get serviceName. -// * -// * @return serviceName -// */ -// public String getServiceName() { -// return serviceName; -// } -// -// /** -// * get port. -// * -// * @return port -// */ -// public int getPort() { -// return port; -// } -// -// /** -// * get properties. -// * -// * @return properties -// */ -// public Properties getProperties() { -// return properties; -// } -// } -// } -//}