@Test
    public void testSyncSampleService() {
        ApplicationConfig applicationConfig = new ApplicationConfig().setAppName("triple-server");
        int port = 50052;
        ServerConfig serverConfig = new ServerConfig()
            .setProtocol(RpcConstants.PROTOCOL_TYPE_TRIPLE)
            .setPort(port);

        ProviderConfig<SampleService> providerConfig = new ProviderConfig<SampleService>()
            .setApplication(applicationConfig)
            .setBootstrap(RpcConstants.PROTOCOL_TYPE_TRIPLE)
            .setInterfaceId(SampleService.class.getName())
            .setRef(new SampleService() {
                @Override
                public String hello(String name) {
                    return "Hello! " + name;
                }

                @Override
                public String messageSize(String msg, int responseSize) {
                    return "";
                }
            })
            .setServer(serverConfig);

        providerConfig.export();

        ConsumerConfig<SampleService> consumerConfig = new ConsumerConfig<SampleService>();
        consumerConfig.setInterfaceId(SampleService.class.getName())
            .setProtocol(RpcConstants.PROTOCOL_TYPE_TRIPLE)
            .setDirectUrl("tri://127.0.0.1:" + port);

        SampleService sampleService = consumerConfig.refer();

        String reply = sampleService.hello("world");
        Assert.assertNotNull(reply);
        Assert.assertEquals(reply, "Hello! world");
    }
@author <a href=mailto:leizhiyuan@gmail.com>leizhiyuan</a>
test/test-integration/src/test/java/com/alipay/sofa/rpc/test/triple/TripleServerTest.java