brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aledsage <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: Allows catalog items to be deprec...
Date Wed, 04 Mar 2015 21:20:21 GMT
Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/540#discussion_r25814985
  
    --- Diff: core/src/test/java/brooklyn/entity/rebind/RebindCatalogItemTest.java ---
    @@ -192,6 +194,23 @@ public void testSameCatalogItemIdRemovalAndAdditionRebinds() throws
Exception {
             rebindAndAssertCatalogsAreEqual();
         }
     
    +    @Test
    +    public void testRebindAfterItemDeprecated() {
    +        String yaml =
    +                "name: rebind-yaml-catalog-item-test\n" +
    +                "brooklyn.catalog:\n" +
    +                "  version: " + TEST_VERSION + "\n" +
    +                "services:\n" +
    +                "- type: io.camp.mock:AppServer";
    +        BasicBrooklynCatalog catalog = (BasicBrooklynCatalog) origManagementContext.getCatalog();
    +        CatalogItem<?, ?> catalogItem = catalog.addItem(yaml);
    +        assertNotNull(catalogItem, "catalogItem");
    +        catalogItem.setDeprecated(true);
    --- End diff --
    
    Does this need to also call `catalog.persist(catalogItem)`, after calling `setDeprecated`?
Presumably it works just now because the add + setDeprecated happen in rapid succession, so
the persister writes both changes in one go. If you put a sleep for 2 seconds in between then
I'm betting it would fail.


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