Location inheritance: test removing values with nulls Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/7a7f7592 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/7a7f7592 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/7a7f7592
Branch: refs/heads/master Commit: 7a7f75925fbca513816bc77685ad82b6915b9322 Parents: e4e6004 Author: Aled Sage <[email protected]> Authored: Thu Jun 2 12:24:03 2016 +0100 Committer: Aled Sage <[email protected]> Committed: Mon Jun 6 15:10:09 2016 +0100 ---------------------------------------------------------------------- .../ConfigLocationInheritanceYamlTest.java | 24 ++++++++++++++++++++ 1 file changed, 24 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/7a7f7592/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ConfigLocationInheritanceYamlTest.java ---------------------------------------------------------------------- diff --git a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ConfigLocationInheritanceYamlTest.java b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ConfigLocationInheritanceYamlTest.java index a23b727..0a40275 100644 --- a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ConfigLocationInheritanceYamlTest.java +++ b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ConfigLocationInheritanceYamlTest.java @@ -40,6 +40,7 @@ import org.apache.brooklyn.location.jclouds.JcloudsLocationConfig; import org.apache.brooklyn.location.jclouds.JcloudsLocationResolver; import org.apache.brooklyn.location.jclouds.StubbedComputeServiceRegistry; import org.apache.brooklyn.location.jclouds.StubbedComputeServiceRegistry.SingleNodeCreator; +import org.apache.brooklyn.util.collections.MutableMap; import org.apache.brooklyn.util.core.config.ConfigBag; import org.apache.brooklyn.util.core.internal.ssh.RecordingSshTool; import org.jclouds.compute.ComputeService; @@ -230,6 +231,29 @@ public class ConfigLocationInheritanceYamlTest extends AbstractYamlTest { } @Test(groups="Live") + public void testRemoveLocationPropertiesByOverridingWithBlank() throws Exception { + String yaml = Joiner.on("\n").join( + "location: jclouds-config-test-with-conf", + "services:", + "- type: org.apache.brooklyn.entity.software.base.EmptySoftwareProcess", + " brooklyn.config:", + " provisioning.properties:", + " minRam: ", + " minCores: 2", + " templateOptions:", + " networks: ", + " subnetId: mysubnet"); + + Entity app = createStartWaitAndLogApplication(new StringReader(yaml)); + Entity entity = Iterables.getOnlyElement(app.getChildren()); + + assertMachineConfig( + Machines.findUniqueMachineLocation(entity.getLocations()).get(), + MutableMap.of(JcloudsLocationConfig.MIN_RAM, null, JcloudsLocationConfig.MIN_CORES, 2), + MutableMap.of("networks", null, "subnetId", "mysubnet")); + } + + @Test(groups="Live") public void testMergeTemplateOptionsIsShallow() throws Exception { addCatalogItems( "brooklyn.catalog:",
