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/10/03 12:23:03 UTC

[GitHub] incubator-brooklyn pull request: Promote apps in catalog to Templa...

GitHub user neykov opened a pull request:

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

    Promote apps in catalog to Templates

    When adding CAMP specs to the catalog check if they describe an entity implementing Application and if so use a TEMPLATE instead of ENTITY item.

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

    $ git pull https://github.com/neykov/incubator-brooklyn promote-catalog-templates

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

    https://github.com/apache/incubator-brooklyn/pull/211.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 #211
    
----
commit d0b6fbeef7d0e8169649681182e92d790bbb420a
Author: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Date:   2014-10-01T11:02:52Z

    Move out newClassLoadingContext out of the base API to a helper method.
    
    Solving the following problems:
      * Doesn't need to be a base API, using only publicly available data
      * Wasn't really clear what we get depending on whether called from a CatalogItemDo, CatalogItemDtoAbstract, with null or non-null mgmt argument, due to the recursive nature of the creation.
      * We were getting loads of nested sequential loaders due to the recursive nature of building them.
      * Not possible to create a loader without access to an existing CatalogItem (which is the trigger cause for the changes, preparing the ground for the next commit)

commit 0c6cb9e55673f2d66dd2cec09f483d3cb226e759
Author: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Date:   2014-10-01T11:41:07Z

    Mark the wrapper app when instantiating from CAMP.

commit 8c6ca9c26e81134722a648893dd1ce5c16834f8a
Author: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Date:   2014-10-01T11:44:34Z

    Promote catalog items to TEMPLATE if the root entity is an App.
    
    Creates a spec for the item when adding to the catalog so the app check can be made, which means that addItem behaviour switches from lazy to eager instantiation (though the spec isn't kept long-term atm).

commit 6136d30016ddf18793e4ee5fe2411b8b7e36634b
Author: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Date:   2014-10-01T11:45:02Z

    Misc Locale and Windows test fixes

----


---
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: Promote apps in catalog to Templa...

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/211#discussion_r18638368
  
    --- Diff: core/src/test/java/brooklyn/entity/rebind/transformer/impl/XsltTransformerTest.java ---
    @@ -25,35 +25,37 @@
     import brooklyn.entity.rebind.transformer.impl.XsltTransformer;
     import brooklyn.entity.rebind.transformer.impl.XsltTransformerTest;
     import brooklyn.util.ResourceUtils;
    +import brooklyn.util.os.Os;
     import brooklyn.util.text.TemplateProcessor;
     
     import com.google.common.collect.ImmutableMap;
     
     public class XsltTransformerTest {
    +    private static final String NL = Os.LINE_SEPARATOR;
     
         @Test
         public void testRenameType() throws Exception {
             String xsltTemplate = ResourceUtils.create(XsltTransformerTest.class).getResourceAsString("classpath://brooklyn/entity/rebind/transformer/renameType.xslt");
             String xslt = TemplateProcessor.processTemplateContents(xsltTemplate, ImmutableMap.of("old_val", "mytype.Before", "new_val", "mytype.After"));
             String input = 
    -                "<entity myattrib=\"myval\">"+"\n"+
    -                "  <type myattrib2=\"myval2\">mytype.Before</type>"+"\n"+
    -                "  <nested>"+"\n"+
    -                "    <type myattrib3=\"myval3\">doesNotMatch</type>"+"\n"+
    -                "    <type myattrib4=\"myval4\">partial.mytype.Before</type>"+"\n"+
    -                "    <type myattrib5=\"myval5\">mytype.Before</type>"+"\n"+
    -                "  </nested>"+"\n"+
    -                "  <id>myid</id>"+"\n"+
    +                "<entity myattrib=\"myval\">"+NL+
    --- End diff --
    
    Why do these strings need newline separators? Does the test change if the XML is collapsed?


---
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: Promote apps in catalog to Templa...

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

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


---
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: Promote apps in catalog to Templa...

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

    https://github.com/apache/incubator-brooklyn/pull/211#issuecomment-58493497
  
    Code looks good. Only a couple of minor comments. If you can fix the merge conflicts I'll test and merge.


---
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: Promote apps in catalog to Templa...

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

    https://github.com/apache/incubator-brooklyn/pull/211#issuecomment-58640681
  
    Resolved conflicts and fixed the weird import.


---
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: Promote apps in catalog to Templa...

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/211#discussion_r18638312
  
    --- Diff: core/src/test/java/brooklyn/entity/rebind/RebindCatalogItemTest.java ---
    @@ -39,11 +39,16 @@
     import brooklyn.entity.proxying.EntitySpec;
     import brooklyn.internal.BrooklynFeatureEnablement;
     import brooklyn.management.internal.LocalManagementContext;
    +import brooklyn.policy.basic.AbstractPolicy;
     import brooklyn.test.entity.TestEntity;
     
    +import com.google.api.client.repackaged.com.google.common.base.Throwables;
    --- End diff --
    
    Weird package. Appreciate you've only moved the import.


---
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: Promote apps in catalog to Templa...

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

    https://github.com/apache/incubator-brooklyn/pull/211#issuecomment-58643202
  
    Looks good. Confirmed tests pass and tested in jsgui. The add-to-catalogue bit of the jsgui has an assumption that the added item was an entity. Should fix that, but will 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] incubator-brooklyn pull request: Promote apps in catalog to Templa...

Posted by neykov <gi...@git.apache.org>.
Github user neykov commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/211#discussion_r18698764
  
    --- Diff: core/src/test/java/brooklyn/entity/rebind/transformer/impl/XsltTransformerTest.java ---
    @@ -25,35 +25,37 @@
     import brooklyn.entity.rebind.transformer.impl.XsltTransformer;
     import brooklyn.entity.rebind.transformer.impl.XsltTransformerTest;
     import brooklyn.util.ResourceUtils;
    +import brooklyn.util.os.Os;
     import brooklyn.util.text.TemplateProcessor;
     
     import com.google.common.collect.ImmutableMap;
     
     public class XsltTransformerTest {
    +    private static final String NL = Os.LINE_SEPARATOR;
     
         @Test
         public void testRenameType() throws Exception {
             String xsltTemplate = ResourceUtils.create(XsltTransformerTest.class).getResourceAsString("classpath://brooklyn/entity/rebind/transformer/renameType.xslt");
             String xslt = TemplateProcessor.processTemplateContents(xsltTemplate, ImmutableMap.of("old_val", "mytype.Before", "new_val", "mytype.After"));
             String input = 
    -                "<entity myattrib=\"myval\">"+"\n"+
    -                "  <type myattrib2=\"myval2\">mytype.Before</type>"+"\n"+
    -                "  <nested>"+"\n"+
    -                "    <type myattrib3=\"myval3\">doesNotMatch</type>"+"\n"+
    -                "    <type myattrib4=\"myval4\">partial.mytype.Before</type>"+"\n"+
    -                "    <type myattrib5=\"myval5\">mytype.Before</type>"+"\n"+
    -                "  </nested>"+"\n"+
    -                "  <id>myid</id>"+"\n"+
    +                "<entity myattrib=\"myval\">"+NL+
    --- End diff --
    
    Good point, would've been better to remove the new line. This is already merged with https://github.com/apache/incubator-brooklyn/pull/220 though.
    
    I have extracted the remaining test fixes in https://github.com/apache/incubator-brooklyn/pull/235 (not related to the changes).


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