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 62982200B2F for ; Sun, 3 Jul 2016 09:22:55 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 61227160A6B; Sun, 3 Jul 2016 07:22:55 +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 AB91E160A2C for ; Sun, 3 Jul 2016 09:22:54 +0200 (CEST) Received: (qmail 76928 invoked by uid 500); 3 Jul 2016 07:22:53 -0000 Mailing-List: contact dev-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 dev@brooklyn.apache.org Received: (qmail 76917 invoked by uid 99); 3 Jul 2016 07:22:53 -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; Sun, 03 Jul 2016 07:22:53 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 7CF13E0278; Sun, 3 Jul 2016 07:22:53 +0000 (UTC) From: grkvlt To: dev@brooklyn.apache.org Reply-To: dev@brooklyn.apache.org References: In-Reply-To: Subject: [GitHub] brooklyn-server pull request #229: Merge brooklyn.parameters in YAML files Content-Type: text/plain Message-Id: <20160703072253.7CF13E0278@git1-us-west.apache.org> Date: Sun, 3 Jul 2016 07:22:53 +0000 (UTC) archived-at: Sun, 03 Jul 2016 07:22:55 -0000 Github user grkvlt commented on a diff in the pull request: https://github.com/apache/brooklyn-server/pull/229#discussion_r69386810 --- Diff: camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/SpecParameterUnwrappingTest.java --- @@ -173,17 +173,128 @@ public void testDepentantCatalogsOverrideParameters(Class item = catalog.getCatalogItem(SYMBOLIC_NAME, TEST_VERSION); AbstractBrooklynObjectSpec spec = createSpec(item); - List> inputs = spec.getParameters(); - assertEquals(inputs.size(), 1); - SpecParameter firstInput = inputs.get(0); - assertEquals(firstInput.getLabel(), "override"); + List> params = spec.getParameters(); + assertEquals(params.size(), 2); + assertTrue(Iterables.tryFind(params, nameEqualTo("simple")).isPresent()); + assertTrue(Iterables.tryFind(params, nameEqualTo("override")).isPresent()); + } + + @Test(dataProvider="brooklynTypes") + public void testDependantCatalogMergesParameters(Class type) { + addCatalogItems( + "brooklyn.catalog:", + " version: " + TEST_VERSION, + " items:", + " - id: paramItem", + " item:", + " type: " + type.getName(), + " brooklyn.parameters:", + " - name: simple", + " label: simple", + " - id: " + SYMBOLIC_NAME, + " item:", + " type: paramItem", + " brooklyn.parameters:", + " - name: simple", + " label: override"); + + CatalogItem item = catalog.getCatalogItem(SYMBOLIC_NAME, TEST_VERSION); + AbstractBrooklynObjectSpec spec = createSpec(item); + List> params = spec.getParameters(); + assertEquals(params.size(), 1); + assertTrue(Iterables.tryFind(params, nameEqualTo("simple")).isPresent()); + assertTrue(Iterables.tryFind(params, labelEqualTo("override")).isPresent()); + } + + @Test + public void testDependantCatalogConfigOverridesParameters() { --- End diff -- Note only for entities, as `brooklyn.config` is split into flags and config for policies and locations, so the parameter logic does not allow detection of existing config here. --- 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. ---