You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by ahgittin <gi...@git.apache.org> on 2015/05/29 10:17:11 UTC

[GitHub] incubator-brooklyn pull request: add coercion from string to set, ...

GitHub user ahgittin opened a pull request:

    https://github.com/apache/incubator-brooklyn/pull/666

    add coercion from string to set, and test location config set/map

    including notes on inheriting, confirming that sets/maps are NOT merged when coming from properties

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

    $ git pull https://github.com/ahgittin/incubator-brooklyn location-config-collections

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

    https://github.com/apache/incubator-brooklyn/pull/666.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 #666
    
----
commit 5c75aa16c99aae41c03297125e1f7caa96d09c57
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Date:   2015-05-29T08:15:39Z

    add coercion from string to set, and test location config set/map
    
    including notes on inheriting, confirming that sets/maps are NOT merged when coming from properties

----


---
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-brooklyn pull request: add coercion from string to set, ...

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

    https://github.com/apache/incubator-brooklyn/pull/666#discussion_r31410385
  
    --- Diff: locations/jclouds/src/test/java/brooklyn/location/jclouds/JcloudsLocationResolverTest.java ---
    @@ -280,6 +285,50 @@ public void testResolvesJcloudsFromNamedOfNamedWithPropertiesOverriddenCorrectly
             assertEquals(l.config().getLocalBag().getStringKey("prop1"), "1");
         }
     
    +    @Test
    +    public void testResolvesListAndMapProperties() throws Exception {
    +        brooklynProperties.put("brooklyn.location.jclouds.softlayer.prop1", "[ a, b ]");
    +        brooklynProperties.put("brooklyn.location.jclouds.softlayer.prop2", "{ a: 1, b: 2 }");
    +        brooklynProperties.put("brooklyn.location.named.foo", "jclouds:softlayer:ams01");
    +        
    +        JcloudsLocation l = resolve("named:foo");
    +        assertJcloudsEquals(l, "softlayer", "ams01");
    +        assertEquals(l.config().get(new SetConfigKey<String>(String.class, "prop1")), MutableSet.of("a", "b"));
    +        assertEquals(l.config().get(new MapConfigKey<String>(String.class, "prop2")), MutableMap.of("a", 1, "b", 2));
    +    }
    +    
    +    @Test
    +    public void testResolvesListAndMapPropertiesWithoutMergeOnInheritance() throws Exception {
    +        // when we have a yaml way to specify config we may wish to have different semantics;
    +        // it could depend on the collection config key whether to merge on inheritance
    +        brooklynProperties.put("brooklyn.location.jclouds.softlayer.prop1", "[ a, b ]");
    +        brooklynProperties.put("brooklyn.location.jclouds.softlayer.prop2", "{ a: 1, b: 2 }");
    +        brooklynProperties.put("brooklyn.location.named.foo", "jclouds:softlayer:ams01");
    +        
    +        brooklynProperties.put("brooklyn.location.named.foo.prop1", "[ a: 1, c: 3 ]");
    +        brooklynProperties.put("brooklyn.location.named.foo.prop2", "{ b: 3, c: 3 }");
    +        brooklynProperties.put("brooklyn.location.named.bar", "named:foo");
    +        brooklynProperties.put("brooklyn.location.named.bar.prop2", "{ c: 4, d: 4 }");
    +        
    +        // these do NOT affect the maps
    --- End diff --
    
    Mildly surprising.


---
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-brooklyn pull request: add coercion from string to set, ...

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

    https://github.com/apache/incubator-brooklyn/pull/666


---
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-brooklyn pull request: add coercion from string to set, ...

Posted by sjcorbett <gi...@git.apache.org>.
Github user sjcorbett commented on the pull request:

    https://github.com/apache/incubator-brooklyn/pull/666#issuecomment-107378734
  
    Looks ok. Will merge. 


---
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.
---