Skip to content

Commit 06e5e67

Browse files
ralf0131chickenlj
authored andcommitted
Merge pull request apache#1811, fix unstable hessian protocol unit test by adding overload.
Fixed apache#1667, fixed apache#1727
1 parent 3d8eaba commit 06e5e67

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

dubbo-rpc/dubbo-rpc-hessian/src/test/java/com/alibaba/dubbo/rpc/protocol/hessian/HessianProtocolTest.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import com.alibaba.dubbo.rpc.RpcException;
2626
import com.alibaba.dubbo.rpc.protocol.hessian.HessianServiceImpl.MyException;
2727

28-
import junit.framework.Assert;
28+
import org.junit.Assert;
2929
import org.junit.Test;
3030

3131
import static org.junit.Assert.fail;
@@ -41,7 +41,7 @@ public void testHessianProtocol() {
4141
Assert.assertFalse(server.isCalled());
4242
ProxyFactory proxyFactory = ExtensionLoader.getExtensionLoader(ProxyFactory.class).getAdaptiveExtension();
4343
Protocol protocol = ExtensionLoader.getExtensionLoader(Protocol.class).getAdaptiveExtension();
44-
URL url = URL.valueOf("hessian://127.0.0.1:5342/" + HessianService.class.getName() + "?version=1.0.0");
44+
URL url = URL.valueOf("hessian://127.0.0.1:5342/" + HessianService.class.getName() + "?version=1.0.0&hessian.overload.method=true");
4545
Exporter<HessianService> exporter = protocol.export(proxyFactory.getInvoker(server, HessianService.class, url));
4646
Invoker<HessianService> invoker = protocol.refer(HessianService.class, url);
4747
HessianService client = proxyFactory.getProxy(invoker);
@@ -76,7 +76,7 @@ public void testHttpClient() {
7676
Assert.assertFalse(server.isCalled());
7777
ProxyFactory proxyFactory = ExtensionLoader.getExtensionLoader(ProxyFactory.class).getAdaptiveExtension();
7878
Protocol protocol = ExtensionLoader.getExtensionLoader(Protocol.class).getAdaptiveExtension();
79-
URL url = URL.valueOf("hessian://127.0.0.1:5342/" + HessianService.class.getName() + "?version=1.0.0&client=httpclient");
79+
URL url = URL.valueOf("hessian://127.0.0.1:5342/" + HessianService.class.getName() + "?version=1.0.0&client=httpclient&hessian.overload.method=true");
8080
Exporter<HessianService> exporter = protocol.export(proxyFactory.getInvoker(server, HessianService.class, url));
8181
Invoker<HessianService> invoker = protocol.refer(HessianService.class, url);
8282
HessianService client = proxyFactory.getProxy(invoker);
@@ -100,7 +100,7 @@ public void testTimeOut() {
100100
client.timeOut(6000);
101101
fail();
102102
} catch (RpcException expected) {
103-
Assert.assertEquals(true, expected.isTimeout());
103+
Assert.assertTrue(expected.isTimeout());
104104
} finally {
105105
invoker.destroy();
106106
exporter.unexport();
@@ -121,6 +121,7 @@ public void testCustomException() {
121121
client.customException();
122122
fail();
123123
} catch (MyException expected) {
124+
124125
}
125126
invoker.destroy();
126127
exporter.unexport();

0 commit comments

Comments
 (0)