Github user bostko commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/612#discussion_r108639142
  
    --- Diff: 
camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/spi/dsl/DslYamlTest.java
 ---
    @@ -66,6 +71,63 @@ public void testDslSelf() throws Exception {
         }
     
         @Test
    +    public void testDslSingleTag() throws Exception {
    +        final Entity app = createAndStartApplication(
    +                "services:",
    +                "- type: " + BasicApplication.class.getName(),
    +                "  brooklyn.tags:",
    +                "    - hi");
    +        
assertTrue(getTagsEventually(app).contains(BrooklynTags.newNotesTag("hi")));
    +    }
    +
    +    @Test
    +    public void testDslMultipleTags() throws Exception {
    +        final Entity app = createAndStartApplication(
    +                "services:",
    +                "- type: " + BasicApplication.class.getName(),
    +                "  brooklyn.tags:",
    +                "  - tag1",
    +                "  - tAg2");
    +        
assertTrue(getTagsEventually(app).contains(BrooklynTags.newNotesTag("tag1")));
    +        
assertTrue(getTagsEventually(app).contains(BrooklynTags.newNotesTag("tAg2")));
    +    }
    +
    +    @Test
    +    public void testDslTagsFailNonList() throws Exception {
    +        try {
    +            final Entity app = createAndStartApplication(
    +                    "services:",
    +                    "- type: " + BasicApplication.class.getName(),
    +                    "  brooklyn.tags:",
    +                    "    tag1: true",
    +                    "    tag2: 2");
    +            
assertTrue(getTagsEventually(app).contains(BrooklynTags.newNotesTag("test tag 
1")));
    +            fail("Should throw IllegalArgumentException exception.");
    +        } catch (CompoundRuntimeException e) {
    +            
Asserts.assertStringContainsAtLeastOne(Exceptions.getFirstInteresting(e).getMessage(),"brooklyn.tags
 must be a list, is: ");
    +        }
    +    }
    +
    +    @Test
    +    public void testDslFailObjectTags() throws Exception {
    +        try {
    +            final Entity app = createAndStartApplication(
    +                    "services:",
    +                    "- type: " + BasicApplication.class.getName(),
    +                    "  brooklyn.tags:",
    +                    "  - tag1",
    +                    "  - $brooklyn:object:",
    --- End diff --
    
    I introduced only String tags since normally only types defined in 
`org.apache.brooklyn.core.mgmt.BrooklynTags` are used for tags.


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

Reply via email to