xiaoheng1 commented on issue #8124:
URL: https://github.com/apache/dubbo/issues/8124#issuecomment-876338883


   The following test case can reproduce this problem:
   
   ```
   public class TripleProtocolTest {
       private Protocol protocol = 
ExtensionLoader.getExtensionLoader(Protocol.class).getAdaptiveExtension();
       private ProxyFactory proxy = 
ExtensionLoader.getExtensionLoader(ProxyFactory.class).getAdaptiveExtension();
   
       @Test
       public void testDemoProtocol() throws Exception {
           IGreeter serviceImpl = new IGreeterImpl();
   
           int availablePort = NetUtils.getAvailablePort();
   
           URL url = URL.valueOf("tri://127.0.0.1:" + availablePort + "/" + 
IGreeter.class.getName());
   
           ServiceDescriptor serviceDescriptor = 
ApplicationModel.getServiceRepository().registerService(IGreeter.class);
           ApplicationModel.getServiceRepository().registerProvider(
               url.getServiceKey(),
               serviceImpl,
               serviceDescriptor,
               null,
               new ServiceMetadata()
           );
   
           protocol.export(proxy.getInvoker(serviceImpl, IGreeter.class, url));
           serviceImpl = proxy.getProxy(protocol.refer(IGreeter.class, url));
           Assertions.assertEquals("hello world", serviceImpl.echo("hello 
world"));
   
           // resource recycle.
           ApplicationModel.getServiceRepository().destroy();
       }
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to