From 06e5e6721b12303eda5106fcce01c12998bd9a63 Mon Sep 17 00:00:00 2001 From: Huxing Zhang Date: Thu, 17 May 2018 16:04:19 +0800 Subject: [PATCH] Merge pull request #1811, fix unstable hessian protocol unit test by adding overload. Fixed #1667, fixed #1727 --- .../dubbo/rpc/protocol/hessian/HessianProtocolTest.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dubbo-rpc/dubbo-rpc-hessian/src/test/java/com/alibaba/dubbo/rpc/protocol/hessian/HessianProtocolTest.java b/dubbo-rpc/dubbo-rpc-hessian/src/test/java/com/alibaba/dubbo/rpc/protocol/hessian/HessianProtocolTest.java index 2ca3fce1272..6e8ab72e174 100644 --- a/dubbo-rpc/dubbo-rpc-hessian/src/test/java/com/alibaba/dubbo/rpc/protocol/hessian/HessianProtocolTest.java +++ b/dubbo-rpc/dubbo-rpc-hessian/src/test/java/com/alibaba/dubbo/rpc/protocol/hessian/HessianProtocolTest.java @@ -25,7 +25,7 @@ import com.alibaba.dubbo.rpc.RpcException; import com.alibaba.dubbo.rpc.protocol.hessian.HessianServiceImpl.MyException; -import junit.framework.Assert; +import org.junit.Assert; import org.junit.Test; import static org.junit.Assert.fail; @@ -41,7 +41,7 @@ public void testHessianProtocol() { Assert.assertFalse(server.isCalled()); ProxyFactory proxyFactory = ExtensionLoader.getExtensionLoader(ProxyFactory.class).getAdaptiveExtension(); Protocol protocol = ExtensionLoader.getExtensionLoader(Protocol.class).getAdaptiveExtension(); - URL url = URL.valueOf("hessian://127.0.0.1:5342/" + HessianService.class.getName() + "?version=1.0.0"); + URL url = URL.valueOf("hessian://127.0.0.1:5342/" + HessianService.class.getName() + "?version=1.0.0&hessian.overload.method=true"); Exporter exporter = protocol.export(proxyFactory.getInvoker(server, HessianService.class, url)); Invoker invoker = protocol.refer(HessianService.class, url); HessianService client = proxyFactory.getProxy(invoker); @@ -76,7 +76,7 @@ public void testHttpClient() { Assert.assertFalse(server.isCalled()); ProxyFactory proxyFactory = ExtensionLoader.getExtensionLoader(ProxyFactory.class).getAdaptiveExtension(); Protocol protocol = ExtensionLoader.getExtensionLoader(Protocol.class).getAdaptiveExtension(); - URL url = URL.valueOf("hessian://127.0.0.1:5342/" + HessianService.class.getName() + "?version=1.0.0&client=httpclient"); + URL url = URL.valueOf("hessian://127.0.0.1:5342/" + HessianService.class.getName() + "?version=1.0.0&client=httpclient&hessian.overload.method=true"); Exporter exporter = protocol.export(proxyFactory.getInvoker(server, HessianService.class, url)); Invoker invoker = protocol.refer(HessianService.class, url); HessianService client = proxyFactory.getProxy(invoker); @@ -100,7 +100,7 @@ public void testTimeOut() { client.timeOut(6000); fail(); } catch (RpcException expected) { - Assert.assertEquals(true, expected.isTimeout()); + Assert.assertTrue(expected.isTimeout()); } finally { invoker.destroy(); exporter.unexport(); @@ -121,6 +121,7 @@ public void testCustomException() { client.customException(); fail(); } catch (MyException expected) { + } invoker.destroy(); exporter.unexport();