Github user neykov commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/446#discussion_r22938021
--- 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 --
:) Well the assert will throw only on null, so the close won't be needed in
this case.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---