You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by li...@apache.org on 2018/12/27 06:48:26 UTC

[incubator-dubbo] branch master updated (59cbe69 -> cdee4a2)

This is an automated email from the ASF dual-hosted git repository.

liujun pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-dubbo.git.


    from 59cbe69  Merge pull request #3062, code review around RouterFactory.
     new b4dd0cf  Add comment
     new cdee4a2  Fix UT

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../support/zookeeper/ZookeeperDynamicConfiguration.java           | 7 ++++++-
 .../support/zookeeper/ZookeeperDynamicConfigurationTest.java       | 5 +++--
 2 files changed, 9 insertions(+), 3 deletions(-)


[incubator-dubbo] 01/02: Add comment

Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

liujun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-dubbo.git

commit b4dd0cfd63b59a25044f1b91fd5fa4e4d0de271b
Author: ken.lj <ke...@gmail.com>
AuthorDate: Thu Dec 27 14:14:08 2018 +0800

    Add comment
---
 .../support/zookeeper/ZookeeperDynamicConfiguration.java           | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/dubbo-configcenter/dubbo-configcenter-zookeeper/src/main/java/org/apache/dubbo/configcenter/support/zookeeper/ZookeeperDynamicConfiguration.java b/dubbo-configcenter/dubbo-configcenter-zookeeper/src/main/java/org/apache/dubbo/configcenter/support/zookeeper/ZookeeperDynamicConfiguration.java
index 0739d51..1df548d 100644
--- a/dubbo-configcenter/dubbo-configcenter-zookeeper/src/main/java/org/apache/dubbo/configcenter/support/zookeeper/ZookeeperDynamicConfiguration.java
+++ b/dubbo-configcenter/dubbo-configcenter-zookeeper/src/main/java/org/apache/dubbo/configcenter/support/zookeeper/ZookeeperDynamicConfiguration.java
@@ -100,9 +100,14 @@ public class ZookeeperDynamicConfiguration extends AbstractDynamicConfiguration<
 
     @Override
     protected String getTargetConfig(String key, String group, long timeout) {
+        // when group is not null, we are getting startup configs from Config Center
+        // for example, group=dubbo, key=dubbo.properties
         if (StringUtils.isNotEmpty(group)) {
             key = group + "/" + key;
-        } else {
+        }
+        // when group is null, we are fetching governance rules.
+        // for example, key=org.apache.dubbo.DemoService.configurators
+        else {
             int i = key.lastIndexOf(".");
             key = key.substring(0, i) + "/" + key.substring(i + 1);
         }


[incubator-dubbo] 02/02: Fix UT

Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

liujun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-dubbo.git

commit cdee4a20623fefb64433325a8fc112ccc73c0294
Author: ken.lj <ke...@gmail.com>
AuthorDate: Thu Dec 27 14:14:21 2018 +0800

    Fix UT
---
 .../support/zookeeper/ZookeeperDynamicConfigurationTest.java         | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/dubbo-configcenter/dubbo-configcenter-zookeeper/src/test/java/org/apache/dubbo/configcenter/support/zookeeper/ZookeeperDynamicConfigurationTest.java b/dubbo-configcenter/dubbo-configcenter-zookeeper/src/test/java/org/apache/dubbo/configcenter/support/zookeeper/ZookeeperDynamicConfigurationTest.java
index 8b82c09..b25fd7b 100644
--- a/dubbo-configcenter/dubbo-configcenter-zookeeper/src/test/java/org/apache/dubbo/configcenter/support/zookeeper/ZookeeperDynamicConfigurationTest.java
+++ b/dubbo-configcenter/dubbo-configcenter-zookeeper/src/test/java/org/apache/dubbo/configcenter/support/zookeeper/ZookeeperDynamicConfigurationTest.java
@@ -38,7 +38,7 @@ import java.util.Map;
 import java.util.concurrent.CountDownLatch;
 
 /**
- *
+ * TODO refactor using mockito
  */
 public class ZookeeperDynamicConfigurationTest {
     private static CuratorFramework client;
@@ -61,6 +61,7 @@ public class ZookeeperDynamicConfigurationTest {
             setData("/dubbo/config/group*service:version/configurators", "The content from configurators");
             setData("/dubbo/config/appname", "The content from higer level node");
             setData("/dubbo/config/appname/tagrouters", "The content from appname tagrouters");
+            setData("/dubbo/config/never.change.DemoService/configurators", "Never change value from configurators");
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -85,7 +86,7 @@ public class ZookeeperDynamicConfigurationTest {
 
     @Test
     public void testGetConfig() throws Exception {
-        Assert.assertEquals("The content from dubbo.properties", configuration.getConfig("dubbo.dubbo.properties"));
+        Assert.assertEquals("Never change value from configurators", configuration.getConfig("never.change.DemoService.configurators"));
         Assert.assertEquals("The content from dubbo.properties", configuration.getConfig("dubbo.properties", "dubbo"));
     }