[
https://issues.apache.org/jira/browse/BROOKLYN-328?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15725360#comment-15725360
]
ASF GitHub Bot commented on BROOKLYN-328:
-----------------------------------------
Github user ahgittin commented on the issue:
https://github.com/apache/brooklyn-server/pull/462
this improves fix for BROOKLYN-328 and now also fixes many of the issues
described at BROOKLYN-329, specifically
*( causes default values to be inheritable
and
* 5) the ConfigMap.findKeys method never looked at the keys declared on the
container; I'm tidying that in order to test the above
* 6) if a yaml subtype reclares a supertype's parameter (from yaml) or
config key (from java) only partially, the results are not merged as one would
expect, but instead all parts of the super's declaration are lost
> brooklyn.parameter with same name as java config key does not get default
> from yaml
> -----------------------------------------------------------------------------------
>
> Key: BROOKLYN-328
> URL: https://issues.apache.org/jira/browse/BROOKLYN-328
> Project: Brooklyn
> Issue Type: Bug
> Reporter: Aled Sage
> Priority: Minor
>
> While using 0.10.0-SNAPSHOT...
> I wrote a YAML entity that declared a {{brooklyn.parameter}} with the same
> name as a config key on the Java entity that it referenced. In my case, this
> was {{download.url}} on VanillaSoftwareProcess so that I could specify my
> preferred default value.
> However, when I used that config key to set an environment variable, I got an
> empty string. i.e. it didn't pick up my default.
> I recreated this behaviour in the simpler test case below (which I'll add to
> {{ConfigParametersYamlTest}}). If you change the confName to something that
> doesn't clash, then the test passes.
> {noformat}
> public void testConfigParameterOverridingJavaConfig() throws Exception {
> String confName = TestEntity.CONF_OBJECT.getName();
> addCatalogItems(
> "brooklyn.catalog:",
> " itemType: entity",
> " items:",
> " - id: entity-with-keys",
> " item:",
> " type: "+TestEntity.class.getName(),
> " brooklyn.parameters:",
> " - name: "+confName,
> " type: java.lang.Object",
> " default: myDefaultObj",
> " brooklyn.config:",
> " my.other.obj: $brooklyn:config(\""+confName+"\")");
> String yaml = Joiner.on("\n").join(
> "services:",
> "- type: entity-with-keys");
> Entity app = createStartWaitAndLogApplication(yaml);
> TestEntity entity = (TestEntity)
> Iterables.getOnlyElement(app.getChildren());
>
> assertEquals(entity.config().get(ConfigKeys.newStringConfigKey("my.other.obj")),
> "myDefaultObj");
> }
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)