brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aledsage <...@git.apache.org>
Subject [GitHub] brooklyn-server pull request #748: Catalog internal references
Date Wed, 28 Jun 2017 17:02:51 GMT
Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/748#discussion_r124596582
  
    --- Diff: camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ReferencedYamlTest.java
---
    @@ -127,13 +127,63 @@ public void testYamlUrlReferencingCatalog() throws Exception {
             checkChildEntitySpec(app, entityName);
         }
     
    +    @Test
    +    public void testYamlReferencingEarlierItemShortForm() throws Exception {
    +        addCatalogItems(
    +            "brooklyn.catalog:",
    +            "  itemType: entity",
    +            "  items:",
    +            "  - id: yaml.basic",
    +            "    version: " + TEST_VERSION,
    +            "    item:",
    +            "      type: org.apache.brooklyn.entity.stock.BasicEntity",
    +            "  - id: yaml.reference",
    +            "    version: " + TEST_VERSION,
    +            "    item:",
    +            "      type: yaml.basic");
    +
    +        String entityName = "YAML -> catalog item -> yaml url";
    +        Entity app = createAndStartApplication(
    +            "services:",
    +            "- name: " + entityName,
    +            "  type: " + ver("yaml.reference"));
    +        
    +        checkChildEntitySpec(app, entityName);
    +    }
    +    
    +    @Test(groups="WIP") // references to earlier items only work with short form syntax
    +    public void testYamlReferencingEarlierItemLongForm() throws Exception {
    +        addCatalogItems(
    +            "brooklyn.catalog:",
    +            "  itemType: entity",
    +            "  items:",
    +            "  - id: yaml.basic",
    +            "    version: " + TEST_VERSION,
    +            "    item:",
    +            "      services:",
    +            "      - type: org.apache.brooklyn.entity.stock.BasicEntity",
    +            "  - id: yaml.reference",
    +            "    version: " + TEST_VERSION,
    +            "    item:",
    +            "      services:",
    +            "      - type: yaml.basic");
    +
    +        String entityName = "YAML -> catalog item -> yaml url";
    +        Entity app = createAndStartApplication(
    +            "services:",
    +            "- name: " + entityName,
    +            "  type: " + ver("yaml.reference"));
    +        
    +        checkChildEntitySpec(app, entityName);
    +    }
    +
         @Test(groups="WIP") //Not able to use caller provided catalog items when referencing
entity specs (as opposed to catalog meta)
         public void testYamlUrlReferencingCallerCatalogItem() throws Exception {
             addCatalogItems(
                 "brooklyn.catalog:",
                 "  itemType: entity",
    --- End diff --
    
    As above, can we use `itemType: template` here if we're using `services: ...`?


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

Mime
View raw message