com.alibaba.dubbo.rpc.protocol.hessian.HessianServiceImpl.MyException Java Examples
The following examples show how to use
com.alibaba.dubbo.rpc.protocol.hessian.HessianServiceImpl.MyException.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: HessianProtocolTest.java From dubbo-2.6.5 with Apache License 2.0 | 6 votes |
@Test public void testCustomException() { HessianServiceImpl server = new HessianServiceImpl(); 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"); Exporter<HessianService> exporter = protocol.export(proxyFactory.getInvoker(server, HessianService.class, url)); Invoker<HessianService> invoker = protocol.refer(HessianService.class, url); HessianService client = proxyFactory.getProxy(invoker); try { client.customException(); fail(); } catch (MyException expected) { } invoker.destroy(); exporter.unexport(); }
Example #2
Source File: HessianProtocolTest.java From dubbox with Apache License 2.0 | 6 votes |
@Test public void testCustomException() { HessianServiceImpl server = new HessianServiceImpl(); 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"); Exporter<HessianService> exporter = protocol.export(proxyFactory.getInvoker(server, HessianService.class, url)); Invoker<HessianService> invoker = protocol.refer(HessianService.class, url); HessianService client = proxyFactory.getProxy(invoker); try { client.customException(); fail(); } catch (MyException expected) { } invoker.destroy(); exporter.unexport(); }
Example #3
Source File: HessianProtocolTest.java From dubbox-hystrix with Apache License 2.0 | 6 votes |
@Test public void testCustomException() { HessianServiceImpl server = new HessianServiceImpl(); 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"); Exporter<HessianService> exporter = protocol.export(proxyFactory.getInvoker(server, HessianService.class, url)); Invoker<HessianService> invoker = protocol.refer(HessianService.class, url); HessianService client = proxyFactory.getProxy(invoker); try { client.customException(); fail(); } catch (MyException expected) { } invoker.destroy(); exporter.unexport(); }
Example #4
Source File: HessianProtocolTest.java From dubbox with Apache License 2.0 | 6 votes |
@Test public void testCustomException() { HessianServiceImpl server = new HessianServiceImpl(); 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"); Exporter<HessianService> exporter = protocol.export(proxyFactory.getInvoker(server, HessianService.class, url)); Invoker<HessianService> invoker = protocol.refer(HessianService.class, url); HessianService client = proxyFactory.getProxy(invoker); try { client.customException(); fail(); } catch (MyException expected) { } invoker.destroy(); exporter.unexport(); }
Example #5
Source File: HessianProtocolTest.java From dubbox with Apache License 2.0 | 6 votes |
@Test public void testCustomException() { HessianServiceImpl server = new HessianServiceImpl(); 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"); Exporter<HessianService> exporter = protocol.export(proxyFactory.getInvoker(server, HessianService.class, url)); Invoker<HessianService> invoker = protocol.refer(HessianService.class, url); HessianService client = proxyFactory.getProxy(invoker); try { client.customException(); fail(); } catch (MyException expected) { } invoker.destroy(); exporter.unexport(); }