You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by GitBox <gi...@apache.org> on 2022/06/17 09:33:55 UTC

[GitHub] [incubator-shenyu] dragon-zhang opened a new pull request, #3575: [ISSUE #3521] task6 add integration test for shared thread pool

dragon-zhang opened a new pull request, #3575:
URL: https://github.com/apache/incubator-shenyu/pull/3575

   Fixes #3521 
   
   <!--
   Thank you for proposing a pull request. This template will guide you through the essential steps necessary for a pull request.
   -->
   Make sure that:
   
   - [x] You have read the [contribution guidelines](https://shenyu.apache.org/community/contributor-guide).
   - [x] You submit test cases (unit or integration tests) that back your changes.
   - [x] Your local test passed `./mvnw clean install -Dmaven.javadoc.skip=true`.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-shenyu] dragon-zhang commented on a diff in pull request #3575: [ISSUE #3521] task6 add integration test for shared thread pool

Posted by GitBox <gi...@apache.org>.
dragon-zhang commented on code in PR #3575:
URL: https://github.com/apache/incubator-shenyu/pull/3575#discussion_r900964986


##########
shenyu-integrated-test/shenyu-integrated-test-combination/src/test/java/org/apache/shenyu/integrated/test/combination/SharedThreadPoolTest.java:
##########
@@ -0,0 +1,126 @@
+/*
+ * 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.integrated.test.combination;
+
+import com.google.gson.JsonArray;
+import com.google.gson.JsonObject;
+import com.google.gson.reflect.TypeToken;
+import org.apache.shenyu.common.enums.PluginEnum;
+import org.apache.shenyu.common.utils.GsonUtils;
+import org.apache.shenyu.integrated.test.combination.dto.SofaTestData;
+import org.apache.shenyu.integratedtest.common.AbstractPluginDataInit;
+import org.apache.shenyu.integratedtest.common.dto.DubboTest;
+import org.apache.shenyu.integratedtest.common.dto.MotanDTO;
+import org.apache.shenyu.integratedtest.common.helper.HttpHelper;
+import org.hamcrest.Matchers;
+import org.hamcrest.core.Is;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.lang.reflect.Type;
+import java.util.Map;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+/**
+ * The integrated test for combination plugins about shared thread pool.
+ */
+public class SharedThreadPoolTest extends AbstractPluginDataInit {
+    
+    private static final Logger LOG = LoggerFactory.getLogger(SharedThreadPoolTest.class);
+    
+    @BeforeAll
+    public static void setup() throws IOException {
+        // for apache dubbo
+        String pluginResult = initPlugin(PluginEnum.DUBBO.getName(), "{\"register\":\"zookeeper://shenyu-zk:2181\",\"threadpool\": \"shared\"}");
+        assertThat(pluginResult, is("success"));
+        // for grpc
+        pluginResult = initPlugin(PluginEnum.GRPC.getName(), "{\"register\":\"zookeeper://shenyu-zk:2181\",\"threadpool\": \"shared\"}");
+        assertThat(pluginResult, is("success"));
+        // for motan
+        pluginResult = initPlugin(PluginEnum.MOTAN.getName(), "{\"register\":\"shenyu-zk:2181\",\"threadpool\": \"shared\"}");
+        assertThat(pluginResult, is("success"));
+        // for sofa
+        pluginResult = initPlugin(PluginEnum.SOFA.getName(), "{\"protocol\":\"zookeeper\",\"register\":\"shenyu-zk:2181\",\"threadpool\": \"shared\"}");
+        assertThat(pluginResult, Matchers.is("success"));
+    }
+    
+    @Test
+    public void testApacheDubbo() throws IOException {
+        DubboTest dubboTest = HttpHelper.INSTANCE.getFromGateway("/dubbo/findById?id=1", DubboTest.class);
+        assertEquals("hello world shenyu Apache, findById", dubboTest.getName());
+        assertEquals("1", dubboTest.getId());
+    }
+    
+    @Test
+    public void testGrpc() throws Exception {
+        JsonArray jsonArray = new JsonArray();
+        JsonObject child = new JsonObject();
+        child.addProperty("message", "hello rpc");
+        jsonArray.add(child);
+        JsonObject request = new JsonObject();
+        request.add("data", jsonArray);
+        JsonArray response = HttpHelper.INSTANCE.postGateway("/grpc/echo", request, JsonArray.class);
+        Map<String, Object> result = GsonUtils.getInstance().toObjectMap(response.get(0).toString(), Object.class);
+        assertEquals("ReceivedHELLO", result.get("message"));
+    }
+    
+    @Test
+    public void testMotan() throws Exception {
+        MotanDTO request = new MotanDTO("shenyu");
+        Type returnType = new TypeToken<String>() {
+        }.getType();
+        String response = HttpHelper.INSTANCE.postGateway("/motan/demo/hello", request, returnType);
+        assertEquals("hello shenyu", response);
+    }
+    
+    @Test
+    public void testSofa() {
+        try {
+            SofaTestData response = HttpHelper.INSTANCE.getFromGateway("/sofa/findById?id=1001", new TypeToken<SofaTestData>() {
+            }.getType());
+            assertThat(response.getName(), Is.is("hello world shenyu Sofa, findById"));
+            assertThat(response.getId(), Is.is("1001"));
+        } catch (Throwable e) {
+            LOG.error("testSofa failed !", e);
+        }
+    }
+    
+    @AfterAll
+    public static void testIsOneThreadPool() throws IOException {
+        String spring = HttpHelper.INSTANCE.getFromGateway("/shenyu/getFromSpring", String.class);
+        String dubbo = HttpHelper.INSTANCE.getFromGateway("/shenyu/getFromDubbo", String.class);
+        assertEquals(spring, dubbo);
+        String grpc = HttpHelper.INSTANCE.getFromGateway("/shenyu/getFromGrpc", String.class);
+        assertEquals(spring, grpc);
+        String motan = HttpHelper.INSTANCE.getFromGateway("/shenyu/getFromMotan", String.class);
+        assertEquals(spring, motan);
+        try {
+            String sofa = HttpHelper.INSTANCE.getFromGateway("/shenyu/getFromSofa", String.class);
+            assertEquals(spring, sofa);
+        } catch (Throwable e) {

Review Comment:
   sure



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-shenyu] yu199195 merged pull request #3575: [ISSUE #3521] task6 add integration test for shared thread pool

Posted by GitBox <gi...@apache.org>.
yu199195 merged PR #3575:
URL: https://github.com/apache/incubator-shenyu/pull/3575


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-shenyu] JooKS-me commented on a diff in pull request #3575: [ISSUE #3521] task6 add integration test for shared thread pool

Posted by GitBox <gi...@apache.org>.
JooKS-me commented on code in PR #3575:
URL: https://github.com/apache/incubator-shenyu/pull/3575#discussion_r900933853


##########
shenyu-integrated-test/shenyu-integrated-test-combination/src/test/java/org/apache/shenyu/integrated/test/combination/SharedThreadPoolTest.java:
##########
@@ -0,0 +1,126 @@
+/*
+ * 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.integrated.test.combination;
+
+import com.google.gson.JsonArray;
+import com.google.gson.JsonObject;
+import com.google.gson.reflect.TypeToken;
+import org.apache.shenyu.common.enums.PluginEnum;
+import org.apache.shenyu.common.utils.GsonUtils;
+import org.apache.shenyu.integrated.test.combination.dto.SofaTestData;
+import org.apache.shenyu.integratedtest.common.AbstractPluginDataInit;
+import org.apache.shenyu.integratedtest.common.dto.DubboTest;
+import org.apache.shenyu.integratedtest.common.dto.MotanDTO;
+import org.apache.shenyu.integratedtest.common.helper.HttpHelper;
+import org.hamcrest.Matchers;
+import org.hamcrest.core.Is;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.lang.reflect.Type;
+import java.util.Map;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+/**
+ * The integrated test for combination plugins about shared thread pool.
+ */
+public class SharedThreadPoolTest extends AbstractPluginDataInit {
+    
+    private static final Logger LOG = LoggerFactory.getLogger(SharedThreadPoolTest.class);
+    
+    @BeforeAll
+    public static void setup() throws IOException {
+        // for apache dubbo
+        String pluginResult = initPlugin(PluginEnum.DUBBO.getName(), "{\"register\":\"zookeeper://shenyu-zk:2181\",\"threadpool\": \"shared\"}");
+        assertThat(pluginResult, is("success"));
+        // for grpc
+        pluginResult = initPlugin(PluginEnum.GRPC.getName(), "{\"register\":\"zookeeper://shenyu-zk:2181\",\"threadpool\": \"shared\"}");
+        assertThat(pluginResult, is("success"));
+        // for motan
+        pluginResult = initPlugin(PluginEnum.MOTAN.getName(), "{\"register\":\"shenyu-zk:2181\",\"threadpool\": \"shared\"}");
+        assertThat(pluginResult, is("success"));
+        // for sofa
+        pluginResult = initPlugin(PluginEnum.SOFA.getName(), "{\"protocol\":\"zookeeper\",\"register\":\"shenyu-zk:2181\",\"threadpool\": \"shared\"}");
+        assertThat(pluginResult, Matchers.is("success"));
+    }
+    
+    @Test
+    public void testApacheDubbo() throws IOException {
+        DubboTest dubboTest = HttpHelper.INSTANCE.getFromGateway("/dubbo/findById?id=1", DubboTest.class);
+        assertEquals("hello world shenyu Apache, findById", dubboTest.getName());
+        assertEquals("1", dubboTest.getId());
+    }
+    
+    @Test
+    public void testGrpc() throws Exception {
+        JsonArray jsonArray = new JsonArray();
+        JsonObject child = new JsonObject();
+        child.addProperty("message", "hello rpc");
+        jsonArray.add(child);
+        JsonObject request = new JsonObject();
+        request.add("data", jsonArray);
+        JsonArray response = HttpHelper.INSTANCE.postGateway("/grpc/echo", request, JsonArray.class);
+        Map<String, Object> result = GsonUtils.getInstance().toObjectMap(response.get(0).toString(), Object.class);
+        assertEquals("ReceivedHELLO", result.get("message"));
+    }
+    
+    @Test
+    public void testMotan() throws Exception {
+        MotanDTO request = new MotanDTO("shenyu");
+        Type returnType = new TypeToken<String>() {
+        }.getType();
+        String response = HttpHelper.INSTANCE.postGateway("/motan/demo/hello", request, returnType);
+        assertEquals("hello shenyu", response);
+    }
+    
+    @Test
+    public void testSofa() {
+        try {
+            SofaTestData response = HttpHelper.INSTANCE.getFromGateway("/sofa/findById?id=1001", new TypeToken<SofaTestData>() {
+            }.getType());
+            assertThat(response.getName(), Is.is("hello world shenyu Sofa, findById"));
+            assertThat(response.getId(), Is.is("1001"));
+        } catch (Throwable e) {
+            LOG.error("testSofa failed !", e);
+        }
+    }
+    
+    @AfterAll
+    public static void testIsOneThreadPool() throws IOException {
+        String spring = HttpHelper.INSTANCE.getFromGateway("/shenyu/getFromSpring", String.class);
+        String dubbo = HttpHelper.INSTANCE.getFromGateway("/shenyu/getFromDubbo", String.class);
+        assertEquals(spring, dubbo);
+        String grpc = HttpHelper.INSTANCE.getFromGateway("/shenyu/getFromGrpc", String.class);
+        assertEquals(spring, grpc);
+        String motan = HttpHelper.INSTANCE.getFromGateway("/shenyu/getFromMotan", String.class);
+        assertEquals(spring, motan);
+        try {
+            String sofa = HttpHelper.INSTANCE.getFromGateway("/shenyu/getFromSofa", String.class);
+            assertEquals(spring, sofa);
+        } catch (Throwable e) {

Review Comment:
   There is no problem in other places, that is, the catch is used here, and I see that the sofa test in the log will make an error. I suggest to solve the problem of the plug-in first and then merge the pr.



##########
shenyu-integrated-test/shenyu-integrated-test-combination/src/test/java/org/apache/shenyu/integrated/test/combination/SharedThreadPoolTest.java:
##########
@@ -0,0 +1,126 @@
+/*
+ * 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.integrated.test.combination;
+
+import com.google.gson.JsonArray;
+import com.google.gson.JsonObject;
+import com.google.gson.reflect.TypeToken;
+import org.apache.shenyu.common.enums.PluginEnum;
+import org.apache.shenyu.common.utils.GsonUtils;
+import org.apache.shenyu.integrated.test.combination.dto.SofaTestData;
+import org.apache.shenyu.integratedtest.common.AbstractPluginDataInit;
+import org.apache.shenyu.integratedtest.common.dto.DubboTest;
+import org.apache.shenyu.integratedtest.common.dto.MotanDTO;
+import org.apache.shenyu.integratedtest.common.helper.HttpHelper;
+import org.hamcrest.Matchers;
+import org.hamcrest.core.Is;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.lang.reflect.Type;
+import java.util.Map;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+/**
+ * The integrated test for combination plugins about shared thread pool.
+ */
+public class SharedThreadPoolTest extends AbstractPluginDataInit {
+    
+    private static final Logger LOG = LoggerFactory.getLogger(SharedThreadPoolTest.class);
+    
+    @BeforeAll
+    public static void setup() throws IOException {
+        // for apache dubbo
+        String pluginResult = initPlugin(PluginEnum.DUBBO.getName(), "{\"register\":\"zookeeper://shenyu-zk:2181\",\"threadpool\": \"shared\"}");
+        assertThat(pluginResult, is("success"));
+        // for grpc
+        pluginResult = initPlugin(PluginEnum.GRPC.getName(), "{\"register\":\"zookeeper://shenyu-zk:2181\",\"threadpool\": \"shared\"}");
+        assertThat(pluginResult, is("success"));
+        // for motan
+        pluginResult = initPlugin(PluginEnum.MOTAN.getName(), "{\"register\":\"shenyu-zk:2181\",\"threadpool\": \"shared\"}");
+        assertThat(pluginResult, is("success"));
+        // for sofa
+        pluginResult = initPlugin(PluginEnum.SOFA.getName(), "{\"protocol\":\"zookeeper\",\"register\":\"shenyu-zk:2181\",\"threadpool\": \"shared\"}");
+        assertThat(pluginResult, Matchers.is("success"));
+    }
+    
+    @Test
+    public void testApacheDubbo() throws IOException {
+        DubboTest dubboTest = HttpHelper.INSTANCE.getFromGateway("/dubbo/findById?id=1", DubboTest.class);
+        assertEquals("hello world shenyu Apache, findById", dubboTest.getName());
+        assertEquals("1", dubboTest.getId());
+    }
+    
+    @Test
+    public void testGrpc() throws Exception {
+        JsonArray jsonArray = new JsonArray();
+        JsonObject child = new JsonObject();
+        child.addProperty("message", "hello rpc");
+        jsonArray.add(child);
+        JsonObject request = new JsonObject();
+        request.add("data", jsonArray);
+        JsonArray response = HttpHelper.INSTANCE.postGateway("/grpc/echo", request, JsonArray.class);
+        Map<String, Object> result = GsonUtils.getInstance().toObjectMap(response.get(0).toString(), Object.class);
+        assertEquals("ReceivedHELLO", result.get("message"));
+    }
+    
+    @Test
+    public void testMotan() throws Exception {
+        MotanDTO request = new MotanDTO("shenyu");
+        Type returnType = new TypeToken<String>() {
+        }.getType();
+        String response = HttpHelper.INSTANCE.postGateway("/motan/demo/hello", request, returnType);
+        assertEquals("hello shenyu", response);
+    }
+    
+    @Test
+    public void testSofa() {
+        try {
+            SofaTestData response = HttpHelper.INSTANCE.getFromGateway("/sofa/findById?id=1001", new TypeToken<SofaTestData>() {

Review Comment:
   There is no problem in other places, that is, the catch is used here, and I see that the sofa test in the log will make an error. I suggest to solve the problem of the plug-in first and then merge the pr.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-shenyu] dragon-zhang commented on a diff in pull request #3575: [ISSUE #3521] task6 add integration test for shared thread pool

Posted by GitBox <gi...@apache.org>.
dragon-zhang commented on code in PR #3575:
URL: https://github.com/apache/incubator-shenyu/pull/3575#discussion_r901037468


##########
shenyu-integrated-test/shenyu-integrated-test-combination/src/test/java/org/apache/shenyu/integrated/test/combination/SharedThreadPoolTest.java:
##########
@@ -0,0 +1,126 @@
+/*
+ * 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.integrated.test.combination;
+
+import com.google.gson.JsonArray;
+import com.google.gson.JsonObject;
+import com.google.gson.reflect.TypeToken;
+import org.apache.shenyu.common.enums.PluginEnum;
+import org.apache.shenyu.common.utils.GsonUtils;
+import org.apache.shenyu.integrated.test.combination.dto.SofaTestData;
+import org.apache.shenyu.integratedtest.common.AbstractPluginDataInit;
+import org.apache.shenyu.integratedtest.common.dto.DubboTest;
+import org.apache.shenyu.integratedtest.common.dto.MotanDTO;
+import org.apache.shenyu.integratedtest.common.helper.HttpHelper;
+import org.hamcrest.Matchers;
+import org.hamcrest.core.Is;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.lang.reflect.Type;
+import java.util.Map;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+/**
+ * The integrated test for combination plugins about shared thread pool.
+ */
+public class SharedThreadPoolTest extends AbstractPluginDataInit {
+    
+    private static final Logger LOG = LoggerFactory.getLogger(SharedThreadPoolTest.class);
+    
+    @BeforeAll
+    public static void setup() throws IOException {
+        // for apache dubbo
+        String pluginResult = initPlugin(PluginEnum.DUBBO.getName(), "{\"register\":\"zookeeper://shenyu-zk:2181\",\"threadpool\": \"shared\"}");
+        assertThat(pluginResult, is("success"));
+        // for grpc
+        pluginResult = initPlugin(PluginEnum.GRPC.getName(), "{\"register\":\"zookeeper://shenyu-zk:2181\",\"threadpool\": \"shared\"}");
+        assertThat(pluginResult, is("success"));
+        // for motan
+        pluginResult = initPlugin(PluginEnum.MOTAN.getName(), "{\"register\":\"shenyu-zk:2181\",\"threadpool\": \"shared\"}");
+        assertThat(pluginResult, is("success"));
+        // for sofa
+        pluginResult = initPlugin(PluginEnum.SOFA.getName(), "{\"protocol\":\"zookeeper\",\"register\":\"shenyu-zk:2181\",\"threadpool\": \"shared\"}");
+        assertThat(pluginResult, Matchers.is("success"));
+    }
+    
+    @Test
+    public void testApacheDubbo() throws IOException {
+        DubboTest dubboTest = HttpHelper.INSTANCE.getFromGateway("/dubbo/findById?id=1", DubboTest.class);
+        assertEquals("hello world shenyu Apache, findById", dubboTest.getName());
+        assertEquals("1", dubboTest.getId());
+    }
+    
+    @Test
+    public void testGrpc() throws Exception {
+        JsonArray jsonArray = new JsonArray();
+        JsonObject child = new JsonObject();
+        child.addProperty("message", "hello rpc");
+        jsonArray.add(child);
+        JsonObject request = new JsonObject();
+        request.add("data", jsonArray);
+        JsonArray response = HttpHelper.INSTANCE.postGateway("/grpc/echo", request, JsonArray.class);
+        Map<String, Object> result = GsonUtils.getInstance().toObjectMap(response.get(0).toString(), Object.class);
+        assertEquals("ReceivedHELLO", result.get("message"));
+    }
+    
+    @Test
+    public void testMotan() throws Exception {
+        MotanDTO request = new MotanDTO("shenyu");
+        Type returnType = new TypeToken<String>() {
+        }.getType();
+        String response = HttpHelper.INSTANCE.postGateway("/motan/demo/hello", request, returnType);
+        assertEquals("hello shenyu", response);
+    }
+    
+    @Test
+    public void testSofa() {
+        try {
+            SofaTestData response = HttpHelper.INSTANCE.getFromGateway("/sofa/findById?id=1001", new TypeToken<SofaTestData>() {

Review Comment:
   em...I tried at best, exclude dependencies, upgrade sofa version, all not work. How about remove `sofa test part` from `SharedThreadPoolTest`? I think `#testApacheDubbo`, `#testGrpc`, `#testMotan` and `#testIsOneThreadPool` has proved enugth.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-shenyu] JooKS-me commented on a diff in pull request #3575: [ISSUE #3521] task6 add integration test for shared thread pool

Posted by GitBox <gi...@apache.org>.
JooKS-me commented on code in PR #3575:
URL: https://github.com/apache/incubator-shenyu/pull/3575#discussion_r901107962


##########
shenyu-integrated-test/shenyu-integrated-test-combination/src/test/java/org/apache/shenyu/integrated/test/combination/SharedThreadPoolTest.java:
##########
@@ -0,0 +1,126 @@
+/*
+ * 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.integrated.test.combination;
+
+import com.google.gson.JsonArray;
+import com.google.gson.JsonObject;
+import com.google.gson.reflect.TypeToken;
+import org.apache.shenyu.common.enums.PluginEnum;
+import org.apache.shenyu.common.utils.GsonUtils;
+import org.apache.shenyu.integrated.test.combination.dto.SofaTestData;
+import org.apache.shenyu.integratedtest.common.AbstractPluginDataInit;
+import org.apache.shenyu.integratedtest.common.dto.DubboTest;
+import org.apache.shenyu.integratedtest.common.dto.MotanDTO;
+import org.apache.shenyu.integratedtest.common.helper.HttpHelper;
+import org.hamcrest.Matchers;
+import org.hamcrest.core.Is;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.lang.reflect.Type;
+import java.util.Map;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+/**
+ * The integrated test for combination plugins about shared thread pool.
+ */
+public class SharedThreadPoolTest extends AbstractPluginDataInit {
+    
+    private static final Logger LOG = LoggerFactory.getLogger(SharedThreadPoolTest.class);
+    
+    @BeforeAll
+    public static void setup() throws IOException {
+        // for apache dubbo
+        String pluginResult = initPlugin(PluginEnum.DUBBO.getName(), "{\"register\":\"zookeeper://shenyu-zk:2181\",\"threadpool\": \"shared\"}");
+        assertThat(pluginResult, is("success"));
+        // for grpc
+        pluginResult = initPlugin(PluginEnum.GRPC.getName(), "{\"register\":\"zookeeper://shenyu-zk:2181\",\"threadpool\": \"shared\"}");
+        assertThat(pluginResult, is("success"));
+        // for motan
+        pluginResult = initPlugin(PluginEnum.MOTAN.getName(), "{\"register\":\"shenyu-zk:2181\",\"threadpool\": \"shared\"}");
+        assertThat(pluginResult, is("success"));
+        // for sofa
+        pluginResult = initPlugin(PluginEnum.SOFA.getName(), "{\"protocol\":\"zookeeper\",\"register\":\"shenyu-zk:2181\",\"threadpool\": \"shared\"}");
+        assertThat(pluginResult, Matchers.is("success"));
+    }
+    
+    @Test
+    public void testApacheDubbo() throws IOException {
+        DubboTest dubboTest = HttpHelper.INSTANCE.getFromGateway("/dubbo/findById?id=1", DubboTest.class);
+        assertEquals("hello world shenyu Apache, findById", dubboTest.getName());
+        assertEquals("1", dubboTest.getId());
+    }
+    
+    @Test
+    public void testGrpc() throws Exception {
+        JsonArray jsonArray = new JsonArray();
+        JsonObject child = new JsonObject();
+        child.addProperty("message", "hello rpc");
+        jsonArray.add(child);
+        JsonObject request = new JsonObject();
+        request.add("data", jsonArray);
+        JsonArray response = HttpHelper.INSTANCE.postGateway("/grpc/echo", request, JsonArray.class);
+        Map<String, Object> result = GsonUtils.getInstance().toObjectMap(response.get(0).toString(), Object.class);
+        assertEquals("ReceivedHELLO", result.get("message"));
+    }
+    
+    @Test
+    public void testMotan() throws Exception {
+        MotanDTO request = new MotanDTO("shenyu");
+        Type returnType = new TypeToken<String>() {
+        }.getType();
+        String response = HttpHelper.INSTANCE.postGateway("/motan/demo/hello", request, returnType);
+        assertEquals("hello shenyu", response);
+    }
+    
+    @Test
+    public void testSofa() {
+        try {
+            SofaTestData response = HttpHelper.INSTANCE.getFromGateway("/sofa/findById?id=1001", new TypeToken<SofaTestData>() {

Review Comment:
   Maybe, we can add a TODO comment here.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-shenyu] codecov-commenter commented on pull request #3575: [ISSUE #3521] task6 add integration test for shared thread pool

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #3575:
URL: https://github.com/apache/incubator-shenyu/pull/3575#issuecomment-1158709106

   # [Codecov](https://codecov.io/gh/apache/incubator-shenyu/pull/3575?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#3575](https://codecov.io/gh/apache/incubator-shenyu/pull/3575?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (2e0eb87) into [master](https://codecov.io/gh/apache/incubator-shenyu/commit/bc67e69e8ec8aec67b0e8fdf9e21c5a6243116eb?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (bc67e69) will **decrease** coverage by `0.34%`.
   > The diff coverage is `50.00%`.
   
   > :exclamation: Current head 2e0eb87 differs from pull request most recent head 53f7120. Consider uploading reports for the commit 53f7120 to get more accurate results
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #3575      +/-   ##
   ============================================
   - Coverage     62.51%   62.16%   -0.35%     
   + Complexity     5562     5536      -26     
   ============================================
     Files           848      848              
     Lines         23465    23468       +3     
     Branches       2132     2132              
   ============================================
   - Hits          14669    14589      -80     
   - Misses         7441     7522      +81     
   - Partials       1355     1357       +2     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-shenyu/pull/3575?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...e/shenyu/plugin/grpc/client/GrpcClientBuilder.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3575/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LXBsdWdpbi9zaGVueXUtcGx1Z2luLWdycGMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoZW55dS9wbHVnaW4vZ3JwYy9jbGllbnQvR3JwY0NsaWVudEJ1aWxkZXIuamF2YQ==) | `66.66% <ø> (ø)` | |
   | [...e/shenyu/plugin/motan/proxy/MotanProxyService.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3575/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LXBsdWdpbi9zaGVueXUtcGx1Z2luLW1vdGFuL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvcGx1Z2luL21vdGFuL3Byb3h5L01vdGFuUHJveHlTZXJ2aWNlLmphdmE=) | `1.85% <0.00%> (-0.04%)` | :arrow_down: |
   | [...enyu/plugin/sofa/cache/ApplicationConfigCache.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3575/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LXBsdWdpbi9zaGVueXUtcGx1Z2luLXNvZmEvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoZW55dS9wbHVnaW4vc29mYS9jYWNoZS9BcHBsaWNhdGlvbkNvbmZpZ0NhY2hlLmphdmE=) | `25.45% <0.00%> (-0.24%)` | :arrow_down: |
   | [...starter/plugin/motan/MotanPluginConfiguration.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3575/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LXNwcmluZy1ib290LXN0YXJ0ZXIvc2hlbnl1LXNwcmluZy1ib290LXN0YXJ0ZXItcGx1Z2luL3NoZW55dS1zcHJpbmctYm9vdC1zdGFydGVyLXBsdWdpbi1tb3Rhbi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hlbnl1L3NwcmluZ2Jvb3Qvc3RhcnRlci9wbHVnaW4vbW90YW4vTW90YW5QbHVnaW5Db25maWd1cmF0aW9uLmphdmE=) | `100.00% <100.00%> (ø)` | |
   | [...plugin/logging/rocketmq/LoggingRocketMQPlugin.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3575/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LXBsdWdpbi9zaGVueXUtcGx1Z2luLWxvZ2dpbmcvc2hlbnl1LXBsdWdpbi1sb2dnaW5nLXJvY2tldG1xL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvcGx1Z2luL2xvZ2dpbmcvcm9ja2V0bXEvTG9nZ2luZ1JvY2tldE1RUGx1Z2luLmphdmE=) | `22.72% <0.00%> (-72.73%)` | :arrow_down: |
   | [...ogging/rocketmq/body/LoggingServerHttpRequest.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3575/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LXBsdWdpbi9zaGVueXUtcGx1Z2luLWxvZ2dpbmcvc2hlbnl1LXBsdWdpbi1sb2dnaW5nLXJvY2tldG1xL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvcGx1Z2luL2xvZ2dpbmcvcm9ja2V0bXEvYm9keS9Mb2dnaW5nU2VydmVySHR0cFJlcXVlc3QuamF2YQ==) | `0.00% <0.00%> (-20.00%)` | :arrow_down: |
   | [...he/shenyu/common/timer/HierarchicalWheelTimer.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3575/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LWNvbW1vbi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hlbnl1L2NvbW1vbi90aW1lci9IaWVyYXJjaGljYWxXaGVlbFRpbWVyLmphdmE=) | `68.00% <0.00%> (-18.00%)` | :arrow_down: |
   | [...va/org/apache/shenyu/common/timer/TimingWheel.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3575/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LWNvbW1vbi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hlbnl1L2NvbW1vbi90aW1lci9UaW1pbmdXaGVlbC5qYXZh) | `73.80% <0.00%> (-16.67%)` | :arrow_down: |
   | [...henyu/plugin/grpc/resolver/ShenyuNameResolver.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3575/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LXBsdWdpbi9zaGVueXUtcGx1Z2luLWdycGMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoZW55dS9wbHVnaW4vZ3JwYy9yZXNvbHZlci9TaGVueXVOYW1lUmVzb2x2ZXIuamF2YQ==) | `51.06% <0.00%> (-11.71%)` | :arrow_down: |
   | [...henyu/admin/service/impl/UpstreamCheckService.java](https://codecov.io/gh/apache/incubator-shenyu/pull/3575/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hlbnl1LWFkbWluL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGVueXUvYWRtaW4vc2VydmljZS9pbXBsL1Vwc3RyZWFtQ2hlY2tTZXJ2aWNlLmphdmE=) | `56.94% <0.00%> (-9.73%)` | :arrow_down: |
   | ... and [6 more](https://codecov.io/gh/apache/incubator-shenyu/pull/3575/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-shenyu/pull/3575?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-shenyu/pull/3575?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [bc67e69...53f7120](https://codecov.io/gh/apache/incubator-shenyu/pull/3575?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shenyu.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org