Github user sjcorbett commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/1039#discussion_r45248336
--- 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 --
Can you include a test that checks the interfaces of an entity that is
defined in a bundle? You can follow the pattern in
`CatalogOsgiVersionMoreEntityTest` and check for the `MoreEntity` interface.
---
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.
---