You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/08/10 21:55:21 UTC

[jira] [Commented] (BROOKLYN-328) brooklyn.parameter with same name as java config key does not get default from yaml

    [ https://issues.apache.org/jira/browse/BROOKLYN-328?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15416089#comment-15416089 ] 

ASF GitHub Bot commented on BROOKLYN-328:
-----------------------------------------

GitHub user aledsage opened a pull request:

    https://github.com/apache/brooklyn-server/pull/296

    Various minor things

    Mostly improvements to tests (including failing tests for BROOKLYN-328 and BROOKLYN-329). See individual commits for explanation and details.

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

    $ git pull https://github.com/aledsage/brooklyn-server various-fixes-20160810

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

    https://github.com/apache/brooklyn-server/pull/296.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 #296
    
----
commit e096444a335134749a8010d04a9cf02c32354fd1
Author: Aled Sage <al...@gmail.com>
Date:   2016-08-10T20:14:58Z

    Extract execCmdAsserts

commit c3a0821bdbe5908334af90b63f4324f3f31aef14
Author: Aled Sage <al...@gmail.com>
Date:   2016-08-10T20:13:31Z

    Add more tests to ConfigParametersYamlTests
    
    Including for BROOKLYN-328 and BROOKLYN-329

commit 5f4eef3ec9a80845f1c88821b350f3d6f8ff5773
Author: Aled Sage <al...@gmail.com>
Date:   2016-08-10T20:13:57Z

    brooklyn.parameter: accept more basic types

commit 7e92096791bf90da1b6928e031ffb202fbcb6243
Author: Aled Sage <al...@gmail.com>
Date:   2016-08-10T20:15:14Z

    Tidy FixedListMachineProvisioningLocationTset

commit 4f8c9fad6ea72ec73484083e4c58c64a282ff2a0
Author: Aled Sage <al...@gmail.com>
Date:   2016-08-10T20:17:40Z

    Adds SshCommandSensorYamlTest

----


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