You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2021/10/27 00:00:21 UTC

[GitHub] [dubbo] pinxiong opened a new issue #9137: [Feature] Support global registry center when run unit test

pinxiong opened a new issue #9137:
URL: https://github.com/apache/dubbo/issues/9137


   <!-- If you need to report a security issue please visit https://github.com/apache/dubbo/security/policy -->
   
   - [x] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.
   - [x] I have searched the [release notes](https://github.com/apache/dubbo/releases) of this repository and believe that this is not a duplicate.
   
   ## Describe the feature
   <!-- Please also discuss possible business value -->
   
   Registry center is used in many unit tests, especially `dubbo-config-api`, `dubbo-config-spring` and `dubbo-test-spring` modules. 
   
   Generallly, we use `zookeeper` as the default registry center.  We need to start `zookeeper` before executing each unit test and shut it down after executed. Also, we need to refer `zookeeper` in the code to manage its lifecycle below
   
   ```java
   public class GenericServiceTest {
       // define registry center
       private static RegistryCenter singleRegistryCenter;
   
       @BeforeAll
       public static void beforeAll() {
           // start registry center
           singleRegistryCenter = new ZookeeperSingleRegistryCenter();
           singleRegistryCenter.startup();
           DubboBootstrap.reset();
       }
   
       @AfterAll
       public static void afterAll() {
           DubboBootstrap.reset();
           // stop registry center
           singleRegistryCenter.shutdown();
       }
       ...
   }
   ```
   
   So, I hope we can define a global registry center in each test plan to reduce the times of `zookeeper`'s startup and shutdown. More importantly, we can use registry center directly without invading any code.


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] pinxiong closed issue #9137: [Feature] Support global registry center when run unit test

Posted by GitBox <gi...@apache.org>.
pinxiong closed issue #9137:
URL: https://github.com/apache/dubbo/issues/9137


   


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org