Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id CF23E200B36 for ; Wed, 1 Jun 2016 00:12:30 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id CE08B160A44; Tue, 31 May 2016 22:12:30 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 25D46160A46 for ; Wed, 1 Jun 2016 00:12:29 +0200 (CEST) Received: (qmail 19290 invoked by uid 500); 31 May 2016 22:12:29 -0000 Mailing-List: contact commits-help@brooklyn.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@brooklyn.apache.org Delivered-To: mailing list commits@brooklyn.apache.org Received: (qmail 19280 invoked by uid 99); 31 May 2016 22:12:29 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 May 2016 22:12:29 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 03C43DFB74; Tue, 31 May 2016 22:12:29 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: aledsage@apache.org To: commits@brooklyn.apache.org Date: Tue, 31 May 2016 22:12:29 -0000 Message-Id: <1b6cc50b26574fefbaaca90fad82f1a2@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/2] brooklyn-server git commit: Don't inherit "brooklyn.wrapper_app" key in children archived-at: Tue, 31 May 2016 22:12:31 -0000 Repository: brooklyn-server Updated Branches: refs/heads/master f410f809f -> fdf29403a Don't inherit "brooklyn.wrapper_app" key in children Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/629ab108 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/629ab108 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/629ab108 Branch: refs/heads/master Commit: 629ab10872baf4a8dc3f20fa4bd657d747f67fd7 Parents: f410f80 Author: Svetoslav Neykov Authored: Tue May 31 17:30:03 2016 +0300 Committer: Svetoslav Neykov Committed: Tue May 31 17:30:03 2016 +0300 ---------------------------------------------------------------------- .../camp/brooklyn/ApplicationsYamlTest.java | 19 +++++++++++++++++++ .../core/mgmt/EntityManagementUtils.java | 5 ++++- 2 files changed, 23 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/629ab108/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ApplicationsYamlTest.java ---------------------------------------------------------------------- diff --git a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ApplicationsYamlTest.java b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ApplicationsYamlTest.java index 979dadc..7a14f94 100644 --- a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ApplicationsYamlTest.java +++ b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ApplicationsYamlTest.java @@ -232,6 +232,25 @@ public class ApplicationsYamlTest extends AbstractYamlTest { assertDoesNotWrap(app, BasicApplication.class, "catalogServiceLevel"); } + @Test + public void testUnwrappedChildNotTagged() throws Exception { + addCatalogItems( + "brooklyn.catalog:", + " id: simple", + " version: " + TEST_VERSION, + " item:", + " type: " + BasicEntity.class.getName()); + Entity app = createAndStartApplication( + "services:", + "- type: simple:" + TEST_VERSION); + Entity entity = Iterables.getOnlyElement(app.getChildren()); + assertNull(entity.getConfig(EntityManagementUtils.WRAPPER_APP_MARKER)); + // Note that "brooklyn.wrapper_app" will still make it into + // ((EntityInternal) entity).config().getBag().getAllConfigAsConfigKeyMap(); + // so the UI will still show the marker as inherited by the entity. + + } + // FIXME Fails with name "My App 1" rather than the overridden value. // See discussion in https://issues.apache.org/jira/browse/BROOKLYN-248 @Test(groups="WIP") http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/629ab108/core/src/main/java/org/apache/brooklyn/core/mgmt/EntityManagementUtils.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/brooklyn/core/mgmt/EntityManagementUtils.java b/core/src/main/java/org/apache/brooklyn/core/mgmt/EntityManagementUtils.java index d5c31ee..61b5189 100644 --- a/core/src/main/java/org/apache/brooklyn/core/mgmt/EntityManagementUtils.java +++ b/core/src/main/java/org/apache/brooklyn/core/mgmt/EntityManagementUtils.java @@ -32,6 +32,7 @@ import org.apache.brooklyn.api.entity.EntitySpec; import org.apache.brooklyn.api.internal.AbstractBrooklynObjectSpec; import org.apache.brooklyn.api.mgmt.ManagementContext; import org.apache.brooklyn.api.mgmt.Task; +import org.apache.brooklyn.config.ConfigInheritance; import org.apache.brooklyn.config.ConfigKey; import org.apache.brooklyn.core.catalog.internal.BasicBrooklynCatalog; import org.apache.brooklyn.core.config.ConfigKeys; @@ -73,7 +74,9 @@ public class EntityManagementUtils { * it will be unwrapped. * See {@link #newWrapperApp()} and {@link #unwrapApplication(EntitySpec)}. */ - public static final ConfigKey WRAPPER_APP_MARKER = ConfigKeys.newBooleanConfigKey("brooklyn.wrapper_app"); + public static final ConfigKey WRAPPER_APP_MARKER = ConfigKeys.builder(Boolean.class, "brooklyn.wrapper_app") + .inheritance(ConfigInheritance.NONE) + .build(); /** creates an application from the given app spec, managed by the given management context */ public static T createUnstarted(ManagementContext mgmt, EntitySpec spec) {