You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by neykov <gi...@git.apache.org> on 2014/08/29 17:42:16 UTC

[GitHub] incubator-brooklyn pull request: Fix BrooklyCatalog.createSpec, wa...

GitHub user neykov opened a pull request:

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

    Fix BrooklyCatalog.createSpec, was creating the spec as if a regular app, not catalog item.

    BrooklynAssemblyTemplateInstantiator.createSpec couldn't realize that the passed in plan was created from a catalog item - it was checking with the wrong id (plan name instead of catalog id). Fix the problem by passing a loader explicitly, making it the caller's responsibility to decide if it is a catalog item plan or a regular plan.

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

    $ git pull https://github.com/neykov/incubator-brooklyn osgi-fix-catalog-createspec

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

    https://github.com/apache/incubator-brooklyn/pull/135.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 #135
    
----
commit b2cc03ac081db664dfddfe1b2ae4acb209da01b0
Author: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Date:   2014-08-29T15:41:01Z

    Fix BrooklyCatalog.createSpec, was creating the spec as if a regular app, not catalog item.
    
    BrooklynAssemblyTemplateInstantiator.createSpec couldn't realize that the passed in plan was created from a catalog item - it was checking with the wrong id (plan name instead of catalog id). Fix the problem by passing a loader explicitly, making it the caller's responsibility to decide if it is a catalog item plan or a regular plan.

----


---
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: Fix BrooklyCatalog.createSpec, wa...

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/135#discussion_r16906425
  
    --- Diff: usage/rest-server/src/test/java/brooklyn/rest/resources/CatalogResourceTest.java ---
    @@ -117,6 +118,33 @@ public void testRegisterCustomEntityWithBundleWhereEntityIsFromCoreAndIconFromBu
       }
     
       @Test
    +  public void testRegisterOSGiPolicy() {
    +    String registeredTypeName = "my.catalog.policy.id";
    +    String policyType = "brooklyn.osgi.tests.SimplePolicy";
    +    String bundleUrl = OsgiStandaloneTest.BROOKLYN_TEST_OSGI_ENTITIES_URL;
    +
    +    String yaml =
    +        "brooklyn.catalog:\n"+
    +        "  id: " + registeredTypeName + "\n"+
    +        "  name: My Catalog App\n"+
    +        "  description: My description\n"+
    +        "  version: 0.1.2\n"+
    +        "  libraries:\n"+
    +        "  - url: " + bundleUrl + "\n"+
    +        "\n"+
    +        "brooklyn.policies:\n"+
    +        "- type: " + policyType;
    +
    +    CatalogPolicySummary entityItem = client().resource("/v1/catalog")
    +        .post(CatalogPolicySummary.class, yaml);
    +
    +    assertEquals(entityItem.getRegisteredType(), registeredTypeName);
    +    Assert.assertNotNull(entityItem.getPlanYaml());
    --- End diff --
    
    Lack of consistency between static import and reference via class. But so trivial I wouldn't worry about changing it.


---
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: Fix BrooklyCatalog.createSpec, wa...

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

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


---
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: Fix BrooklyCatalog.createSpec, wa...

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

    https://github.com/apache/incubator-brooklyn/pull/135#issuecomment-53901638
  
    Looks good. Thanks.


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