You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@eagle.apache.org by r7raul1984 <gi...@git.apache.org> on 2016/11/04 06:31:52 UTC

[GitHub] incubator-eagle pull request #609: [EAGLE-723] Add unit test for configbus.

GitHub user r7raul1984 opened a pull request:

    https://github.com/apache/incubator-eagle/pull/609

    [EAGLE-723] Add unit test for configbus.

     - Add unit test for ConfigBus.
     - Add unit test for ZKConfigBuilder.
    
    https://issues.apache.org/jira/browse/EAGLE-723


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/r7raul1984/incubator-eagle EAGLE-723

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-eagle/pull/609.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #609
    
----
commit 6ad0848f881f8793fc9f3ae59e0887f897aed077
Author: r7raul1984 <ta...@yhd.com>
Date:   2016-11-04T06:12:06Z

    [EAGLE-723] Add unit test for configbus.
    
    http://issues.apache.org/jira/browse/EAGLE-723

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-eagle pull request #609: [EAGLE-723] Add unit test for configbus.

Posted by r7raul1984 <gi...@git.apache.org>.
Github user r7raul1984 commented on a diff in the pull request:

    https://github.com/apache/incubator-eagle/pull/609#discussion_r86718380
  
    --- Diff: eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/config/ConfigBusConsumer.java ---
    @@ -54,7 +54,12 @@ public ConfigBusConsumer(ZKConfig config, String topic, ConfigChangeCallback cal
     
         public ConfigValue getConfigValue() throws Exception {
             byte[] value = curator.getData().forPath(zkPath);
    -        ConfigValue v = mapper.readValue(value, ConfigValue.class);
    +        ConfigValue v;
    +        try {
    +            v = mapper.readValue(value, ConfigValue.class);
    +        } catch (JsonParseException e) {
    +            v = new ConfigValue();
    --- End diff --
    
    OK


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-eagle pull request #609: [EAGLE-723] Add unit test for configbus.

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-eagle/pull/609


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-eagle issue #609: [EAGLE-723] Add unit test for configbus.

Posted by haoch <gi...@git.apache.org>.
Github user haoch commented on the issue:

    https://github.com/apache/incubator-eagle/pull/609
  
    LGTM


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-eagle pull request #609: [EAGLE-723] Add unit test for configbus.

Posted by haoch <gi...@git.apache.org>.
Github user haoch commented on a diff in the pull request:

    https://github.com/apache/incubator-eagle/pull/609#discussion_r86718175
  
    --- Diff: eagle-core/eagle-alert-parent/eagle-alert/alert-common/src/main/java/org/apache/eagle/alert/config/ConfigBusConsumer.java ---
    @@ -54,7 +54,12 @@ public ConfigBusConsumer(ZKConfig config, String topic, ConfigChangeCallback cal
     
         public ConfigValue getConfigValue() throws Exception {
             byte[] value = curator.getData().forPath(zkPath);
    -        ConfigValue v = mapper.readValue(value, ConfigValue.class);
    +        ConfigValue v;
    +        try {
    +            v = mapper.readValue(value, ConfigValue.class);
    +        } catch (JsonParseException e) {
    +            v = new ConfigValue();
    --- End diff --
    
    Pls. add `LOG.warn(e.getMessage())` for the ignored exception.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---