brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From neykov <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: Flesh out type creation using the...
Date Thu, 12 Nov 2015 11:40:59 GMT
Github user neykov commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/1017#discussion_r44647701
  
    --- Diff: core/src/test/java/org/apache/brooklyn/core/catalog/internal/SpecParameterInMetaTest.java
---
    @@ -43,18 +49,40 @@
     public class SpecParameterInMetaTest {
         private ManagementContext mgmt;
         private BrooklynCatalog catalog;
    -    private String spec;
    +    private String specId;
     
         @BeforeMethod(alwaysRun=true)
         public void setUp() {
             mgmt = LocalManagementContextForTests.newInstanceWithOsgi();
             catalog = mgmt.getCatalog();
    -        spec = TestToSpecTransformer.registerSpec(EntitySpec.create(BasicEntity.class));
    +        StaticTypePlanTransformer.forceInstall();
    +        PlanToSpecFactory.forceAvailable(TestToSpecTransformer.class, JavaCatalogToSpecTransformer.class);
    +        specId = StaticTypePlanTransformer.registerSpec(EntitySpec.create(BasicEntity.class));
         }
     
    +    @AfterMethod(alwaysRun=true)
    +    public void tearDown() {
    +        StaticTypePlanTransformer.clearForced();
    +        PlanToSpecFactory.clearForced();
    +    }
    +
    +    @Test
    +    public void testCanRetrieveWithNew() {
    +        AbstractBrooklynObjectSpec<?, ?> spec = mgmt.getTypeRegistry().createSpecFromPlan(null,
specId, null, null);
    +        Assert.assertNotNull(spec);
    +    }
    +
    +    // it's not actually added to the catalog; probably it would be cleaner if it is;
    --- End diff --
    
    Being able to create a spec from a plan is different from adding a catalog item so don't
agree, it's a separate thing. The mechanism could be used for application specs as well, it's
not specific to the catalog.
    
    Could add a utility method somewhere to add a catalog item for the registered spec, but
not useful for the following tests.



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