You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by sjcorbett <gi...@git.apache.org> on 2016/06/21 09:33:08 UTC

[GitHub] brooklyn-server pull request #209: Test relative entities

GitHub user sjcorbett opened a pull request:

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

    Test relative entities

    Adds an entity for test cases that need to resolve their target from another entity. For example, to make assertions on the child of a group member.

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

    $ git pull https://github.com/sjcorbett/brooklyn-server test-relative-entity

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

    https://github.com/apache/brooklyn-server/pull/209.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 #209
    
----
commit 1ec6aa17d2cb95d22bc6be18b68121506bf679c5
Author: Sam Corbett <sa...@cloudsoftcorp.com>
Date:   2016-06-15T15:47:20Z

    Delete all @author Javadoc from test-framework

commit 01aac6ed2d5fbb18e4c6d9bc39638b4cd20bff77
Author: Sam Corbett <sa...@cloudsoftcorp.com>
Date:   2016-06-20T17:45:50Z

    Add RelativeEntityTestCaseImpl

commit d87837a92ffb81cc45f65bcaf0385b14e88afb5e
Author: Sam Corbett <sa...@cloudsoftcorp.com>
Date:   2016-06-20T17:46:23Z

    LoopOverGroupMembersTestCase checks status of entities before deciding success/failure

----


---
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] brooklyn-server issue #209: Test relative entities

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

    https://github.com/apache/brooklyn-server/pull/209
  
    @sjcorbett LGTM. Can you take a look at @neykov 's comments and see what you think. Please feel free to merge when you're ready.


---
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] brooklyn-server issue #209: Test relative entities

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

    https://github.com/apache/brooklyn-server/pull/209
  
    Thanks @sjcorbett, changes look great.


---
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] brooklyn-server pull request #209: Test relative entities

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

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


---
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] brooklyn-server issue #209: Test relative entities

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

    https://github.com/apache/brooklyn-server/pull/209
  
    I'll merge this now.


---
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] brooklyn-server issue #209: Test relative entities

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

    https://github.com/apache/brooklyn-server/pull/209
  
    @neykov Thank you for your comments. I have removed the `testSpec` config key in favour of children, replaced the use of `Scope` with plain `DslComponents` and reworked the use of `target`. The entity now resolves its `anchor` by checking a new `anchor` config key, `target` or `targetId` (in order), then sets its `target` to the resolved entity, overwriting any previous value. The anchor is published as a sensor.
    
    I will leave extending this to all the test entities for future work.


---
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] brooklyn-server issue #209: Test relative entities

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

    https://github.com/apache/brooklyn-server/pull/209
  
    Great idea. Good to merge.
    Some thoughts I had while reading the code:
    * Do we really need to have a spec of the child test? Could set TARGET_ENTITY on self and let that propagate to children through the inheritance chain. This will allow nesting children using `brooklyn.children`.
    * `target` and `targetId` are reserved in the framework for the actual target. Could rename the config in the test to `ROOT_ENTITY` or `ANCHOR_ENTITY`. This is kind of related to the above, allowing target inheritance.
    * Could pull the functionality up in `TargetableTestComponentImpl`, letting any entity use the scoping.
    
    ---
    
    Spending some more time on it I now see that it's all designed to work together with the looping test case, so the above points are mute.
    
    ---
    
    One final thing. Instead of configuring `DslComponent.Scope` could directly pass `DslComponent` as the configuration and evaluate that against the target. This would allow for more complex queries like `$brooklyn:ancestor("anchor-id").descendant("scoped-id")`.


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