From eca0a5b7e74dd3cc506e869eb7d6043f71408b8f Mon Sep 17 00:00:00 2001 From: kongming Date: Mon, 8 Oct 2018 17:52:13 +0800 Subject: [PATCH 1/5] remove serviceclassHolder --- .../com/alibaba/dubbo/common/Constants.java | 2 + .../alibaba/dubbo/config/ServiceConfig.java | 28 +++--------- .../alibaba/dubbo/rpc/ServiceClassHolder.java | 45 ------------------- .../dubbo/rpc/protocol/rest/RestProtocol.java | 5 +-- .../rpc/protocol/rest/RestProtocolTest.java | 23 ++++------ .../rpc/protol/rest/RestProtocolTest.java | 6 ++- .../dubbo/examples/rest/rest-consumer.xml | 6 ++- 7 files changed, 25 insertions(+), 90 deletions(-) delete mode 100644 dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/ServiceClassHolder.java diff --git a/dubbo-common/src/main/java/com/alibaba/dubbo/common/Constants.java b/dubbo-common/src/main/java/com/alibaba/dubbo/common/Constants.java index 404fe8f6b51..02d70ea809b 100644 --- a/dubbo-common/src/main/java/com/alibaba/dubbo/common/Constants.java +++ b/dubbo-common/src/main/java/com/alibaba/dubbo/common/Constants.java @@ -635,6 +635,8 @@ public class Constants { public static final String MULTICAST = "multicast"; + public static final String SERVICE_IMPL_CLASS = "service.classimpl"; + /* * private Constants(){ } */ diff --git a/dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/ServiceConfig.java b/dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/ServiceConfig.java index ec6dcd982c8..b04dbdbedd3 100644 --- a/dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/ServiceConfig.java +++ b/dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/ServiceConfig.java @@ -30,37 +30,19 @@ import com.alibaba.dubbo.config.model.ApplicationModel; import com.alibaba.dubbo.config.model.ProviderModel; import com.alibaba.dubbo.config.support.Parameter; -import com.alibaba.dubbo.rpc.Exporter; -import com.alibaba.dubbo.rpc.Invoker; -import com.alibaba.dubbo.rpc.Protocol; -import com.alibaba.dubbo.rpc.ProxyFactory; -import com.alibaba.dubbo.rpc.ServiceClassHolder; +import com.alibaba.dubbo.rpc.*; import com.alibaba.dubbo.rpc.cluster.ConfiguratorFactory; import com.alibaba.dubbo.rpc.service.GenericService; import com.alibaba.dubbo.rpc.support.ProtocolUtils; import java.lang.reflect.Method; -import java.net.InetAddress; -import java.net.InetSocketAddress; -import java.net.Socket; -import java.net.SocketAddress; -import java.net.UnknownHostException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.UUID; +import java.net.*; +import java.util.*; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; -import static com.alibaba.dubbo.common.utils.NetUtils.LOCALHOST; -import static com.alibaba.dubbo.common.utils.NetUtils.getAvailablePort; -import static com.alibaba.dubbo.common.utils.NetUtils.getLocalHost; -import static com.alibaba.dubbo.common.utils.NetUtils.isInvalidLocalHost; -import static com.alibaba.dubbo.common.utils.NetUtils.isInvalidPort; +import static com.alibaba.dubbo.common.utils.NetUtils.*; /** * ServiceConfig @@ -532,7 +514,7 @@ private void exportLocal(URL url) { .setProtocol(Constants.LOCAL_PROTOCOL) .setHost(LOCALHOST) .setPort(0); - ServiceClassHolder.getInstance().pushServiceClass(getServiceClass(ref)); + StaticContext.getContext(Constants.SERVICE_IMPL_CLASS).put(url.getServiceKey(), getServiceClass(ref)); Exporter exporter = protocol.export( proxyFactory.getInvoker(ref, (Class) interfaceClass, local)); exporters.add(exporter); diff --git a/dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/ServiceClassHolder.java b/dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/ServiceClassHolder.java deleted file mode 100644 index b480e14be37..00000000000 --- a/dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/ServiceClassHolder.java +++ /dev/null @@ -1,45 +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 com.alibaba.dubbo.rpc; - -/** - * TODO this is just a workaround for rest protocol, and now we just ensure it works in the most common dubbo usages - * - */ -public class ServiceClassHolder { - - private static final ServiceClassHolder INSTANCE = new ServiceClassHolder(); - - private final ThreadLocal holder = new ThreadLocal(); - - public static ServiceClassHolder getInstance() { - return INSTANCE; - } - - private ServiceClassHolder() { - } - - public Class popServiceClass() { - Class clazz = holder.get(); - holder.remove(); - return clazz; - } - - public void pushServiceClass(Class clazz) { - holder.set(clazz); - } -} diff --git a/dubbo-rpc/dubbo-rpc-rest/src/main/java/com/alibaba/dubbo/rpc/protocol/rest/RestProtocol.java b/dubbo-rpc/dubbo-rpc-rest/src/main/java/com/alibaba/dubbo/rpc/protocol/rest/RestProtocol.java index 319b5818d95..889fc2eebdf 100644 --- a/dubbo-rpc/dubbo-rpc-rest/src/main/java/com/alibaba/dubbo/rpc/protocol/rest/RestProtocol.java +++ b/dubbo-rpc/dubbo-rpc-rest/src/main/java/com/alibaba/dubbo/rpc/protocol/rest/RestProtocol.java @@ -23,9 +23,8 @@ import com.alibaba.dubbo.remoting.http.servlet.BootstrapListener; import com.alibaba.dubbo.remoting.http.servlet.ServletManager; import com.alibaba.dubbo.rpc.RpcException; -import com.alibaba.dubbo.rpc.ServiceClassHolder; +import com.alibaba.dubbo.rpc.StaticContext; import com.alibaba.dubbo.rpc.protocol.AbstractProxyProtocol; - import org.apache.http.HeaderElement; import org.apache.http.HeaderElementIterator; import org.apache.http.HttpResponse; @@ -83,7 +82,7 @@ public int getDefaultPort() { @Override protected Runnable doExport(T impl, Class type, URL url) throws RpcException { String addr = getAddr(url); - Class implClass = ServiceClassHolder.getInstance().popServiceClass(); + Class implClass = (Class) StaticContext.getContext(Constants.SERVICE_IMPL_CLASS).get(url.getServiceKey()); RestServer server = servers.get(addr); if (server == null) { server = serverFactory.createServer(url.getParameter(Constants.SERVER_KEY, "jetty")); diff --git a/dubbo-rpc/dubbo-rpc-rest/src/test/java/com/alibaba/dubbo/rpc/protocol/rest/RestProtocolTest.java b/dubbo-rpc/dubbo-rpc-rest/src/test/java/com/alibaba/dubbo/rpc/protocol/rest/RestProtocolTest.java index 089af0a2277..29424c8345c 100644 --- a/dubbo-rpc/dubbo-rpc-rest/src/test/java/com/alibaba/dubbo/rpc/protocol/rest/RestProtocolTest.java +++ b/dubbo-rpc/dubbo-rpc-rest/src/test/java/com/alibaba/dubbo/rpc/protocol/rest/RestProtocolTest.java @@ -20,14 +20,7 @@ import com.alibaba.dubbo.common.URL; import com.alibaba.dubbo.common.extension.ExtensionLoader; import com.alibaba.dubbo.common.utils.NetUtils; -import com.alibaba.dubbo.rpc.Exporter; -import com.alibaba.dubbo.rpc.Protocol; -import com.alibaba.dubbo.rpc.ProxyFactory; -import com.alibaba.dubbo.rpc.Result; -import com.alibaba.dubbo.rpc.RpcContext; -import com.alibaba.dubbo.rpc.RpcException; -import com.alibaba.dubbo.rpc.RpcInvocation; -import com.alibaba.dubbo.rpc.ServiceClassHolder; +import com.alibaba.dubbo.rpc.*; import org.hamcrest.CoreMatchers; import org.junit.After; import org.junit.Test; @@ -48,7 +41,7 @@ public void tearDown() { @Test public void testExport() { - ServiceClassHolder.getInstance().pushServiceClass(DemoService.class); + StaticContext.getContext(Constants.SERVICE_IMPL_CLASS).put(exportUrl.getServiceKey(), DemoService.class); RpcContext.getContext().setAttachment("timeout", "200"); @@ -64,7 +57,7 @@ public void testExport() { @Test public void testNettyServer() { - ServiceClassHolder.getInstance().pushServiceClass(DemoService.class); + StaticContext.getContext(Constants.SERVICE_IMPL_CLASS).put(exportUrl.getServiceKey(), DemoService.class); URL nettyUrl = exportUrl.addParameter(Constants.SERVER_KEY, "netty"); Exporter exporter = protocol.export(proxy.getInvoker(new DemoService(), IDemoService.class, nettyUrl)); @@ -79,7 +72,7 @@ public void testNettyServer() { @Test(expected = RpcException.class) public void testServletWithoutWebConfig() { - ServiceClassHolder.getInstance().pushServiceClass(DemoService.class); + StaticContext.getContext(Constants.SERVICE_IMPL_CLASS).put(exportUrl.getServiceKey(), DemoService.class); URL servletUrl = exportUrl.addParameter(Constants.SERVER_KEY, "servlet"); @@ -88,7 +81,7 @@ public void testServletWithoutWebConfig() { @Test(expected = RpcException.class) public void testErrorHandler() { - ServiceClassHolder.getInstance().pushServiceClass(DemoService.class); + StaticContext.getContext(Constants.SERVICE_IMPL_CLASS).put(exportUrl.getServiceKey(), DemoService.class); URL nettyUrl = exportUrl.addParameter(Constants.SERVER_KEY, "netty"); Exporter exporter = protocol.export(proxy.getInvoker(new DemoService(), IDemoService.class, nettyUrl)); @@ -100,7 +93,7 @@ public void testErrorHandler() { @Test public void testInvoke() { - ServiceClassHolder.getInstance().pushServiceClass(DemoService.class); + StaticContext.getContext(Constants.SERVICE_IMPL_CLASS).put(exportUrl.getServiceKey(), DemoService.class); Exporter exporter = protocol.export(proxy.getInvoker(new DemoService(), IDemoService.class, exportUrl)); @@ -113,7 +106,7 @@ public void testInvoke() { @Test public void testFilter() { - ServiceClassHolder.getInstance().pushServiceClass(DemoService.class); + StaticContext.getContext(Constants.SERVICE_IMPL_CLASS).put(exportUrl.getServiceKey(), DemoService.class); URL nettyUrl = exportUrl.addParameter(Constants.SERVER_KEY, "netty") .addParameter(Constants.EXTENSION_KEY, "com.alibaba.dubbo.rpc.protocol.rest.support.LoggingFilter"); @@ -130,7 +123,7 @@ public void testFilter() { @Test(expected = RuntimeException.class) public void testRegFail() { - ServiceClassHolder.getInstance().pushServiceClass(DemoService.class); + StaticContext.getContext(Constants.SERVICE_IMPL_CLASS).put(exportUrl.getServiceKey(), DemoService.class); URL nettyUrl = exportUrl.addParameter(Constants.EXTENSION_KEY, "com.not.existing.Filter"); protocol.export(proxy.getInvoker(new DemoService(), IDemoService.class, nettyUrl)); diff --git a/dubbo-rpc/dubbo-rpc-rest/src/test/java/com/alibaba/dubbo/rpc/protol/rest/RestProtocolTest.java b/dubbo-rpc/dubbo-rpc-rest/src/test/java/com/alibaba/dubbo/rpc/protol/rest/RestProtocolTest.java index 4764cf6b66f..ecb365095be 100644 --- a/dubbo-rpc/dubbo-rpc-rest/src/test/java/com/alibaba/dubbo/rpc/protol/rest/RestProtocolTest.java +++ b/dubbo-rpc/dubbo-rpc-rest/src/test/java/com/alibaba/dubbo/rpc/protol/rest/RestProtocolTest.java @@ -16,6 +16,7 @@ */ package com.alibaba.dubbo.rpc.protol.rest; +import com.alibaba.dubbo.common.Constants; import com.alibaba.dubbo.common.URL; import com.alibaba.dubbo.common.extension.ExtensionLoader; import com.alibaba.dubbo.rpc.*; @@ -32,10 +33,11 @@ public class RestProtocolTest { @Test public void testRestProtocol() { - ServiceClassHolder.getInstance().pushServiceClass(RestServiceImpl.class); + URL url = URL.valueOf("rest://127.0.0.1:5342/rest/say1?version=1.0.0"); + StaticContext.getContext(Constants.SERVICE_IMPL_CLASS).put(url.getServiceKey(), RestServiceImpl.class); RestServiceImpl server = new RestServiceImpl(); Assert.assertFalse(server.isCalled()); - URL url = URL.valueOf("rest://127.0.0.1:5342/rest/say1?version=1.0.0"); + Exporter exporter = protocol.export(proxyFactory.getInvoker(server, RestService.class, url)); Invoker invoker = protocol.refer(RestService.class, url); RestService client = proxyFactory.getProxy(invoker); diff --git a/dubbo-test/dubbo-test-examples/src/main/java/com/alibaba/dubbo/examples/rest/rest-consumer.xml b/dubbo-test/dubbo-test-examples/src/main/java/com/alibaba/dubbo/examples/rest/rest-consumer.xml index bacd51341d7..920a95d70da 100644 --- a/dubbo-test/dubbo-test-examples/src/main/java/com/alibaba/dubbo/examples/rest/rest-consumer.xml +++ b/dubbo-test/dubbo-test-examples/src/main/java/com/alibaba/dubbo/examples/rest/rest-consumer.xml @@ -15,10 +15,12 @@ See the License for the specific language governing permissions and limitations under the License. --> - + http://dubbo.apache.org/schema/dubbo http://dubbo.apache.org/schema/dubbo/dubbo.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> From 7cd86a1d0cdc4101a3d1c66e92a1b321ed6ac739 Mon Sep 17 00:00:00 2001 From: kongming Date: Thu, 11 Oct 2018 17:12:55 +0800 Subject: [PATCH 2/5] [Dubbo-2637] fix the issue #2637 to make sure the properties load properly --- .../com/alibaba/dubbo/common/utils/ConfigUtils.java | 13 ++++++++++++- .../dubbo/config/AbstractInterfaceConfigTest.java | 3 ++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/dubbo-common/src/main/java/com/alibaba/dubbo/common/utils/ConfigUtils.java b/dubbo-common/src/main/java/com/alibaba/dubbo/common/utils/ConfigUtils.java index 8c4ac69aeab..d08c2be36a9 100644 --- a/dubbo-common/src/main/java/com/alibaba/dubbo/common/utils/ConfigUtils.java +++ b/dubbo-common/src/main/java/com/alibaba/dubbo/common/utils/ConfigUtils.java @@ -21,6 +21,7 @@ import com.alibaba.dubbo.common.logger.Logger; import com.alibaba.dubbo.common.logger.LoggerFactory; +import java.io.File; import java.io.FileInputStream; import java.io.InputStream; import java.lang.management.ManagementFactory; @@ -217,7 +218,7 @@ public static Properties loadProperties(String fileName, boolean allowMultiFile) */ public static Properties loadProperties(String fileName, boolean allowMultiFile, boolean optional) { Properties properties = new Properties(); - if (fileName.startsWith("/")) { + if (checkFileNameExist(fileName)) { try { FileInputStream input = new FileInputStream(fileName); try { @@ -291,6 +292,16 @@ public static Properties loadProperties(String fileName, boolean allowMultiFile, return properties; } + /** + * check if the fileName can be found in filesystem + * @param fileName + * @return + */ + private static boolean checkFileNameExist(String fileName) { + File file = new File(fileName); + return file != null && file.exists() ? true : false; + } + public static int getPid() { if (PID < 0) { try { diff --git a/dubbo-config/dubbo-config-api/src/test/java/com/alibaba/dubbo/config/AbstractInterfaceConfigTest.java b/dubbo-config/dubbo-config-api/src/test/java/com/alibaba/dubbo/config/AbstractInterfaceConfigTest.java index f34c31ffbe3..4f08d29e972 100644 --- a/dubbo-config/dubbo-config-api/src/test/java/com/alibaba/dubbo/config/AbstractInterfaceConfigTest.java +++ b/dubbo-config/dubbo-config-api/src/test/java/com/alibaba/dubbo/config/AbstractInterfaceConfigTest.java @@ -87,7 +87,7 @@ public void checkApplication1() throws Exception { interfaceConfig.checkApplication(); ApplicationConfig appConfig = interfaceConfig.getApplication(); TestCase.assertEquals("demo", appConfig.getName()); - TestCase.assertEquals("100", System.getProperty(Constants.SHUTDOWN_WAIT_KEY)); + TestCase.assertEquals("100", ConfigUtils.getProperty(Constants.SHUTDOWN_WAIT_KEY)); System.clearProperty(Constants.SHUTDOWN_WAIT_KEY); ConfigUtils.setProperties(null); @@ -386,6 +386,7 @@ private void writeDubboProperties(String key, String value) { Properties properties = new Properties(); properties.put(key, value); properties.store(os, ""); + os.flush(); os.close(); } catch (IOException e) { if (os != null) { From 99bb5ba28c330a3dcf91db91c014fb5602bd9225 Mon Sep 17 00:00:00 2001 From: kongming Date: Thu, 11 Oct 2018 17:42:00 +0800 Subject: [PATCH 3/5] ServiceConfig.java:33: Using the '.*' form of import should be avoided --- .../alibaba/dubbo/config/ServiceConfig.java | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/ServiceConfig.java b/dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/ServiceConfig.java index b04dbdbedd3..846b2165c40 100644 --- a/dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/ServiceConfig.java +++ b/dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/ServiceConfig.java @@ -30,19 +30,37 @@ import com.alibaba.dubbo.config.model.ApplicationModel; import com.alibaba.dubbo.config.model.ProviderModel; import com.alibaba.dubbo.config.support.Parameter; -import com.alibaba.dubbo.rpc.*; +import com.alibaba.dubbo.rpc.Exporter; +import com.alibaba.dubbo.rpc.Invoker; +import com.alibaba.dubbo.rpc.Protocol; +import com.alibaba.dubbo.rpc.ProxyFactory; +import com.alibaba.dubbo.rpc.StaticContext; import com.alibaba.dubbo.rpc.cluster.ConfiguratorFactory; import com.alibaba.dubbo.rpc.service.GenericService; import com.alibaba.dubbo.rpc.support.ProtocolUtils; import java.lang.reflect.Method; -import java.net.*; -import java.util.*; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.Socket; +import java.net.SocketAddress; +import java.net.UnknownHostException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.UUID; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; -import static com.alibaba.dubbo.common.utils.NetUtils.*; +import static com.alibaba.dubbo.common.utils.NetUtils.LOCALHOST; +import static com.alibaba.dubbo.common.utils.NetUtils.getAvailablePort; +import static com.alibaba.dubbo.common.utils.NetUtils.getLocalHost; +import static com.alibaba.dubbo.common.utils.NetUtils.isInvalidLocalHost; +import static com.alibaba.dubbo.common.utils.NetUtils.isInvalidPort; /** * ServiceConfig From 11636f396a89ef82df2cd9bb6c3b87e91047214b Mon Sep 17 00:00:00 2001 From: kongming Date: Wed, 31 Oct 2018 14:12:01 +0800 Subject: [PATCH 4/5] replace the import rpc.* with rpc Exporter etc --- .../alibaba/dubbo/rpc/protol/rest/RestProtocolTest.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dubbo-rpc/dubbo-rpc-rest/src/test/java/com/alibaba/dubbo/rpc/protol/rest/RestProtocolTest.java b/dubbo-rpc/dubbo-rpc-rest/src/test/java/com/alibaba/dubbo/rpc/protol/rest/RestProtocolTest.java index ecb365095be..fce656eb2ed 100644 --- a/dubbo-rpc/dubbo-rpc-rest/src/test/java/com/alibaba/dubbo/rpc/protol/rest/RestProtocolTest.java +++ b/dubbo-rpc/dubbo-rpc-rest/src/test/java/com/alibaba/dubbo/rpc/protol/rest/RestProtocolTest.java @@ -19,7 +19,12 @@ import com.alibaba.dubbo.common.Constants; import com.alibaba.dubbo.common.URL; import com.alibaba.dubbo.common.extension.ExtensionLoader; -import com.alibaba.dubbo.rpc.*; +import com.alibaba.dubbo.rpc.Exporter; +import com.alibaba.dubbo.rpc.Invoker; +import com.alibaba.dubbo.rpc.Protocol; +import com.alibaba.dubbo.rpc.ProxyFactory; +import com.alibaba.dubbo.rpc.StaticContext; + import junit.framework.Assert; import org.junit.Test; From 878d2998e617466bb8ba8aff1e598e565f9afabb Mon Sep 17 00:00:00 2001 From: kongming Date: Wed, 31 Oct 2018 14:25:32 +0800 Subject: [PATCH 5/5] replace the import rpc.* with rpc Exporter etc --- .../dubbo/rpc/protocol/rest/RestProtocolTest.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/dubbo-rpc/dubbo-rpc-rest/src/test/java/com/alibaba/dubbo/rpc/protocol/rest/RestProtocolTest.java b/dubbo-rpc/dubbo-rpc-rest/src/test/java/com/alibaba/dubbo/rpc/protocol/rest/RestProtocolTest.java index 29424c8345c..6a2c6371bb4 100644 --- a/dubbo-rpc/dubbo-rpc-rest/src/test/java/com/alibaba/dubbo/rpc/protocol/rest/RestProtocolTest.java +++ b/dubbo-rpc/dubbo-rpc-rest/src/test/java/com/alibaba/dubbo/rpc/protocol/rest/RestProtocolTest.java @@ -20,7 +20,15 @@ import com.alibaba.dubbo.common.URL; import com.alibaba.dubbo.common.extension.ExtensionLoader; import com.alibaba.dubbo.common.utils.NetUtils; -import com.alibaba.dubbo.rpc.*; +import com.alibaba.dubbo.rpc.Exporter; +import com.alibaba.dubbo.rpc.Protocol; +import com.alibaba.dubbo.rpc.ProxyFactory; +import com.alibaba.dubbo.rpc.Result; +import com.alibaba.dubbo.rpc.RpcContext; +import com.alibaba.dubbo.rpc.RpcException; +import com.alibaba.dubbo.rpc.RpcInvocation; +import com.alibaba.dubbo.rpc.StaticContext; + import org.hamcrest.CoreMatchers; import org.junit.After; import org.junit.Test;