### Question:
HttpProtocol extends AbstractProxyProtocol { public HttpProtocol() { super(RemoteAccessException.class); } HttpProtocol(); void setHttpBinder(HttpBinder httpBinder); @Override int getDefaultPort(); static final int DEFAULT_PORT; }### Answer:
@Test public void testHttpProtocol() { HttpServiceImpl server = new HttpServiceImpl(); Assertions.assertFalse(server.isCalled()); ProxyFactory proxyFactory = ExtensionLoader.getExtensionLoader(ProxyFactory.class).getAdaptiveExtension(); Protocol protocol = ExtensionLoader.getExtensionLoader(Protocol.class).getAdaptiveExtension(); URL url = URL.valueOf("http: Exporter<HttpService> exporter = protocol.export(proxyFactory.getInvoker(server, HttpService.class, url)); Invoker<HttpService> invoker = protocol.refer(HttpService.class, url); HttpService client = proxyFactory.getProxy(invoker); String result = client.sayHello("haha"); Assertions.assertTrue(server.isCalled()); Assertions.assertEquals("Hello, haha", result); invoker.destroy(); exporter.unexport(); }