Github user aledsage commented on a diff in the pull request:
https://github.com/apache/brooklyn-server/pull/748#discussion_r124596197
--- 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:",
--- End diff --
We've recommended in the docs
(http://brooklyn.apache.org/v/0.11.0/ops/catalog/) that one should use
`services:` with `itemType: template`, and not with `itemType: entity` (because
the latter only ever has one thing in it).
Can you change this test to use `itemType: template`, or indicate in a
comment at the top that this is testing a discouraged catalog format?
---
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.
---