brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sjcorbett <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: Adds support for interfaces tag o...
Date Wed, 18 Nov 2015 19:35:55 GMT
Github user sjcorbett commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/1039#discussion_r45248389
  
    --- Diff: usage/camp/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlEntityTest.java
---
    @@ -800,6 +803,49 @@ public void testHardcodedCatalog() throws Exception {
                     "- type: web-app-cluster");
         }
     
    +    @Test
    +    public void testAddCatalogItemCreatesInterfacesTag() throws Exception {
    +        String symbolicName = "my.catalog.app.id.load";
    +        addCatalogItems(
    +                "brooklyn.catalog:",
    +                "  id: " + symbolicName,
    +                "  version: " + TEST_VERSION,
    +                "  item:",
    +                "    type: "+ BasicEntity.class.getName());
    +
    +        CatalogItem catalogItem = mgmt().getCatalog().getCatalogItem(symbolicName, TEST_VERSION);
    +
    +        assertEquals(catalogItem.tags().getTags().size(), 1);
    +        for (Object tag : catalogItem.tags().getTags()) {
    +            assertTrue(tag instanceof BrooklynTags.InterfacesTag);
    +            assertEquals(((BrooklynTags.InterfacesTag) tag).getInterfaces(), ClassUtils.getAllInterfaces(BasicEntity.class));
    +        }
    +
    +        deleteCatalogEntity(symbolicName);
    +    }
    +
    +    @Test
    +    public void testAddCatalogServiceCreatesInterfacesTag() throws Exception {
    +        String symbolicName = "my.catalog.app.id.load";
    +        addCatalogItems(
    +                "brooklyn.catalog:",
    +                "  id: " + symbolicName,
    +                "  version: " + TEST_VERSION,
    +                "",
    +                "services:",
    +                "- type: "+ BasicEntity.class.getName());
    +
    +        CatalogItem catalogItem = mgmt().getCatalog().getCatalogItem(symbolicName, TEST_VERSION);
    +
    +        assertEquals(catalogItem.tags().getTags().size(), 1);
    +        for (Object tag : catalogItem.tags().getTags()) {
    +            assertTrue(tag instanceof BrooklynTags.InterfacesTag);
    +            assertEquals(((BrooklynTags.InterfacesTag) tag).getInterfaces(), ClassUtils.getAllInterfaces(BasicEntity.class));
    +        }
    +
    +        deleteCatalogEntity(symbolicName);
    +    }
    +
    --- End diff --
    
    MoreEntity: https://github.com/apache/incubator-brooklyn/blob/master/utils/rt-osgi/src/test/dependencies/osgi/more-entities-v2/src/main/java/org/apache/brooklyn/test/osgi/entities/more/MoreEntity.java


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