You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by aledsage <gi...@git.apache.org> on 2017/07/19 10:02:56 UTC

[GitHub] brooklyn-server pull request #767: Adds BrooklynViewerLauncher (for tests)

GitHub user aledsage opened a pull request:

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

    Adds BrooklynViewerLauncher (for tests)

    As per the javadoc:
    ```
    /**
     * A convenience for started the Brooklyn REST api and web-app in a test, so that one can visually
     * inspect the app that the test creates. This is intended as a read-only view (but it has the real
     * management context so one can perform actions through this UI).
     * 
     * It expects to be configured with an existing {@link org.apache.brooklyn.api.mgmt.ManagementContext}.
     * 
     * Various other configuration options (e.g. {@link #application(String)) will be ignored.
     * 
     * An example of where this is very useful is when testing a blueprint where an effector hangs - 
     * one can visually inspect the app, drilling into the activities view to see what it is doing
     * and why it is blocked.
    ```
    
    Note that `AbstractBlueprintTest` used to do this with `BrooklynLauncher`, but that is broken - that launcher also tries to set the `managementPlaneId` on the management context, but it's already set so it throws an exception.
    
    My motivation for fixing + adding this is mostly for use in downstream projects. I want to run unit/integration tests that deploy + test some complicated blueprints. It's very useful to have this visualisation in such tests (particularly if it fails, and one places a breakpoint to see what activities have executed by that point).

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

    $ git pull https://github.com/aledsage/brooklyn-server BrooklynViewerLauncher

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

    https://github.com/apache/brooklyn-server/pull/767.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 #767
    
----
commit 352e9cf2d01cbe859938d1f79a91bee786ca323a
Author: Aled Sage <al...@gmail.com>
Date:   2017-07-19T09:58:30Z

    Adds BrooklynViewerLauncher (for tests)

----


---
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 #767: Adds BrooklynViewerLauncher (for tests)

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

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


---
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 #767: Adds BrooklynViewerLauncher (for tests)

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

    https://github.com/apache/brooklyn-server/pull/767
  
    Looks a lot like `BrooklynJavascriptGuiLauncher`, but otherwise 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] brooklyn-server issue #767: Adds BrooklynViewerLauncher (for tests)

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

    https://github.com/apache/brooklyn-server/pull/767
  
    +1, merging.


---
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 #767: Adds BrooklynViewerLauncher (for tests)

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

    https://github.com/apache/brooklyn-server/pull/767
  
    @neykov good point about `BrooklynJavascriptGuiLauncher` (and the `BrooklynRestApiLauncher` that it delegates to). I'd forgotten about those.
    
    The existing `BrooklynJavascriptGuiLauncher` is only used in a couple of simple tests (in `BrooklynJavascriptGuiLauncherTest`). It is not configurable to inject a management context, which is what I want to do (obviously we could add that if we chose).
    
    The `BrooklynRestApiLauncher` can be configured with a management context but does not include the UI. There is a surprisingly large amount of code in that class! I presume it's duplicating what is in `BrooklynLauncher`. I therefore much prefer my approach of just extending `BrooklynLauncher`, overriding `start()`.
    
    At some point we could try re-writing `BrooklynRestApiLauncher` to extend `BrooklynLauncher`, but just now I don't want to risk accidentally breaking all the rest-api tests that use `BrooklynRestApiLauncher`. I suggest we come back to that in another PR in the future.
    
    @neykov are you ok with merging this as-is?


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