@Test
public void testJsonrpcProtocol() {

    HttpServiceImpl server = new HttpServiceImpl();
    assertFalse(server.isCalled());
    ProxyFactory proxyFactory = ExtensionLoader.getExtensionLoader(ProxyFactory.class).getAdaptiveExtension();
    Protocol protocol = ExtensionLoader.getExtensionLoader(Protocol.class).getAdaptiveExtension();
    int port = NetUtils.getAvailablePort();
    URL url = URL.valueOf("http://127.0.0.1:" + port + "/" + HttpService.class.getName() + "?version=1.0.0");
    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");
    assertTrue(server.isCalled());
    assertEquals("Hello, haha", result);
    invoker.destroy();
    exporter.unexport();
}