Skip to content
Permalink
Browse files
Merge pull request #1811, fix unstable hessian protocol unit test by …
…adding overload.

Fixed #1667, fixed #1727
  • Loading branch information
ralf0131 authored and chickenlj committed May 17, 2018
1 parent e20618a commit a45206c64f1e293bd164b4f489d9830e5b296112
Showing 1 changed file with 5 additions and 4 deletions.
@@ -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<HessianService> exporter = protocol.export(proxyFactory.getInvoker(server, HessianService.class, url));
Invoker<HessianService> 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<HessianService> exporter = protocol.export(proxyFactory.getInvoker(server, HessianService.class, url));
Invoker<HessianService> 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();

0 comments on commit a45206c

Please sign in to comment.