@Test
    public void testRpcDirectInvokeFromContext() {

        ServerConfig serverConfig = new ServerConfig()
            .setProtocol("bolt")
            .setHost("0.0.0.0")
            .setPort(13900);

        ProviderConfig<HelloService> provider = new ProviderConfig();
        provider.setInterfaceId(HelloService.class.getName())
            .setRef(new HelloServiceImpl("x-demo-invoke"))
            .setApplication(new ApplicationConfig().setAppName("x-test-server"))
            .setProxy("javassist")
            .setSerialization("hessian2")
            .setServer(serverConfig)
            .setTimeout(3000);

        provider.export();

        ConsumerConfig<HelloService> consumer = new ConsumerConfig();
        consumer.setInterfaceId(HelloService.class.getName())
            .setApplication(new ApplicationConfig().setAppName("x-test-client"))
            .setProxy("javassist");

        HelloService proxy = consumer.refer();

        for (int i = 0; i < 3; i++) {
            RpcInvokeContext.getContext().setTargetURL("127.0.0.1:13900");
            Assert.assertEquals("x-demo-invoke", proxy.sayHello("x-demo-invoke", 1));
        }

        provider.unExport();
        consumer.unRefer();
    }
@author <a href="mailto:zhanggeng.zg@antfin.com">GengZhang</a>
test/test-integration/src/test/java/com/alipay/sofa/rpc/test/client/FailoverClusterTest.java