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: Load resources from entities' cat...
Date Wed, 14 Jan 2015 14:04:03 GMT
Github user sjcorbett commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/446#discussion_r22937483
  
    --- Diff: usage/camp/src/test/java/io/brooklyn/camp/brooklyn/catalog/CatalogYamlEntityTest.java
---
    @@ -362,6 +364,20 @@ public void testCreateSpecFromCatalogItem() {
             Object spec = catalog.createSpec(item);
             Assert.assertNotNull(spec);
         }
    +    
    +    @Test
    +    public void testLoadResourceFromBundle() throws Exception {
    +        String id = "resource.test";
    +        addCatalogOSGiEntity(id, SIMPLE_ENTITY_TYPE);
    +        String yaml =
    +                "services: \n" +
    +                "  - serviceType: "+ver(id);
    +        Entity app = createAndStartApplication(yaml);
    +        Entity simpleEntity = Iterables.getOnlyElement(app.getChildren());
    +        InputStream icon = new ResourceUtils(simpleEntity).getResourceFromUrl("classpath:/brooklyn/osgi/tests/icon.gif");
    +        assertTrue(icon != null);
    +        icon.close();
    --- End diff --
    
    Close in a finally block?


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