You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by al...@apache.org on 2016/11/24 09:45:53 UTC
[1/2] brooklyn-server git commit: Adds
ConfigParametersYamlTest.testPortSetAsAttributeOnSoftwareProcess
Repository: brooklyn-server
Updated Branches:
refs/heads/master acd8631eb -> 8cb244236
Adds ConfigParametersYamlTest.testPortSetAsAttributeOnSoftwareProcess
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/240e8f26
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/240e8f26
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/240e8f26
Branch: refs/heads/master
Commit: 240e8f26307a344def74b6d453d9d61faac5319b
Parents: 24fa6fe
Author: Aled Sage <al...@gmail.com>
Authored: Mon Nov 21 17:23:25 2016 +0000
Committer: Aled Sage <al...@gmail.com>
Committed: Mon Nov 21 17:23:25 2016 +0000
----------------------------------------------------------------------
.../camp/brooklyn/ConfigParametersYamlTest.java | 31 ++++++++++++++++++++
1 file changed, 31 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/240e8f26/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ConfigParametersYamlTest.java
----------------------------------------------------------------------
diff --git a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ConfigParametersYamlTest.java b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ConfigParametersYamlTest.java
index 4795d3b..7d6828a 100644
--- a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ConfigParametersYamlTest.java
+++ b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ConfigParametersYamlTest.java
@@ -32,7 +32,10 @@ import org.apache.brooklyn.api.location.PortRange;
import org.apache.brooklyn.config.ConfigKey;
import org.apache.brooklyn.core.config.ConfigKeys;
import org.apache.brooklyn.core.entity.BrooklynConfigKeys;
+import org.apache.brooklyn.core.location.PortRanges;
+import org.apache.brooklyn.core.sensor.Sensors;
import org.apache.brooklyn.core.test.entity.TestEntity;
+import org.apache.brooklyn.entity.software.base.EmptySoftwareProcess;
import org.apache.brooklyn.entity.software.base.VanillaSoftwareProcess;
import org.apache.brooklyn.entity.stock.BasicApplication;
import org.apache.brooklyn.location.ssh.SshMachineLocation;
@@ -583,4 +586,32 @@ public class ConfigParametersYamlTest extends AbstractYamlTest {
Entity child = entity.addChild((EntitySpec<?>)defaultVal);
assertTrue(child instanceof BasicApplication, "child="+child);
}
+
+ @Test
+ public void testPortSetAsAttributeOnSoftwareProcess() throws Exception {
+ addCatalogItems(
+ "brooklyn.catalog:",
+ " itemType: entity",
+ " items:",
+ " - id: entity-with-keys",
+ " item:",
+ " type: "+EmptySoftwareProcess.class.getName(),
+ " brooklyn.parameters:",
+ " - name: my.param.key",
+ " type: port",
+ " default: 1234");
+
+ String yaml = Joiner.on("\n").join(
+ "location:",
+ " localhost:",
+ " " + SshMachineLocation.SSH_TOOL_CLASS.getName() + ": " + RecordingSshTool.class.getName(),
+ "services:",
+ "- type: entity-with-keys");
+
+ Entity app = createStartWaitAndLogApplication(yaml);
+ EmptySoftwareProcess entity = (EmptySoftwareProcess) Iterables.getOnlyElement(app.getChildren());
+
+ assertEquals(entity.config().get(ConfigKeys.newConfigKey(Object.class, "my.param.key")), PortRanges.fromInteger(1234));
+ assertEquals(entity.sensors().get(Sensors.newSensor(Object.class, "my.param.key")), 1234);
+ }
}
[2/2] brooklyn-server git commit: This closes #451
Posted by al...@apache.org.
This closes #451
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/8cb24423
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/8cb24423
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/8cb24423
Branch: refs/heads/master
Commit: 8cb244236dbefb62f0dc2c8cb1ce2744fcd5ddff
Parents: acd8631 240e8f2
Author: Aled Sage <al...@gmail.com>
Authored: Thu Nov 24 09:45:33 2016 +0000
Committer: Aled Sage <al...@gmail.com>
Committed: Thu Nov 24 09:45:33 2016 +0000
----------------------------------------------------------------------
.../camp/brooklyn/ConfigParametersYamlTest.java | 31 ++++++++++++++++++++
1 file changed, 31 insertions(+)
----------------------------------------------------------------------