[01/15] incubator-brooklyn git commit: TestCase no longer extends BaseTest, but rather extends Entity directly. Added check in TestCaseImpl to ensure that only non-started children are startable. Adde
Repository: incubator-brooklyn Updated Branches: refs/heads/master d58d5035f -> 4ed9e97a8 TestCase no longer extends BaseTest, but rather extends Entity directly. Added check in TestCaseImpl to ensure that only non-started children are startable. Added InfrastructureDeploymentTestCase Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/2b40644d Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/2b40644d Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/2b40644d Branch: refs/heads/master Commit: 2b40644d83601773d368d4416bd5fb938e673f5a Parents: aeb56fd Author: Graeme-MillerAuthored: Fri Dec 4 19:32:28 2015 + Committer: Graeme-Miller Committed: Mon Dec 7 13:41:39 2015 + -- .../InfrastructureDeploymentTestCase.java | 54 +++ .../InfrastructureDeploymentTestCaseImpl.java | 57 .../brooklyn/test/framework/TestCase.java | 4 +- .../brooklyn/test/framework/TestCaseImpl.java | 19 +-- 4 files changed, 128 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/2b40644d/usage/test-framework/src/main/java/org/apache/brooklyn/test/framework/InfrastructureDeploymentTestCase.java -- diff --git a/usage/test-framework/src/main/java/org/apache/brooklyn/test/framework/InfrastructureDeploymentTestCase.java b/usage/test-framework/src/main/java/org/apache/brooklyn/test/framework/InfrastructureDeploymentTestCase.java new file mode 100644 index 000..5f368df --- /dev/null +++ b/usage/test-framework/src/main/java/org/apache/brooklyn/test/framework/InfrastructureDeploymentTestCase.java @@ -0,0 +1,54 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.brooklyn.test.framework; + +import com.google.common.reflect.TypeToken; +import org.apache.brooklyn.api.entity.EntitySpec; +import org.apache.brooklyn.api.entity.ImplementedBy; +import org.apache.brooklyn.config.ConfigKey; +import org.apache.brooklyn.core.config.ConfigKeys; +import org.apache.brooklyn.core.entity.StartableApplication; +import org.apache.brooklyn.entity.software.base.SoftwareProcess; + +/** + * Created by graememiller on 04/12/2015. + */ +@ImplementedBy(value = InfrastructureDeploymentTestCaseImpl.class) +public interface InfrastructureDeploymentTestCase extends TestCase { + +/** + * Entity spec to deploy. This will be deployed second, after the INFRASTRUCTURE_SPEC has been deployed. This will be deployed to the DEPLOYMENT_LOCATION. + * All children will be deployed after this + */ +ConfigKey ENTITY_SPEC_TO_DEPLOY = ConfigKeys.newConfigKey(new TypeToken (){}, "infrastructure.deployment.entity.spec", "Entity spec to deploy to infrastructure"); + + +/** + * Infrastructure to deploy. This will be deployed first, then the ENTITY_SPEC_TO_DEPLOY will be deployed, then any children + */ +ConfigKey INFRASTRUCTURE_SPEC = ConfigKeys.newConfigKey(new TypeToken (){}, "infrastructure.deployment.spec", "Infrastructure to deploy"); + + +/** + * The The location to deploy ENTITY_SPEC_TO_DEPLOY. + */ +ConfigKey DEPLOYMENT_LOCATION_SENSOR_NAME = ConfigKeys.newStringConfigKey("infrastructure.deployment.location.sensor", "Name of the sensor of INFRASTRUCTURE_SPEC to retrieve the Location to deploy the entity to"); + + +} http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/2b40644d/usage/test-framework/src/main/java/org/apache/brooklyn/test/framework/InfrastructureDeploymentTestCaseImpl.java -- diff --git a/usage/test-framework/src/main/java/org/apache/brooklyn/test/framework/InfrastructureDeploymentTestCaseImpl.java
[13/15] incubator-brooklyn git commit: This closes #1091
This closes #1091 Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/a218cd98 Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/a218cd98 Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/a218cd98 Branch: refs/heads/master Commit: a218cd98ae88f8d1732fd85892a1178cd7fdbdbb Parents: 3b99c6f 2b40644 Author: Sam CorbettAuthored: Fri Dec 11 12:38:27 2015 + Committer: Sam Corbett Committed: Fri Dec 11 12:38:27 2015 + -- .../InfrastructureDeploymentTestCase.java | 54 +++ .../InfrastructureDeploymentTestCaseImpl.java | 57 .../brooklyn/test/framework/TestCase.java | 4 +- .../brooklyn/test/framework/TestCaseImpl.java | 19 +-- 4 files changed, 128 insertions(+), 6 deletions(-) --
[07/15] incubator-brooklyn git commit: Atomic sensor test-and-set.
Atomic sensor test-and-set. Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/c2088db6 Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/c2088db6 Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/c2088db6 Branch: refs/heads/master Commit: c2088db62faf1e0f9e3a34b5b03a540a9a88268f Parents: 6fcc0e6 Author: Alasdair HodgeAuthored: Wed Dec 9 11:22:47 2015 + Committer: Alasdair Hodge Committed: Wed Dec 9 12:57:54 2015 + -- .../org/apache/brooklyn/entity/database/mysql/MySqlNodeImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c2088db6/software/database/src/main/java/org/apache/brooklyn/entity/database/mysql/MySqlNodeImpl.java -- diff --git a/software/database/src/main/java/org/apache/brooklyn/entity/database/mysql/MySqlNodeImpl.java b/software/database/src/main/java/org/apache/brooklyn/entity/database/mysql/MySqlNodeImpl.java index f470390..e2b0c2e 100644 --- a/software/database/src/main/java/org/apache/brooklyn/entity/database/mysql/MySqlNodeImpl.java +++ b/software/database/src/main/java/org/apache/brooklyn/entity/database/mysql/MySqlNodeImpl.java @@ -135,8 +135,8 @@ public class MySqlNodeImpl extends SoftwareProcessImpl implements MySqlNode { public int getPort() { return getAttribute(MYSQL_PORT); } - -public String getSocketUid() { + +public synchronized String getSocketUid() { String result = getAttribute(MySqlNode.SOCKET_UID); if (Strings.isBlank(result)) { result = Identifiers.makeRandomId(6);
[06/15] incubator-brooklyn git commit: Derive correct URL path for specified version.
Derive correct URL path for specified version. Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/3e639874 Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/3e639874 Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/3e639874 Branch: refs/heads/master Commit: 3e6398740489bd67cc3901d9892eff799a2690d6 Parents: c2088db Author: Alasdair HodgeAuthored: Wed Dec 9 12:57:11 2015 + Committer: Alasdair Hodge Committed: Wed Dec 9 12:57:54 2015 + -- .../org/apache/brooklyn/entity/database/mysql/MySqlNode.java| 2 +- .../apache/brooklyn/entity/database/mysql/MySqlSshDriver.java | 5 + 2 files changed, 6 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/3e639874/software/database/src/main/java/org/apache/brooklyn/entity/database/mysql/MySqlNode.java -- diff --git a/software/database/src/main/java/org/apache/brooklyn/entity/database/mysql/MySqlNode.java b/software/database/src/main/java/org/apache/brooklyn/entity/database/mysql/MySqlNode.java index 7f9e508..6306956 100644 --- a/software/database/src/main/java/org/apache/brooklyn/entity/database/mysql/MySqlNode.java +++ b/software/database/src/main/java/org/apache/brooklyn/entity/database/mysql/MySqlNode.java @@ -50,7 +50,7 @@ public interface MySqlNode extends SoftwareProcess, HasShortName, DatastoreCommo //http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.26-linux-glibc2.5-x86_64.tar.gz @SetFromFlag("downloadUrl") BasicAttributeSensorAndConfigKey DOWNLOAD_URL = new StringAttributeSensorAndConfigKey( -Attributes.DOWNLOAD_URL, "http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-${version}-${driver.osTag}.tar.gz;); +Attributes.DOWNLOAD_URL, "http://dev.mysql.com/get/Downloads/MySQL-${driver.majorVersion}/mysql-${version}-${driver.osTag}.tar.gz;); @SetFromFlag("port") PortAttributeSensorAndConfigKey MYSQL_PORT = new PortAttributeSensorAndConfigKey("mysql.port", "MySQL port", PortRanges.fromString("3306, 13306+")); http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/3e639874/software/database/src/main/java/org/apache/brooklyn/entity/database/mysql/MySqlSshDriver.java -- diff --git a/software/database/src/main/java/org/apache/brooklyn/entity/database/mysql/MySqlSshDriver.java b/software/database/src/main/java/org/apache/brooklyn/entity/database/mysql/MySqlSshDriver.java index 7b38cbd..868d158 100644 --- a/software/database/src/main/java/org/apache/brooklyn/entity/database/mysql/MySqlSshDriver.java +++ b/software/database/src/main/java/org/apache/brooklyn/entity/database/mysql/MySqlSshDriver.java @@ -111,6 +111,11 @@ public class MySqlSshDriver extends AbstractSoftwareProcessSshDriver implements return "mymysql.cnf"; } +// Only invoked to determine the default download URL form the specified version. +public String getMajorVersion() { +return getEntity().config().get(MySqlNode.SUGGESTED_VERSION).replaceAll("(\\d+\\.\\d+)\\.\\d+", "$1"); +} + public String getDefaultUnpackedDirectoryName() { return Strings.removeAllFromEnd(resolver.getFilename(), ".tar.gz"); }
[10/15] incubator-brooklyn git commit: This closes #1100
This closes #1100 Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/c03827e7 Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/c03827e7 Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/c03827e7 Branch: refs/heads/master Commit: c03827e71cbfedc11d595e62a3170ecafd68326c Parents: d58d503 812c5bd Author: Sam CorbettAuthored: Fri Dec 11 12:33:54 2015 + Committer: Sam Corbett Committed: Fri Dec 11 12:33:54 2015 + -- usage/rest-api/pom.xml | 46 +++-- 1 file changed, 44 insertions(+), 2 deletions(-) --
[12/15] incubator-brooklyn git commit: This closes #1095
This closes #1095 Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/3b99c6f6 Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/3b99c6f6 Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/3b99c6f6 Branch: refs/heads/master Commit: 3b99c6f6d63347aa6717a99e0ac8fa9b88af3ca5 Parents: 7dfe959 ecb8976 Author: Sam CorbettAuthored: Fri Dec 11 12:37:48 2015 + Committer: Sam Corbett Committed: Fri Dec 11 12:37:48 2015 + -- docs/website/download/index.md | 8 1 file changed, 4 insertions(+), 4 deletions(-) --
[2/6] incubator-brooklyn git commit: releasePortForwarding now uses Task F/W to invoke portForwarder.closePortForwarding
releasePortForwarding now uses Task F/W to invoke portForwarder.closePortForwarding Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/2c194d10 Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/2c194d10 Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/2c194d10 Branch: refs/heads/master Commit: 2c194d1078d21053127b3a4e077853d1eb467d48 Parents: 4ed9e97 Author: Mark McKennaAuthored: Wed Dec 2 16:06:21 2015 + Committer: Mark McKenna Committed: Fri Dec 11 15:49:12 2015 + -- .../location/jclouds/JcloudsLocation.java | 53 ++-- 1 file changed, 39 insertions(+), 14 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/2c194d10/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java -- diff --git a/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java b/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java index 8a666c6..2f08af8 100644 --- a/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java +++ b/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java @@ -57,6 +57,8 @@ import org.apache.brooklyn.api.location.MachineManagementMixins; import org.apache.brooklyn.api.location.NoMachinesAvailableException; import org.apache.brooklyn.api.location.PortRange; import org.apache.brooklyn.api.mgmt.AccessController; +import org.apache.brooklyn.api.mgmt.Task; +import org.apache.brooklyn.api.mgmt.TaskAdaptable; import org.apache.brooklyn.config.ConfigKey; import org.apache.brooklyn.config.ConfigKey.HasConfigKey; import org.apache.brooklyn.core.config.ConfigUtils; @@ -96,6 +98,9 @@ import org.apache.brooklyn.util.core.internal.ssh.ShellTool; import org.apache.brooklyn.util.core.internal.ssh.SshTool; import org.apache.brooklyn.util.core.internal.winrm.WinRmTool; import org.apache.brooklyn.util.core.internal.winrm.WinRmToolResponse; +import org.apache.brooklyn.util.core.task.DynamicTasks; +import org.apache.brooklyn.util.core.task.TaskBuilder; +import org.apache.brooklyn.util.core.task.Tasks; import org.apache.brooklyn.util.core.text.TemplateProcessor; import org.apache.brooklyn.util.exceptions.CompoundRuntimeException; import org.apache.brooklyn.util.exceptions.Exceptions; @@ -2437,13 +2442,13 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation im } } -protected void releasePortForwarding(SshMachineLocation machine) { +protected void releasePortForwarding(final SshMachineLocation machine) { // TODO Implementation needs revisisted. It relies on deprecated PortForwardManager methods. boolean usePortForwarding = Boolean.TRUE.equals(machine.getConfig(USE_PORT_FORWARDING)); -JcloudsPortForwarderExtension portForwarder = machine.getConfig(PORT_FORWARDER); +final JcloudsPortForwarderExtension portForwarder = machine.getConfig(PORT_FORWARDER); PortForwardManager portForwardManager = machine.getConfig(PORT_FORWARDING_MANAGER); -NodeMetadata node = (machine instanceof JcloudsSshMachineLocation) ? ((JcloudsSshMachineLocation) machine).getNode() : null; +final NodeMetadata node = (machine instanceof JcloudsSshMachineLocation) ? ((JcloudsSshMachineLocation) machine).getNode() : null; if (portForwarder == null) { LOG.debug("No port-forwarding to close (because portForwarder null) on release of " + machine); @@ -2467,15 +2472,35 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation im mappings = ImmutableSet.of(); } -for (PortMapping mapping : mappings) { -HostAndPort publicEndpoint = mapping.getPublicEndpoint(); -int targetPort = mapping.getPrivatePort(); -Protocol protocol = Protocol.TCP; +final TaskBuilder builder = TaskBuilder.builder() +.parallel(true) +.displayName("close port-forwarding at "+machine); + +for (final PortMapping mapping : mappings) { +final HostAndPort publicEndpoint = mapping.getPublicEndpoint(); +final int targetPort = mapping.getPrivatePort(); +final Protocol protocol = Protocol.TCP; if (publicEndpoint != null) { -LOG.debug("Closing port-forwarding at {} for machine {}: {}->{}", new Object[] {this, machine, publicEndpoint, targetPort}); -
[2/2] incubator-brooklyn git commit: This closes #1101
This closes #1101 Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/e6235d9b Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/e6235d9b Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/e6235d9b Branch: refs/heads/master Commit: e6235d9bcfce0829e3160302a568422c1429c5ae Parents: b97370b a4de743 Author: Sam CorbettAuthored: Tue Dec 15 15:14:51 2015 + Committer: Sam Corbett Committed: Tue Dec 15 15:14:51 2015 + -- .../JcloudsLocationSecurityGroupCustomizer.java | 103 --- ...oudsLocationSecurityGroupCustomizerTest.java | 55 ++ 2 files changed, 141 insertions(+), 17 deletions(-) --
[1/2] incubator-brooklyn git commit: Ported some Clocker changes back to brooklyn. It is now possible to remove security groups permissions Also added some error handling to JcloudsLocationSecurityGro
Repository: incubator-brooklyn Updated Branches: refs/heads/master b97370b14 -> e6235d9bc Ported some Clocker changes back to brooklyn. It is now possible to remove security groups permissions Also added some error handling to JcloudsLocationSecurityGroupCustomizer Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/a4de7439 Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/a4de7439 Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/a4de7439 Branch: refs/heads/master Commit: a4de7439b51ff5b98340c4ecf39c78934b930b77 Parents: b39ef3a Author: Graeme-MillerAuthored: Thu Dec 10 15:37:01 2015 + Committer: Graeme-Miller Committed: Tue Dec 15 11:32:03 2015 + -- .../JcloudsLocationSecurityGroupCustomizer.java | 103 --- ...oudsLocationSecurityGroupCustomizerTest.java | 55 ++ 2 files changed, 141 insertions(+), 17 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/a4de7439/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/networking/JcloudsLocationSecurityGroupCustomizer.java -- diff --git a/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/networking/JcloudsLocationSecurityGroupCustomizer.java b/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/networking/JcloudsLocationSecurityGroupCustomizer.java index 8ab6c16..3d6bc22 100644 --- a/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/networking/JcloudsLocationSecurityGroupCustomizer.java +++ b/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/networking/JcloudsLocationSecurityGroupCustomizer.java @@ -72,6 +72,7 @@ import com.google.common.collect.FluentIterable; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; +import com.google.common.util.concurrent.UncheckedExecutionException; /** * Configures custom security groups on Jclouds locations. @@ -179,6 +180,33 @@ public class JcloudsLocationSecurityGroupCustomizer extends BasicJcloudsLocation return this; } +private SecurityGroup getSecurityGroup(final String nodeId, final SecurityGroupExtension securityApi, final String locationId) { +// Expect to have two security groups on the node: one shared between all nodes in the location, +// that is cached in sharedGroupCache, and one created by Jclouds that is unique to the node. +// Relies on customize having been called before. This should be safe because the arguments +// needed to call this method are not available until post-instance creation. +SecurityGroup machineUniqueSecurityGroup; +Tasks.setBlockingDetails("Loading unique security group for node: " + nodeId); +try { +machineUniqueSecurityGroup = uniqueGroupCache.get(nodeId, new Callable() { +@Override public SecurityGroup call() throws Exception { +SecurityGroup sg = getUniqueSecurityGroupForNodeCachingSharedGroupIfPreviouslyUnknown(nodeId, locationId, securityApi); +if (sg == null) { +throw new IllegalStateException("Failed to find machine-unique group on node: " + nodeId); +} +return sg; +} +}); +} catch (UncheckedExecutionException e) { +throw Throwables.propagate(new Exception(e.getCause())); +} catch (ExecutionException e) { +throw Throwables.propagate(new Exception(e.getCause())); +} finally { +Tasks.resetBlockingDetails(); +} +return machineUniqueSecurityGroup; +} + /** * Applies the given security group permissions to the given location. * @@ -201,6 +229,47 @@ public class JcloudsLocationSecurityGroupCustomizer extends BasicJcloudsLocation return this; } } +/** + * Removes the given security group permissions from the given node with the given compute service. + * + * Takes no action if the compute service does not have a security group extension. + * @param permissions The set of permissions to be removed from the location + * @param location Location to remove permissions from + */ +public void removePermissionsFromLocation(final JcloudsMachineLocation location, final Iterable permissions) { +synchronized (JcloudsLocationSecurityGroupCustomizer.class) { +ComputeService computeService =
[1/2] incubator-brooklyn git commit: Fix docs typo
Repository: incubator-brooklyn Updated Branches: refs/heads/master 286448623 -> dff30144d Fix docs typo Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/e4fa88ad Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/e4fa88ad Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/e4fa88ad Branch: refs/heads/master Commit: e4fa88adbac7dc9aa531bb65dbb70b3d3a7f274e Parents: 2864486 Author: SvetAuthored: Wed Jan 6 15:57:17 2016 +0200 Committer: Svet Committed: Wed Jan 6 15:57:17 2016 +0200 -- brooklyn-docs/guide/ops/persistence/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/e4fa88ad/brooklyn-docs/guide/ops/persistence/index.md -- diff --git a/brooklyn-docs/guide/ops/persistence/index.md b/brooklyn-docs/guide/ops/persistence/index.md index 4788db9..02c05ff 100644 --- a/brooklyn-docs/guide/ops/persistence/index.md +++ b/brooklyn-docs/guide/ops/persistence/index.md @@ -104,7 +104,7 @@ providers, see [jclouds](http://jclouds.apache.org/reference/providers/#blobstor To configure the Object Store, add the credentials to `~/.brooklyn/brooklyn.properties` such as: {% highlight properties %} -brooklyn.location.named.aws-s3-eu-west-1:aws-s3:eu-west-1 +brooklyn.location.named.aws-s3-eu-west-1=aws-s3:eu-west-1 brooklyn.location.named.aws-s3-eu-west-1.identity=ABCDEFGHIJKLMNOPQRSTU brooklyn.location.named.aws-s3-eu-west-1.credential=abcdefghijklmnopqrstuvwxyz1234567890ab/c {% endhighlight %}
[2/2] incubator-brooklyn git commit: This closes #1129
This closes #1129 Fix getRequiredOpenPorts in SameServerDriverLifecycleEffectorTasks Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/e300cf33 Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/e300cf33 Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/e300cf33 Branch: refs/heads/master Commit: e300cf33c2ba508388c8d41047af8cda74e55839 Parents: dff3014 ddd55b1 Author: Sam CorbettAuthored: Thu Jan 7 15:36:30 2016 + Committer: Sam Corbett Committed: Thu Jan 7 15:36:30 2016 + -- .../SameServerDriverLifecycleEffectorTasks.java | 26 +++ ...eServerDriverLifecycleEffectorTasksTest.java | 72 2 files changed, 82 insertions(+), 16 deletions(-) --
[06/10] incubator-brooklyn git commit: Updated to remove catalog related remarks.
Updated to remove catalog related remarks. Maybe restore this when we update the catalog pages with the new registry commands. Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/d91d700d Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/d91d700d Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/d91d700d Branch: refs/heads/master Commit: d91d700dad85453b738b4800e3d2d100bf7ad6c6 Parents: cb76968 Author: Geoff MacartneyAuthored: Wed Dec 23 17:13:24 2015 + Committer: Geoff Macartney Committed: Wed Dec 23 17:13:24 2015 + -- brooklyn-docs/guide/start/blueprints.md | 10 -- 1 file changed, 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d91d700d/brooklyn-docs/guide/start/blueprints.md -- diff --git a/brooklyn-docs/guide/start/blueprints.md b/brooklyn-docs/guide/start/blueprints.md index 98eb88e..1552125 100644 --- a/brooklyn-docs/guide/start/blueprints.md +++ b/brooklyn-docs/guide/start/blueprints.md @@ -4,7 +4,6 @@ layout: website-normal menu_parent: index.md children: - { section: Launching from a Blueprint, title: Blueprint } -- { section: Launching from the Catalog, title: Catalog } --- @@ -82,15 +81,6 @@ Status: In progress Depending on your choice of location it may take some time for the application to start, the next page describes how you can monitor the progress of the application deployment and verify its successful deployment. - -## Launching from the Catalog -Instead of pasting the YAML blueprint each time, it can be added to Brooklyns Catalog where it will be accessible -for use in any blueprint that you want to deploy. - -See __[Catalog](../ops/catalog/)__ in the Operations section of the User Guide for instructions on creating a new -Catalog entry from your Blueprint YAML. - - ## Next Having deployed an application, the next step is **[monitoring and managing](managing.html)** it. \ No newline at end of file
[02/10] incubator-brooklyn git commit: Policy updates.
Policy updates. Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/5262d476 Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/5262d476 Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/5262d476 Branch: refs/heads/master Commit: 5262d476090bc6d1575278ab225999629b8ce294 Parents: 36e2f14 Author: Geoff MacartneyAuthored: Thu Dec 17 17:27:12 2015 + Committer: Geoff Macartney Committed: Wed Dec 23 12:24:56 2015 + -- docs/guide/start/managing-cli.md | 6 +++ docs/guide/start/policies-cli.md | 91 +++ 2 files changed, 67 insertions(+), 30 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/5262d476/docs/guide/start/managing-cli.md -- diff --git a/docs/guide/start/managing-cli.md b/docs/guide/start/managing-cli.md index 721c2c9..fba463c 100644 --- a/docs/guide/start/managing-cli.md +++ b/docs/guide/start/managing-cli.md @@ -108,6 +108,12 @@ onbox.base.dir.resolved true install.unique_label TomcatServer_7.0.65 {% endhighlight %} +If an entity name is annoyingly long to type, the entity can be renamed: + +{% highlight bash %} +$ br app Tomcat entity TomcatServer:Wx7r rename server +{% endhighlight %} + ## Sensors "Sensors" on entities provide a real-time picture of the status and operation of an entity of the application. http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/5262d476/docs/guide/start/policies-cli.md -- diff --git a/docs/guide/start/policies-cli.md b/docs/guide/start/policies-cli.md index 2839bba..d5f1df4 100644 --- a/docs/guide/start/policies-cli.md +++ b/docs/guide/start/policies-cli.md @@ -24,11 +24,14 @@ You will need at least five machines for this example, one for the DB, and four (but you can reduce this by changing the "maxPoolSize" below. {% highlight yaml %} -name: java-cluster-db-policy-example +name: cluster + +location: + tbd + services: - serviceType: brooklyn.entity.webapp.ControlledDynamicWebAppCluster - name: My Web with Policy - location: localhost + name: webcluster brooklyn.config: wars.root: http://search.maven.org/remotecontent?filepath=io/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.6.0-M2/brooklyn-example-hello-world-sql-webapp-0.6.0-M2.war http.port: 9280+ @@ -47,14 +50,13 @@ services: - serviceType: brooklyn.entity.database.mysql.MySqlNode id: db - name: My DB + name: mysql location: localhost brooklyn.config: -# this also uses the flag rather than the config key creationScriptUrl: https://bit.ly/brooklyn-visitors-creation-script {% endhighlight %} -Explore this app using the 'bk list application' and other commands from the previous section. +Explore this app using the 'application' and other commands from the previous section. ## Configuring Dependencies The App above illustrates how one component in a blueprint can be configured with information relating to one of the other @@ -73,8 +75,46 @@ allows expressions referring to Brooklyn's management information to be embedded The app server cluster has an `AutoScalerPolicy`and the loadbalancer has a `Controller targets tracker` policy. -Use the Applications tab in the web console to drill down into the Policies section of the ControlledDynamicWebAppCluster. -You will see that the `AutoScalerPolicy` is running. +For example +{% highlight yaml %} +$ br app cluster ent webcluster policy +Id Name State +mMZngBnb org.apache.brooklyn.policy.autoscaling.AutoScalerPolicy RUNNING +{% endhighlight %} + +You can investigate the status of the `AutoScalerPolicy` with + +{% highlight yaml %} +$ br app cluster ent webcluster policy org.apache.brooklyn.policy.autoscaling.AutoScalerPolicy +"RUNNING" +{% endhighlight %} + +A more detailed description of the parameters of the policy can be obtained with +{% highlight yaml %} +$ br app cluster ent webcluster policy org.apache.brooklyn.policy.autoscaling.AutoScalerPolicy +Name Value Description +autoscaler.currentSizeOperator org.apache.brooklyn.policy.autoscaling.AutoScalerPolicy$4@9393100 +autoscaler.entityWithMetric The Entity with the metric that will be monitored +autoscaler.maxPoolSize4
[10/10] incubator-brooklyn git commit: This closes #1116
This closes #1116 "Getting Started" with CLI documentation updates - for review. Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/28644862 Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/28644862 Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/28644862 Branch: refs/heads/master Commit: 286448623c417f099a8bce1a4764d6aa4589c6ea Parents: 1cd62c6 d1cbb36 Author: Sam CorbettAuthored: Tue Jan 5 11:15:55 2016 + Committer: Sam Corbett Committed: Tue Jan 5 11:15:55 2016 + -- brooklyn-docs/guide/start/blueprints.md | 87 --- brooklyn-docs/guide/start/index.md | 2 + brooklyn-docs/guide/start/managing.md | 355 --- brooklyn-docs/guide/start/policies.md | 158 ++-- brooklyn-docs/website/index.md | 2 +- 5 files changed, 521 insertions(+), 83 deletions(-) --
[2/8] incubator-brooklyn git commit: Remove discontinued IP lookup service - BROOKLYN-213
Remove discontinued IP lookup service - BROOKLYN-213 The IP lookup service http://www.telize.com/ip was discontinued on the 15th of November 2015. Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/d4565b89 Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/d4565b89 Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/d4565b89 Branch: refs/heads/master Commit: d4565b89f3a89658851a6053db7177ff4a64debb Parents: 71f11ea Author: Matt ChampionAuthored: Fri Jan 8 10:58:01 2016 + Committer: Matt Champion Committed: Fri Jan 8 11:51:23 2016 + -- .../apache/brooklyn/location/geo/external-ip-address-resolvers.txt | 1 - 1 file changed, 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d4565b89/brooklyn-server/core/src/main/resources/org/apache/brooklyn/location/geo/external-ip-address-resolvers.txt -- diff --git a/brooklyn-server/core/src/main/resources/org/apache/brooklyn/location/geo/external-ip-address-resolvers.txt b/brooklyn-server/core/src/main/resources/org/apache/brooklyn/location/geo/external-ip-address-resolvers.txt index bc3c26e..693114a 100644 --- a/brooklyn-server/core/src/main/resources/org/apache/brooklyn/location/geo/external-ip-address-resolvers.txt +++ b/brooklyn-server/core/src/main/resources/org/apache/brooklyn/location/geo/external-ip-address-resolvers.txt @@ -18,7 +18,6 @@ http://jsonip.com/ http://myip.dnsomatic.com/ http://checkip.dyndns.org/ -http://www.telize.com/ip http://wtfismyip.com/text http://whatismyip.akamai.com/ http://myip.wampdeveloper.com/
[1/8] incubator-brooklyn git commit: Fix LocalhostExternalIpLoader blocking - BROOKLYN-213
Repository: incubator-brooklyn Updated Branches: refs/heads/master d05815810 -> 58337c4e4 Fix LocalhostExternalIpLoader blocking - BROOKLYN-213 Lookups will now block until the first successful resolve attempt or all services have been tried. Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/71f11ea1 Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/71f11ea1 Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/71f11ea1 Branch: refs/heads/master Commit: 71f11ea1d2cd03d69cb96b2264b3502899f19f03 Parents: 7bcb392 Author: Matt ChampionAuthored: Fri Jan 8 10:56:16 2016 + Committer: Matt Champion Committed: Fri Jan 8 11:48:46 2016 + -- .../location/geo/LocalhostExternalIpLoader.java | 73 ++-- 1 file changed, 52 insertions(+), 21 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/71f11ea1/brooklyn-server/core/src/main/java/org/apache/brooklyn/core/location/geo/LocalhostExternalIpLoader.java -- diff --git a/brooklyn-server/core/src/main/java/org/apache/brooklyn/core/location/geo/LocalhostExternalIpLoader.java b/brooklyn-server/core/src/main/java/org/apache/brooklyn/core/location/geo/LocalhostExternalIpLoader.java index fd95585..f6623fc 100644 --- a/brooklyn-server/core/src/main/java/org/apache/brooklyn/core/location/geo/LocalhostExternalIpLoader.java +++ b/brooklyn-server/core/src/main/java/org/apache/brooklyn/core/location/geo/LocalhostExternalIpLoader.java @@ -44,8 +44,21 @@ public class LocalhostExternalIpLoader { public static final Logger LOG = LoggerFactory.getLogger(LocalhostExternalIpLoader.class); -private static final AtomicBoolean retrievingLocalExternalIp = new AtomicBoolean(false); -private static final CountDownLatch triedLocalExternalIp = new CountDownLatch(1); +/** + * Mutex to guard access to retrievingLocalExternalIp. + */ +private static final Object mutex = new Object(); +/** + * When null there is no ongoing attempt to load the external IP address. Either no attempt has been made or the + * last attempt has been completed. + * When set there is an ongoing attempt to load the external IP address. New attempts to lookup the external IP + * address should wait on this latch instead of making another attempt to load the IP address. + */ +private static CountDownLatch retrievingLocalExternalIp; +/** + * Cached external IP address of localhost. Null if either no attempt has been made to resolve the address or the + * last attempt failed. + */ private static volatile String localExternalIp; private static class IpLoader implements Callable { @@ -120,57 +133,75 @@ public class LocalhostExternalIpLoader { } /** - * Requests URLs returned by {@link #getIpAddressWebsites()} until one returns an IP address. + * Requests URLs returned by {@link #getIpAddressWebsites()} until one returns an IP address or all URLs have been tried. * The address is assumed to be the external IP address of localhost. * @param blockFor The maximum duration to wait for the IP address to be resolved. * An indefinite way if null. * @return A string in IPv4 format, or null if no such address could be ascertained. */ private static String doLoad(Duration blockFor) { -if (localExternalIp != null) { -return localExternalIp; +// Check for a cached external IP address +final String resolvedIp = localExternalIp; +if (resolvedIp != null) { +return resolvedIp; } -final List candidateUrls = getIpAddressWebsites(); -if (candidateUrls.isEmpty()) { -LOG.debug("No candidate URLs to use to determine external IP of localhost"); -return null; +// Check for an ongoing attempt to load an external IP address +final boolean startAttemptToLoadIp; +final CountDownLatch attemptToRetrieveLocalExternalIp; +synchronized (mutex) { +if (retrievingLocalExternalIp == null) { +retrievingLocalExternalIp = new CountDownLatch(1); +startAttemptToLoadIp = true; +} +else { +startAttemptToLoadIp = false; +} +attemptToRetrieveLocalExternalIp = retrievingLocalExternalIp; } -// do in private thread, otherwise blocks for 30s+ on dodgy network! +// Attempt to load the external IP address in private thread, otherwise blocks for 30s+ on dodgy network! // (we
[3/8] incubator-brooklyn git commit: BROOKLYN-214: fix cancelling of AttributeWhenReady task
BROOKLYN-214: fix cancelling of AttributeWhenReady task Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/d5c07225 Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/d5c07225 Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/d5c07225 Branch: refs/heads/master Commit: d5c072257250e1b54e08efe2ac31b4b1ff03a6e0 Parents: d058158 Author: Aled SageAuthored: Tue Jan 12 13:24:43 2016 + Committer: Aled Sage Committed: Tue Jan 12 13:24:43 2016 + -- .../spi/dsl/BrooklynDslDeferredSupplier.java| 40 ++- .../DependentConfigPollingYamlTest.java | 117 +++ 2 files changed, 155 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d5c07225/brooklyn-server/camp/camp-brooklyn/src/main/java/org/apache/brooklyn/camp/brooklyn/spi/dsl/BrooklynDslDeferredSupplier.java -- diff --git a/brooklyn-server/camp/camp-brooklyn/src/main/java/org/apache/brooklyn/camp/brooklyn/spi/dsl/BrooklynDslDeferredSupplier.java b/brooklyn-server/camp/camp-brooklyn/src/main/java/org/apache/brooklyn/camp/brooklyn/spi/dsl/BrooklynDslDeferredSupplier.java index 65bf561..a417e32 100644 --- a/brooklyn-server/camp/camp-brooklyn/src/main/java/org/apache/brooklyn/camp/brooklyn/spi/dsl/BrooklynDslDeferredSupplier.java +++ b/brooklyn-server/camp/camp-brooklyn/src/main/java/org/apache/brooklyn/camp/brooklyn/spi/dsl/BrooklynDslDeferredSupplier.java @@ -18,7 +18,10 @@ */ package org.apache.brooklyn.camp.brooklyn.spi.dsl; +import java.io.IOException; +import java.io.ObjectInputStream; import java.io.Serializable; +import java.util.concurrent.locks.ReentrantLock; import org.apache.brooklyn.api.entity.Entity; import org.apache.brooklyn.api.mgmt.ExecutionContext; @@ -55,6 +58,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; * and should not accessed until after the components / entities are created * and are being started. * (TODO the precise semantics of this are under development.) + * + * The threading model is that only one thread can call {@link #get()} at a time. An interruptible + * lock is obtained using {@link #lock} for the duration of that method. It is important to not + * use {@code synchronized} because that is not interruptible - if someone tries to get the value + * and interrupts after a short wait, then we must release the lock immediately and return. * **/ public abstract class BrooklynDslDeferredSupplier implements DeferredSupplier, TaskFactory , Serializable { @@ -63,6 +71,15 @@ public abstract class BrooklynDslDeferredSupplier implements DeferredSupplier private static final Logger log = LoggerFactory.getLogger(BrooklynDslDeferredSupplier.class); +/** + * Lock to be used, rather than {@code synchronized} blocks, for anything long-running. + * Use {@link #getLock()} rather than this field directly, to ensure it is reinitialised + * after rebinding. + * + * @see https://issues.apache.org/jira/browse/BROOKLYN-214 + */ +private transient ReentrantLock lock; + // TODO json of this object should *be* this, not wrapped this ($brooklyn:literal is a bit of a hack, though it might work!) @JsonInclude @JsonProperty(value="$brooklyn:literal") @@ -72,8 +89,9 @@ public abstract class BrooklynDslDeferredSupplier implements DeferredSupplier public BrooklynDslDeferredSupplier() { PlanInterpretationNode sourceNode = BrooklynDslInterpreter.currentNode(); dsl = sourceNode!=null ? sourceNode.getOriginalValue() : null; +lock = new ReentrantLock(); } - + /** returns the current entity; for use in implementations of {@link #get()} */ protected final static EntityInternal entity() { return (EntityInternal) BrooklynTaskTags.getTargetOrContextEntity(Tasks.current()); @@ -88,7 +106,13 @@ public abstract class BrooklynDslDeferredSupplier implements DeferredSupplier } @Override -public final synchronized T get() { +public final T get() { +try { +getLock().lockInterruptibly(); +} catch (InterruptedException e) { +throw Exceptions.propagate(e); +} + try { if (log.isDebugEnabled()) log.debug("Queuing task to resolve "+dsl); @@ -110,7 +134,19 @@ public abstract class BrooklynDslDeferredSupplier implements DeferredSupplier } catch (Exception e) { throw Exceptions.propagate(e); +} finally { +getLock().unlock(); +} +} + +// Use this method, rather than the direct field,
[5/8] incubator-brooklyn git commit: [BROOKLYN-183] Remove dangling file
[BROOKLYN-183] Remove dangling file The real stuff is karaf/src/feature/feature.xml Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/41e9231c Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/41e9231c Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/41e9231c Branch: refs/heads/master Commit: 41e9231c44d6572de70269e5317e16ea1ae66df6 Parents: 966b714 Author: Ciprian CiubotariuAuthored: Tue Jan 12 19:46:41 2016 +0200 Committer: Ciprian Ciubotariu Committed: Tue Jan 12 19:46:41 2016 +0200 -- brooklyn-server/karaf/feature.xml | 51 -- 1 file changed, 51 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/41e9231c/brooklyn-server/karaf/feature.xml -- diff --git a/brooklyn-server/karaf/feature.xml b/brooklyn-server/karaf/feature.xml deleted file mode 100644 index fdb959d..000 --- a/brooklyn-server/karaf/feature.xml +++ /dev/null @@ -1,51 +0,0 @@ - - -http://karaf.apache.org/xmlns/features/v1.2.0; name="org.apache.brooklyn-${project.version}"> - - mvn:org.apache.karaf.features/standard/${karaf.version}/xml/features - mvn:org.apache.karaf.features/enterprise/${karaf.version}/xml/features - mvn:org.apache.karaf.features/spring/${karaf.version}/xml/features - - - - mvn:org.apache.brooklyn/brooklyn-core/${project.version} - mvn:org.apache.brooklyn/brooklyn-api/${project.version} - mvn:org.apache.brooklyn/brooklyn-utils-common/${project.version} - mvn:org.apache.brooklyn/brooklyn-utils-groovy/${project.version} - mvn:org.apache.brooklyn/brooklyn-logback-includes/${project.version} - - -wrap:mvn:com.google.http-client/google-http-client/1.18.0-rc - -mvn:com.google.guava/guava/${guava.version} -mvn:com.google.code.gson/gson/${gson.version} -mvn:com.jayway.jsonpath/json-path/${jsonPath.version} -mvn:com.fasterxml.jackson.core/jackson-core/${fasterxml.jackson.version} -mvn:com.fasterxml.jackson.core/jackson-databind/${fasterxml.jackson.version} -mvn:com.fasterxml.jackson.core/jackson-annotations/${fasterxml.jackson.version} -mvn:net.minidev/json-smart/${jsonSmart.version} -mvn:net.minidev/asm/${minidev.asm.version} - - - - mvn:org.apache.brooklyn/brooklyn-commands/${project.version} - - - -
[4/8] incubator-brooklyn git commit: [BROOKLYN-183] Remove karaf dependencies.xml from git
[BROOKLYN-183] Remove karaf dependencies.xml from git The dependencies.xml file can be used to track dependency changes for karaf features. For this reason it has to be added to the git repository so such changes can be detected between commits. However, developers complained about having this file on git, since it confusingly keeps showing up in commits. Also, at this stage this tracking is unnecessary. Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/966b714e Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/966b714e Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/966b714e Branch: refs/heads/master Commit: 966b714eefe2a3d5233959f121fe80f6f9e3f426 Parents: d058158 Author: Ciprian CiubotariuAuthored: Tue Jan 12 19:35:51 2016 +0200 Committer: Ciprian Ciubotariu Committed: Tue Jan 12 19:44:05 2016 +0200 -- brooklyn-server/karaf/features/pom.xml | 4 - .../features/src/main/history/dependencies.xml | 103 --- 2 files changed, 107 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/966b714e/brooklyn-server/karaf/features/pom.xml -- diff --git a/brooklyn-server/karaf/features/pom.xml b/brooklyn-server/karaf/features/pom.xml index 03cd932..c7bb6b4 100755 --- a/brooklyn-server/karaf/features/pom.xml +++ b/brooklyn-server/karaf/features/pom.xml @@ -51,10 +51,6 @@ 50 true (obr) -true -false -true - true http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/966b714e/brooklyn-server/karaf/features/src/main/history/dependencies.xml -- diff --git a/brooklyn-server/karaf/features/src/main/history/dependencies.xml b/brooklyn-server/karaf/features/src/main/history/dependencies.xml deleted file mode 100644 index 2bcbdca..000 --- a/brooklyn-server/karaf/features/src/main/history/dependencies.xml +++ /dev/null @@ -1,103 +0,0 @@ - -http://karaf.apache.org/xmlns/features/v1.3.0; name="org.apache.brooklyn-0.9.0-SNAPSHOT"> - -brooklyn-api -brooklyn-api -brooklyn-camp-base -brooklyn-camp-base -brooklyn-camp-base -brooklyn-camp-brooklyn -brooklyn-core -brooklyn-core -brooklyn-rest-api -brooklyn-utils-common -brooklyn-utils-common -brooklyn-utils-common -brooklyn-utils-common -brooklyn-utils-rest-swagger -brooklyn-utils-rest-swagger -jetty -swagger-crippled -war -war -mvn:ch.qos.logback/logback-classic/1.0.7 -mvn:ch.qos.logback/logback-core/1.0.7 - mvn:com.fasterxml.jackson.core/jackson-annotations/2.4.5 - mvn:com.fasterxml.jackson.core/jackson-annotations/2.4.5 -mvn:com.fasterxml.jackson.core/jackson-core/2.4.5 -mvn:com.fasterxml.jackson.core/jackson-core/2.4.5 -mvn:com.fasterxml.jackson.core/jackson-databind/2.4.5 -mvn:com.fasterxml.jackson.core/jackson-databind/2.4.5 - mvn:com.fasterxml.jackson.dataformat/jackson-dataformat-yaml/2.4.5 - mvn:com.fasterxml.jackson.jaxrs/jackson-jaxrs-base/2.4.5 - mvn:com.fasterxml.jackson.jaxrs/jackson-jaxrs-json-provider/2.4.5 -mvn:com.google.code.gson/gson/2.3 -mvn:com.google.guava/guava/17.0 -mvn:com.jayway.jsonpath/json-path/2.0.0 -mvn:com.sun.jersey.contribs/jersey-multipart/1.19 -mvn:com.sun.jersey/jersey-core/1.19 -mvn:com.sun.jersey/jersey-core/1.19 -mvn:com.sun.jersey/jersey-server/1.19 -mvn:com.sun.jersey/jersey-server/1.19 -mvn:com.sun.jersey/jersey-servlet/1.19 -mvn:com.sun.jersey/jersey-servlet/1.19 -mvn:com.sun.jersey/jersey-servlet/1.19 -mvn:com.thoughtworks.xstream/xstream/1.4.7 -mvn:commons-beanutils/commons-beanutils/1.9.1 -mvn:commons-codec/commons-codec/1.9 -mvn:commons-codec/commons-codec/1.9 -mvn:commons-collections/commons-collections/3.2.1 -mvn:commons-io/commons-io/2.4 -mvn:commons-lang/commons-lang/2.4 -mvn:io.swagger/swagger-annotations/1.5.3 -mvn:io.swagger/swagger-models/1.5.3 -mvn:javax.servlet/javax.servlet-api/3.1.0 -mvn:javax.servlet/javax.servlet-api/3.1.0 -mvn:javax.ws.rs/jsr311-api/1.1.1 -mvn:net.minidev/asm/1.0.2 -mvn:net.minidev/json-smart/2.1.1 -mvn:net.schmizz/sshj/0.8.1 -
[2/2] brooklyn-server git commit: This closes #158
This closes #158 BROOKLYN-272: fix dependsOnMethods in ApplicationResourceTest Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/9a5413c7 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/9a5413c7 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/9a5413c7 Branch: refs/heads/master Commit: 9a5413c7e436b02a455e4d6dafb4689888245b10 Parents: c5f3235 e6c7cda Author: Sam CorbettAuthored: Thu May 26 16:09:13 2016 +0100 Committer: Sam Corbett Committed: Thu May 26 16:09:13 2016 +0100 -- .../brooklyn/rest/resources/ApplicationResourceTest.java| 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) --
[1/2] brooklyn-server git commit: BROOKLYN-272: fix dependsOnMethods in ApplicationResourceTest
Repository: brooklyn-server Updated Branches: refs/heads/master c5f3235b0 -> 9a5413c7e BROOKLYN-272: fix dependsOnMethods in ApplicationResourceTest This broke testDeleteApplicaiton, which had dependsOnMethods=... that included the now-disabled testFetchApplicationsAndEntity Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/e6c7cdad Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/e6c7cdad Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/e6c7cdad Branch: refs/heads/master Commit: e6c7cdad131a324db5dc6e905a980b35d77716bd Parents: c5f3235 Author: Aled SageAuthored: Thu May 26 09:11:09 2016 +0100 Committer: Aled Sage Committed: Thu May 26 09:11:09 2016 +0100 -- .../brooklyn/rest/resources/ApplicationResourceTest.java| 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/e6c7cdad/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/resources/ApplicationResourceTest.java -- diff --git a/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/resources/ApplicationResourceTest.java b/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/resources/ApplicationResourceTest.java index 1adf7fc..ea49b47 100644 --- a/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/resources/ApplicationResourceTest.java +++ b/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/resources/ApplicationResourceTest.java @@ -350,8 +350,7 @@ public class ApplicationResourceTest extends BrooklynRestResourceTest { /** * TODO BROOKLYN-272, Disabled, because fails non-deterministically in jenkins (windows), - * as commented by Svet in https://github.com/apache/brooklyn-library/pull/39 - * + * as commented by Svet in https://github.com/apache/brooklyn-library/pull/39. * testFetchApplicationsAndEntity(org.apache.brooklyn.rest.resources.ApplicationResourceTest) Time elapsed: 0.073 sec <<< FAILURE! * java.lang.AssertionError: expected [4] but found [3] * at org.testng.Assert.fail(Assert.java:94) @@ -360,6 +359,8 @@ public class ApplicationResourceTest extends BrooklynRestResourceTest { * at org.testng.Assert.assertEquals(Assert.java:370) * at org.testng.Assert.assertEquals(Assert.java:380) * at org.apache.brooklyn.rest.resources.ApplicationResourceTest.testFetchApplicationsAndEntity(ApplicationResourceTest.java:387) + * + * When re-enabling, be sure to add it back to dependsOnMethods in testDeleteApplication. */ @SuppressWarnings({ "rawtypes", "unchecked" }) @Test(dependsOnMethods = "testDeployApplication", groups={"Broken"}) @@ -595,7 +596,9 @@ public class ApplicationResourceTest extends BrooklynRestResourceTest { assertEquals(details.get("leafEntityCount"), 2); } -@Test(dependsOnMethods = {"testListEffectors", "testFetchApplicationsAndEntity", "testTriggerSampleEffector", "testListApplications","testReadEachSensor","testPolicyWhichCapitalizes","testLocatedLocation"}) + +// TODO BROOKLYN-272: testFetchApplicationsAndEntity is temporarily disabled; therefore removed from dependsOnMethod list +@Test(dependsOnMethods = {"testListEffectors", /*"testFetchApplicationsAndEntity",*/ "testTriggerSampleEffector", "testListApplications","testReadEachSensor","testPolicyWhichCapitalizes","testLocatedLocation"}) public void testDeleteApplication() throws TimeoutException, InterruptedException { waitForPageFoundResponse("/applications/simple-app", ApplicationSummary.class); Collection apps = getManagementContext().getApplications();
[1/2] brooklyn-server git commit: TestSshCommand checks all assertions rather than throwing first
Repository: brooklyn-server Updated Branches: refs/heads/master 004c6c1f0 -> 99d073f62 TestSshCommand checks all assertions rather than throwing first Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/c6266dde Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/c6266dde Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/c6266dde Branch: refs/heads/master Commit: c6266dde407756b93a06e037928371bd30f944ca Parents: 004c6c1 Author: Sam CorbettAuthored: Wed Jun 22 10:22:28 2016 +0100 Committer: Sam Corbett Committed: Wed Jun 22 10:22:28 2016 +0100 -- .../brooklyn/test/framework/TestFrameworkAssertions.java| 9 + .../apache/brooklyn/test/framework/TestSshCommandImpl.java | 8 +--- 2 files changed, 14 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/c6266dde/test-framework/src/main/java/org/apache/brooklyn/test/framework/TestFrameworkAssertions.java -- diff --git a/test-framework/src/main/java/org/apache/brooklyn/test/framework/TestFrameworkAssertions.java b/test-framework/src/main/java/org/apache/brooklyn/test/framework/TestFrameworkAssertions.java index bc358f8..7f1406c 100644 --- a/test-framework/src/main/java/org/apache/brooklyn/test/framework/TestFrameworkAssertions.java +++ b/test-framework/src/main/java/org/apache/brooklyn/test/framework/TestFrameworkAssertions.java @@ -155,6 +155,15 @@ public class TestFrameworkAssertions { } } +public static void checkActualAgainstAssertions(AssertionSupport support, +Map assertions, String target, T actual) { +try { +checkActualAgainstAssertions(assertions, target, actual); +} catch (Throwable t) { +support.fail(t); +} +} + public static void checkActualAgainstAssertions(Map assertions, String target, T actual) { for (Map.Entry assertion : assertions.entrySet()) { http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/c6266dde/test-framework/src/main/java/org/apache/brooklyn/test/framework/TestSshCommandImpl.java -- diff --git a/test-framework/src/main/java/org/apache/brooklyn/test/framework/TestSshCommandImpl.java b/test-framework/src/main/java/org/apache/brooklyn/test/framework/TestSshCommandImpl.java index 3d2ae02..c65f4f9 100644 --- a/test-framework/src/main/java/org/apache/brooklyn/test/framework/TestSshCommandImpl.java +++ b/test-framework/src/main/java/org/apache/brooklyn/test/framework/TestSshCommandImpl.java @@ -197,15 +197,17 @@ public class TestSshCommandImpl extends TargetableTestComponentImpl implements T LOG.debug("{}, Result is {}\nwith output [\n{}\n] and error [\n{}\n]", new Object[] { this, result.getExitCode(), shorten(result.getStdout()), shorten(result.getStderr()) }); +TestFrameworkAssertions.AssertionSupport support = new TestFrameworkAssertions.AssertionSupport(); for (Map assertion : exitCodeAssertions()) { -checkActualAgainstAssertions(assertion, "exit code", result.getExitCode()); +checkActualAgainstAssertions(support, assertion, "exit code", result.getExitCode()); } for (Map assertion : getAssertions(this, ASSERT_OUT)) { -checkActualAgainstAssertions(assertion, "stdout", result.getStdout()); +checkActualAgainstAssertions(support, assertion, "stdout", result.getStdout()); } for (Map assertion : getAssertions(this, ASSERT_ERR)) { -checkActualAgainstAssertions(assertion, "stderr", result.getStderr()); +checkActualAgainstAssertions(support, assertion, "stderr", result.getStderr()); } +support.validate(); } private Result executeDownloadedScript(SshMachineLocation machineLocation, String url, String scriptPath, Map env) {
[2/2] brooklyn-server git commit: This closes #213
This closes #213 TestSshCommand checks all assertions rather than throwing first Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/99d073f6 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/99d073f6 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/99d073f6 Branch: refs/heads/master Commit: 99d073f620a8186b3e896dd9ce8fecb2dab5d0a9 Parents: 004c6c1 c6266dd Author: Sam CorbettAuthored: Wed Jun 22 11:24:51 2016 +0100 Committer: Sam Corbett Committed: Wed Jun 22 11:24:51 2016 +0100 -- .../brooklyn/test/framework/TestFrameworkAssertions.java| 9 + .../apache/brooklyn/test/framework/TestSshCommandImpl.java | 8 +--- 2 files changed, 14 insertions(+), 3 deletions(-) --
[5/6] incubator-brooklyn git commit: This closes #1153
This closes #1153 WinRM docs for correct preparation of windows templates Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/22faee79 Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/22faee79 Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/22faee79 Branch: refs/heads/master Commit: 22faee796cf609078a53885d67bd0661291cf120 Parents: a858981 93dd48d Author: Sam CorbettAuthored: Mon Jan 18 12:12:51 2016 + Committer: Sam Corbett Committed: Mon Jan 18 12:12:51 2016 + -- brooklyn-docs/guide/yaml/winrm/index.md | 15 +++ 1 file changed, 15 insertions(+) --
[2/6] incubator-brooklyn git commit: Fixed an issue, where calling getEntity on BuiltResponsePreservingError would throw a previously caught error. We now throw an IllegalStateException to make it cle
Fixed an issue, where calling getEntity on BuiltResponsePreservingError would throw a previously caught error. We now throw an IllegalStateException to make it clear where the exception is coming from Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/71cfdc66 Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/71cfdc66 Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/71cfdc66 Branch: refs/heads/master Commit: 71cfdc66f5d4b75fdd68bb455c0f31e0a15dd9e5 Parents: 2864486 Author: Graeme-MillerAuthored: Wed Jan 13 15:35:17 2016 + Committer: Graeme-Miller Committed: Wed Jan 13 15:35:17 2016 + -- .../rest/client/util/http/BuiltResponsePreservingError.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/71cfdc66/brooklyn-server/rest/rest-client/src/main/java/org/apache/brooklyn/rest/client/util/http/BuiltResponsePreservingError.java -- diff --git a/brooklyn-server/rest/rest-client/src/main/java/org/apache/brooklyn/rest/client/util/http/BuiltResponsePreservingError.java b/brooklyn-server/rest/rest-client/src/main/java/org/apache/brooklyn/rest/client/util/http/BuiltResponsePreservingError.java index fb43c4c..d011172 100644 --- a/brooklyn-server/rest/rest-client/src/main/java/org/apache/brooklyn/rest/client/util/http/BuiltResponsePreservingError.java +++ b/brooklyn-server/rest/rest-client/src/main/java/org/apache/brooklyn/rest/client/util/http/BuiltResponsePreservingError.java @@ -70,7 +70,9 @@ public class BuiltResponsePreservingError extends BuiltResponse { @Override public Object getEntity() { -if (error!=null) Exceptions.propagate(error); +if (error!=null) { +throw new IllegalStateException("getEntity called on BuiltResponsePreservingError, where an Error had been preserved", error); +} return super.getEntity(); }
[1/2] brooklyn-server git commit: Inject WebAppContexts into BrooklynWebServer
Repository: brooklyn-server Updated Branches: refs/heads/master bb8980a08 -> 6303d02a0 Inject WebAppContexts into BrooklynWebServer Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/3762d56a Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/3762d56a Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/3762d56a Branch: refs/heads/master Commit: 3762d56ae6540104dacca7fdad07425d32a9182c Parents: 2e58954 Author: Sam CorbettAuthored: Tue Feb 9 10:31:36 2016 + Committer: Sam Corbett Committed: Tue Feb 9 10:31:36 2016 + -- .../brooklyn/launcher/BrooklynLauncher.java | 17 ++- .../brooklyn/launcher/BrooklynWebServer.java| 90 ++- .../launcher/WebAppContextProvider.java | 115 +++ 3 files changed, 164 insertions(+), 58 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/3762d56a/launcher/src/main/java/org/apache/brooklyn/launcher/BrooklynLauncher.java -- diff --git a/launcher/src/main/java/org/apache/brooklyn/launcher/BrooklynLauncher.java b/launcher/src/main/java/org/apache/brooklyn/launcher/BrooklynLauncher.java index 5fa0dec0..e5d4c01 100644 --- a/launcher/src/main/java/org/apache/brooklyn/launcher/BrooklynLauncher.java +++ b/launcher/src/main/java/org/apache/brooklyn/launcher/BrooklynLauncher.java @@ -28,6 +28,7 @@ import java.nio.file.Files; import java.util.ArrayList; import java.util.Arrays; import java.util.LinkedHashMap; +import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.concurrent.TimeoutException; @@ -144,7 +145,7 @@ public class BrooklynLauncher { private Boolean useHttps = null; private InetAddress bindAddress = null; private InetAddress publicAddress = null; -private Map webApps = new LinkedHashMap (); +private List webApps = new LinkedList<>(); private Map webconsoleFlags = Maps.newLinkedHashMap(); private Boolean skipSecurityFilter = null; @@ -397,7 +398,15 @@ public class BrooklynLauncher { * @param warUrl The URL from which the WAR should be loaded, supporting classpath:// protocol in addition to file:// and http(s)://. */ public BrooklynLauncher webapp(String contextPath, String warUrl) { -webApps.put(contextPath, warUrl); +webApps.add(new WebAppContextProvider(contextPath, warUrl)); +return this; +} + +/** + * @see #webapp(String, String) + */ +public BrooklynLauncher webapp(WebAppContextProvider contextProvider) { +webApps.add(contextProvider); return this; } @@ -809,8 +818,8 @@ public class BrooklynLauncher { if (skipSecurityFilter != Boolean.TRUE) { webServer.setSecurityFilter(BrooklynPropertiesSecurityFilter.class); } -for (Map.Entry webapp : webApps.entrySet()) { -webServer.addWar(webapp.getKey(), webapp.getValue()); +for (WebAppContextProvider webapp : webApps) { +webServer.addWar(webapp); } webServer.start(); http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/3762d56a/launcher/src/main/java/org/apache/brooklyn/launcher/BrooklynWebServer.java -- diff --git a/launcher/src/main/java/org/apache/brooklyn/launcher/BrooklynWebServer.java b/launcher/src/main/java/org/apache/brooklyn/launcher/BrooklynWebServer.java index 37e2e20..0365c14 100644 --- a/launcher/src/main/java/org/apache/brooklyn/launcher/BrooklynWebServer.java +++ b/launcher/src/main/java/org/apache/brooklyn/launcher/BrooklynWebServer.java @@ -40,7 +40,6 @@ import javax.servlet.DispatcherType; import org.apache.brooklyn.rest.filter.SwaggerFilter; import org.eclipse.jetty.server.Connector; import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.server.SessionManager; import org.eclipse.jetty.servlet.FilterHolder; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.util.ssl.SslContextFactory; @@ -160,6 +159,9 @@ public class BrooklynWebServer { @SetFromFlag private Map wars = new LinkedHashMap (); +// would like to remove wars in favour of this but SetFromFlag means we have no idea where it's used. +private Map contextProviders = new LinkedHashMap<>(); + @SetFromFlag protected boolean ignoreWebappDeploymentFailures = false; @@ -296,7 +298,12 @@ public class BrooklynWebServer { /** specifies a
[2/2] brooklyn-server git commit: This closes #12
This closes #12 Inject WebAppContexts into BrooklynWebServer Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/6303d02a Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/6303d02a Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/6303d02a Branch: refs/heads/master Commit: 6303d02a00bfc48df9f2ff45c9b655057f070756 Parents: bb8980a 3762d56 Author: Sam CorbettAuthored: Tue Feb 9 14:51:47 2016 + Committer: Sam Corbett Committed: Tue Feb 9 14:51:47 2016 + -- .../brooklyn/launcher/BrooklynLauncher.java | 17 ++- .../brooklyn/launcher/BrooklynWebServer.java| 90 ++- .../launcher/WebAppContextProvider.java | 115 +++ 3 files changed, 164 insertions(+), 58 deletions(-) --
[2/3] brooklyn-server git commit: Useful methods for working with the Brooklyn API programatically.
Useful methods for working with the Brooklyn API programatically. Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/d1733900 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/d1733900 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/d1733900 Branch: refs/heads/master Commit: d173390039887e2da6717f5ca0d1b4c91fb8657b Parents: 6528d25 Author: Sam CorbettAuthored: Wed Feb 3 17:09:17 2016 + Committer: Sam Corbett Committed: Wed Feb 3 17:09:17 2016 + -- rest/rest-client/pom.xml| 5 + .../brooklyn/rest/client/BrooklynApiUtil.java | 154 +++ .../rest/client/BrooklynApiUtilTest.java| 129 3 files changed, 288 insertions(+) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/d1733900/rest/rest-client/pom.xml -- diff --git a/rest/rest-client/pom.xml b/rest/rest-client/pom.xml index 5b27148..f3fa883 100644 --- a/rest/rest-client/pom.xml +++ b/rest/rest-client/pom.xml @@ -144,6 +144,11 @@ ${project.version} test + +com.google.mockwebserver +mockwebserver +test + http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/d1733900/rest/rest-client/src/main/java/org/apache/brooklyn/rest/client/BrooklynApiUtil.java -- diff --git a/rest/rest-client/src/main/java/org/apache/brooklyn/rest/client/BrooklynApiUtil.java b/rest/rest-client/src/main/java/org/apache/brooklyn/rest/client/BrooklynApiUtil.java new file mode 100644 index 000..ce57da5 --- /dev/null +++ b/rest/rest-client/src/main/java/org/apache/brooklyn/rest/client/BrooklynApiUtil.java @@ -0,0 +1,154 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.brooklyn.rest.client; + +import static com.google.common.base.Preconditions.checkNotNull; + +import java.util.Date; +import java.util.concurrent.Callable; +import java.util.concurrent.atomic.AtomicReference; +import javax.ws.rs.core.Response; + +import org.apache.brooklyn.rest.api.EffectorApi; +import org.apache.brooklyn.rest.domain.Status; +import org.apache.brooklyn.rest.domain.TaskSummary; +import org.apache.brooklyn.util.repeat.Repeater; +import org.apache.brooklyn.util.time.Duration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.common.collect.ImmutableMap; + +public class BrooklynApiUtil { + +private static final Logger LOG = LoggerFactory.getLogger(BrooklynApiUtil.class); +private static final Duration DEFAULT_POLL_PERIOD = Duration.FIVE_SECONDS; +private static final Duration DEFAULT_TIMEOUT = Duration.FIVE_MINUTES; + +private BrooklynApiUtil() {} + +/** + * Deploys the blueprint and returns the task summary. + * @throws Exception If the response from the server when deploying was {@link #isUnhealthyResponse unhealthy}. + */ +public static TaskSummary deployBlueprint(BrooklynApi api, String blueprint) throws Exception { +Response r = api.getApplicationApi().createFromYaml(blueprint); +if (isUnhealthyResponse(r)) { +throw new Exception("Unexpected response deploying blueprint to server: " + r.getStatus()); +} else { +LOG.debug("Server response to deploy blueprint: " + r.getStatus()); +} +return BrooklynApi.getEntity(r, TaskSummary.class); +} + +/** + * Waits for the application with the given ID to be running. + * + * @throws IllegalStateException If the application was not running after {@link #DEFAULT_TIMEOUT}. + */ +public static void waitForRunningAndThrowOtherwise(BrooklynApi api, String applicationId, String taskId) throws IllegalStateException { +waitForRunningAndThrowOtherwise(api,
[1/3] brooklyn-server git commit: Typo
Repository: brooklyn-server Updated Branches: refs/heads/master 90eb128ba -> 1298d378c Typo Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/6528d25b Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/6528d25b Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/6528d25b Branch: refs/heads/master Commit: 6528d25b32f24c29ecb2ce602e437fd9f53e2182 Parents: d03f254 Author: Sam CorbettAuthored: Wed Feb 3 17:08:29 2016 + Committer: Sam Corbett Committed: Wed Feb 3 17:08:29 2016 + -- .../brooklyn/core/catalog/internal/BasicBrooklynCatalog.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/6528d25b/core/src/main/java/org/apache/brooklyn/core/catalog/internal/BasicBrooklynCatalog.java -- diff --git a/core/src/main/java/org/apache/brooklyn/core/catalog/internal/BasicBrooklynCatalog.java b/core/src/main/java/org/apache/brooklyn/core/catalog/internal/BasicBrooklynCatalog.java index 41a0a9c..8306168 100644 --- a/core/src/main/java/org/apache/brooklyn/core/catalog/internal/BasicBrooklynCatalog.java +++ b/core/src/main/java/org/apache/brooklyn/core/catalog/internal/BasicBrooklynCatalog.java @@ -414,7 +414,7 @@ public class BasicBrooklynCatalog implements BrooklynCatalog { } } else { -log.info("No Camp-YAML parser regsitered for parsing catalog item DSL; skipping DSL-parsing"); +log.info("No Camp-YAML parser registered for parsing catalog item DSL; skipping DSL-parsing"); } Map
[3/3] brooklyn-server git commit: This closes #5
This closes #5 Brooklyn API utilities Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/1298d378 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/1298d378 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/1298d378 Branch: refs/heads/master Commit: 1298d378c6c1154dd4bba890c41b5a2751fbcc12 Parents: 90eb128 d173390 Author: Sam CorbettAuthored: Thu Feb 4 14:31:40 2016 + Committer: Sam Corbett Committed: Thu Feb 4 14:31:40 2016 + -- .../catalog/internal/BasicBrooklynCatalog.java | 2 +- rest/rest-client/pom.xml| 5 + .../brooklyn/rest/client/BrooklynApiUtil.java | 154 +++ .../rest/client/BrooklynApiUtilTest.java| 129 4 files changed, 289 insertions(+), 1 deletion(-) --
[2/2] brooklyn-ui git commit: This closes #4
This closes #4 Added brooklyn branding to stock swagger-ui Project: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/commit/c2e374eb Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/tree/c2e374eb Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/diff/c2e374eb Branch: refs/heads/master Commit: c2e374eb8291e6248514d3f2469938abb56d517c Parents: 72d57e1 47908b4 Author: Sam CorbettAuthored: Thu Feb 11 10:21:14 2016 + Committer: Sam Corbett Committed: Thu Feb 11 10:21:14 2016 + -- src/main/webapp/assets/html/swagger-ui.html | 32 ++-- 1 file changed, 30 insertions(+), 2 deletions(-) --
[3/4] brooklyn-server git commit: adds test for dynamically added keys
adds test for dynamically added keys Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/56ddfe6c Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/56ddfe6c Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/56ddfe6c Branch: refs/heads/master Commit: 56ddfe6c59dfed02c31b48e6bc82045b00cd237e Parents: 0a416f3 Author: Robert MossAuthored: Thu Feb 11 10:13:10 2016 + Committer: Robert Moss Committed: Thu Feb 11 11:18:05 2016 + -- .../software/base/InboundPortsUtilsTest.java| 53 1 file changed, 53 insertions(+) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/56ddfe6c/software/base/src/test/java/org/apache/brooklyn/entity/software/base/InboundPortsUtilsTest.java -- diff --git a/software/base/src/test/java/org/apache/brooklyn/entity/software/base/InboundPortsUtilsTest.java b/software/base/src/test/java/org/apache/brooklyn/entity/software/base/InboundPortsUtilsTest.java new file mode 100644 index 000..fe18191 --- /dev/null +++ b/software/base/src/test/java/org/apache/brooklyn/entity/software/base/InboundPortsUtilsTest.java @@ -0,0 +1,53 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.brooklyn.entity.software.base; + +import java.util.Collection; + +import org.apache.brooklyn.api.entity.EntitySpec; +import org.apache.brooklyn.api.mgmt.ManagementContext; +import org.apache.brooklyn.config.ConfigKey; +import org.apache.brooklyn.core.config.ConfigKeys; +import org.apache.brooklyn.core.entity.Entities; +import org.apache.brooklyn.core.test.BrooklynAppUnitTestSupport; +import org.apache.brooklyn.core.test.entity.TestApplication; +import org.apache.brooklyn.core.test.entity.TestEntity; +import org.apache.brooklyn.location.localhost.LocalhostMachineProvisioningLocation; +import org.testng.annotations.AfterMethod; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; +import org.testng.Assert; + +import com.google.common.collect.ImmutableSet; + +public class InboundPortsUtilsTest extends BrooklynAppUnitTestSupport { + +@Test +public void testGetRequiredOpenPortsGetsDynamicallyAddedKeys() { +TestEntity entity = app.createAndManageChild(EntitySpec.create(TestEntity.class)); +Collection defaultRequiredOpenPorts = InboundPortsUtils.getRequiredOpenPorts(entity, ImmutableSet. of(), true, null); +Assert.assertEquals(defaultRequiredOpenPorts, ImmutableSet.of(), "Expected no ports"); +ConfigKey newTestConfigKeyPort = ConfigKeys.newIntegerConfigKey("new.test.config.key.port"); +ConfigKey newTestConfigKeyString = ConfigKeys.newStringConfigKey("new.test.config.key.string"); +entity.config().set(newTestConfigKeyPort, ); +entity.config().set(newTestConfigKeyString, "foo.bar"); +Collection dynamicRequiredOpenPorts = InboundPortsUtils.getRequiredOpenPorts(entity, ImmutableSet. of(), true, null); +Assert.assertEquals(dynamicRequiredOpenPorts, ImmutableSet.of(), "Expected new port to be added"); +} +}
[4/4] brooklyn-server git commit: This closes #18
This closes #18 Fixes port inference for dynamically added ConfigKeys Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/f9a59e5d Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/f9a59e5d Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/f9a59e5d Branch: refs/heads/master Commit: f9a59e5d40a17962b643e09c8f000562c302061a Parents: 6693cd0 56ddfe6 Author: Sam CorbettAuthored: Thu Feb 11 11:57:58 2016 + Committer: Sam Corbett Committed: Thu Feb 11 11:57:58 2016 + -- .../entity/software/base/InboundPortsUtils.java | 3 ++ .../software/base/InboundPortsUtilsTest.java| 53 2 files changed, 56 insertions(+) --
[1/4] brooklyn-server git commit: Fixes port inference for dynamically added ConfigKeys
Repository: brooklyn-server Updated Branches: refs/heads/master 6693cd0cd -> f9a59e5d4 Fixes port inference for dynamically added ConfigKeys Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/e98b1581 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/e98b1581 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/e98b1581 Branch: refs/heads/master Commit: e98b15811a6f5d9af70ebe34b738e27e13969c1b Parents: 90eb128 Author: Robert MossAuthored: Wed Feb 10 15:54:02 2016 + Committer: Robert Moss Committed: Wed Feb 10 15:54:02 2016 + -- .../apache/brooklyn/entity/software/base/InboundPortsUtils.java | 3 +++ 1 file changed, 3 insertions(+) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/e98b1581/software/base/src/main/java/org/apache/brooklyn/entity/software/base/InboundPortsUtils.java -- diff --git a/software/base/src/main/java/org/apache/brooklyn/entity/software/base/InboundPortsUtils.java b/software/base/src/main/java/org/apache/brooklyn/entity/software/base/InboundPortsUtils.java index adc7b58..73e7a86 100644 --- a/software/base/src/main/java/org/apache/brooklyn/entity/software/base/InboundPortsUtils.java +++ b/software/base/src/main/java/org/apache/brooklyn/entity/software/base/InboundPortsUtils.java @@ -24,6 +24,7 @@ import com.google.common.reflect.TypeToken; import org.apache.brooklyn.api.entity.Entity; import org.apache.brooklyn.api.location.PortRange; import org.apache.brooklyn.config.ConfigKey; +import org.apache.brooklyn.core.entity.EntityInternal; import org.apache.brooklyn.util.collections.MutableSet; import org.apache.brooklyn.util.core.flags.TypeCoercions; import org.apache.brooklyn.util.guava.Maybe; @@ -75,6 +76,8 @@ public class InboundPortsUtils { if (portsAutoInfer == null || portsAutoInfer.booleanValue()) { // auto-infer defaults to true if not specified Set configKeys = Sets.newHashSet(extraConfigKeys); configKeys.addAll(entity.getEntityType().getConfigKeys()); +// Also add dynamically added config keys + configKeys.addAll(((EntityInternal)entity).config().getBag().getAllConfigAsConfigKeyMap().keySet()); if (portRegex == null) portRegex = ".*\\.port"; // defaults to legacy regex if not specified Pattern portsPattern = Pattern.compile(portRegex);
[1/3] brooklyn-server git commit: Downgrade jackson2 version from 2.7.0. to 2.4.5
Repository: brooklyn-server Updated Branches: refs/heads/master 1a9781546 -> 0a5f3e11c Downgrade jackson2 version from 2.7.0. to 2.4.5 - remove usage of jackson-datatype-guava for incompatibility of guava Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/5ccb6bfb Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/5ccb6bfb Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/5ccb6bfb Branch: refs/heads/master Commit: 5ccb6bfb59652fb170feb0830b9031a64480bdfa Parents: 5b01f8f Author: Andrea TurliAuthored: Thu Feb 11 12:49:15 2016 +0100 Committer: Andrea Turli Committed: Thu Feb 11 19:50:42 2016 +0100 -- karaf/features/src/main/feature/feature.xml | 1 - pom.xml | 3 +- rest/rest-server/pom.xml| 4 -- .../util/json/BrooklynJacksonJsonProvider.java | 6 +- .../rest/util/json/MultimapSerializer.java | 62 5 files changed, 66 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/5ccb6bfb/karaf/features/src/main/feature/feature.xml -- diff --git a/karaf/features/src/main/feature/feature.xml b/karaf/features/src/main/feature/feature.xml index 19d439e..0b22046 100644 --- a/karaf/features/src/main/feature/feature.xml +++ b/karaf/features/src/main/feature/feature.xml @@ -181,7 +181,6 @@ mvn:com.sun.jersey/jersey-core/${jersey.version} mvn:com.sun.jersey/jersey-servlet/${jersey.version} -mvn:com.fasterxml.jackson.datatype/jackson-datatype-guava/${fasterxml.jackson.version} mvn:com.fasterxml.jackson.jaxrs/jackson-jaxrs-json-provider/${fasterxml.jackson.version} http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/5ccb6bfb/pom.xml -- diff --git a/pom.xml b/pom.xml index c1e2003..c41c691 100644 --- a/pom.xml +++ b/pom.xml @@ -97,7 +97,7 @@ 1.6.6 17.0 1.4.7 -2.7.0 +2.4.5 1.19 4.4.1 3.3.2 @@ -148,7 +148,6 @@ 0.8.1 4.0.0 0.3.1 - 1.4.0 3.3.4 http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/5ccb6bfb/rest/rest-server/pom.xml -- diff --git a/rest/rest-server/pom.xml b/rest/rest-server/pom.xml index 9b36f69..06c137b 100644 --- a/rest/rest-server/pom.xml +++ b/rest/rest-server/pom.xml @@ -95,10 +95,6 @@ slf4j-api -com.fasterxml.jackson.datatype -jackson-datatype-guava - - com.fasterxml.jackson.jaxrs jackson-jaxrs-json-provider http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/5ccb6bfb/rest/rest-server/src/main/java/org/apache/brooklyn/rest/util/json/BrooklynJacksonJsonProvider.java -- diff --git a/rest/rest-server/src/main/java/org/apache/brooklyn/rest/util/json/BrooklynJacksonJsonProvider.java b/rest/rest-server/src/main/java/org/apache/brooklyn/rest/util/json/BrooklynJacksonJsonProvider.java index f6d2a08..08265c7 100644 --- a/rest/rest-server/src/main/java/org/apache/brooklyn/rest/util/json/BrooklynJacksonJsonProvider.java +++ b/rest/rest-server/src/main/java/org/apache/brooklyn/rest/util/json/BrooklynJacksonJsonProvider.java @@ -35,7 +35,6 @@ import org.slf4j.LoggerFactory; import com.fasterxml.jackson.core.Version; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.module.SimpleModule; -import com.fasterxml.jackson.datatype.guava.GuavaModule; import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; public class BrooklynJacksonJsonProvider extends JacksonJsonProvider implements ManagementContextInjectable { @@ -141,7 +140,7 @@ public class BrooklynJacksonJsonProvider extends JacksonJsonProvider implements ObjectMapper mapper = new ObjectMapper(); mapper.setSerializerProvider(sp); -mapper.setVisibility(new PossiblyStrictPreferringFieldsVisibilityChecker()); +mapper.setVisibilityChecker(new PossiblyStrictPreferringFieldsVisibilityChecker()); SimpleModule mapperModule = new SimpleModule("Brooklyn", new Version(0, 0, 0, "ignored")); @@ -149,7 +148,8 @@ public class BrooklynJacksonJsonProvider extends JacksonJsonProvider implements new BidiSerialization.EntitySerialization(mgmt).install(mapperModule); new BidiSerialization.LocationSerialization(mgmt).install(mapperModule);
[3/3] brooklyn-server git commit: This closes #22
This closes #22 Fix jackson and resteasy deps Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/0a5f3e11 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/0a5f3e11 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/0a5f3e11 Branch: refs/heads/master Commit: 0a5f3e11c5dbc268a69ee9c7257b2371b0b60ec2 Parents: 1a97815 7dc0f8e Author: Sam CorbettAuthored: Thu Feb 11 21:39:09 2016 + Committer: Sam Corbett Committed: Thu Feb 11 21:39:09 2016 + -- karaf/features/src/main/feature/feature.xml | 1 - pom.xml | 8 +-- rest/rest-server/pom.xml| 4 -- .../util/json/BrooklynJacksonJsonProvider.java | 6 +- .../rest/util/json/MultimapSerializer.java | 62 5 files changed, 69 insertions(+), 12 deletions(-) --
[2/3] brooklyn-server git commit: Downgrade resteasy back to 3.0.8-Final
Downgrade resteasy back to 3.0.8-Final Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/7dc0f8e9 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/7dc0f8e9 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/7dc0f8e9 Branch: refs/heads/master Commit: 7dc0f8e9e9acbf09ce00820cd03bc6a2d91b0255 Parents: 5ccb6bf Author: Andrea TurliAuthored: Thu Feb 11 19:52:34 2016 +0100 Committer: Andrea Turli Committed: Thu Feb 11 20:09:36 2016 +0100 -- pom.xml | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/7dc0f8e9/pom.xml -- diff --git a/pom.xml b/pom.xml index c41c691..5bfe68a 100644 --- a/pom.xml +++ b/pom.xml @@ -91,13 +91,15 @@ false ${working.dir} - + 1.9.2 1.0.7 1.6.6 17.0 1.4.7 -2.4.5 + +2.4.5 +3.0.8.Final 1.19 4.4.1 3.3.2 @@ -131,7 +133,6 @@ 4.7.0 r8-20060801 1.0-b01-ea -3.0.14.Final 4.3 1.0_jdk5 3.1.0
[2/2] brooklyn-server git commit: This closes #42
This closes #42 Don't require rest-client users to append "v1" to the endpoint url Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/2845946a Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/2845946a Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/2845946a Branch: refs/heads/master Commit: 2845946a16403a9727c6b6d5b399649db1607456 Parents: 972854a 37f4942 Author: Sam CorbettAuthored: Mon Feb 29 14:00:36 2016 + Committer: Sam Corbett Committed: Mon Feb 29 14:00:36 2016 + -- .../org/apache/brooklyn/rest/client/BrooklynApi.java | 14 -- .../rest/client/BrooklynApiRestClientTest.java | 15 +-- .../brooklyn/rest/client/BrooklynApiUtilTest.java| 6 +++--- 3 files changed, 28 insertions(+), 7 deletions(-) --
[11/11] brooklyn-server git commit: This closes #20
This closes #20 Add policy to stop applications after a period has elapsed Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/3f02ccca Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/3f02ccca Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/3f02ccca Branch: refs/heads/master Commit: 3f02cccac979810ba76ce6f1b217edde52decffc Parents: a25f66d 9b9dfa4 Author: Sam CorbettAuthored: Tue Feb 16 17:20:13 2016 + Committer: Sam Corbett Committed: Tue Feb 16 17:20:13 2016 + -- .../core/sensor/DurationSinceSensor.java| 118 .../core/sensor/http/HttpRequestSensor.java | 5 +- .../core/sensor/DurationSinceSensorTest.java| 73 ++ .../launcher/WebAppContextProvider.java | 6 + .../policy/action/StopAfterDurationPolicy.java | 135 +++ .../action/StopAfterDurationPolicyTest.java | 46 +++ .../org/apache/brooklyn/util/time/Duration.java | 6 +- 7 files changed, 386 insertions(+), 3 deletions(-) --
[02/11] brooklyn-server git commit: BROOKLYN-225: avoid NPE in SshMachineLocation cleanup
BROOKLYN-225: avoid NPE in SshMachineLocation cleanup Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/46bf6b54 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/46bf6b54 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/46bf6b54 Branch: refs/heads/master Commit: 46bf6b54365a0bdb0f80580a95a815a6ee85b8b8 Parents: 495b1d3 Author: Aled SageAuthored: Mon Feb 15 11:31:48 2016 + Committer: Aled Sage Committed: Mon Feb 15 11:31:48 2016 + -- .../location/ssh/SshMachineLocation.java| 26 1 file changed, 16 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/46bf6b54/core/src/main/java/org/apache/brooklyn/location/ssh/SshMachineLocation.java -- diff --git a/core/src/main/java/org/apache/brooklyn/location/ssh/SshMachineLocation.java b/core/src/main/java/org/apache/brooklyn/location/ssh/SshMachineLocation.java index b059858..2ff9491 100644 --- a/core/src/main/java/org/apache/brooklyn/location/ssh/SshMachineLocation.java +++ b/core/src/main/java/org/apache/brooklyn/location/ssh/SshMachineLocation.java @@ -457,10 +457,13 @@ public class SshMachineLocation extends AbstractLocation implements MachineLocat .displayName("ssh-location cache cleaner").body(new Callable() { @Override public Void call() { try { -if (sshPoolCacheOrNull != null) sshPoolCacheOrNull.cleanUp(); +LoadingCache
[03/11] brooklyn-server git commit: SshMachineLocation: fix compile warnings
SshMachineLocation: fix compile warnings Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/a799cf86 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/a799cf86 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/a799cf86 Branch: refs/heads/master Commit: a799cf86dc6c61af281fb843f763abe4e6ced059 Parents: 46bf6b5 Author: Aled SageAuthored: Mon Feb 15 11:33:39 2016 + Committer: Aled Sage Committed: Mon Feb 15 11:33:39 2016 + -- .../org/apache/brooklyn/location/ssh/SshMachineLocation.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/a799cf86/core/src/main/java/org/apache/brooklyn/location/ssh/SshMachineLocation.java -- diff --git a/core/src/main/java/org/apache/brooklyn/location/ssh/SshMachineLocation.java b/core/src/main/java/org/apache/brooklyn/location/ssh/SshMachineLocation.java index 2ff9491..50349e6 100644 --- a/core/src/main/java/org/apache/brooklyn/location/ssh/SshMachineLocation.java +++ b/core/src/main/java/org/apache/brooklyn/location/ssh/SshMachineLocation.java @@ -179,12 +179,14 @@ public class SshMachineLocation extends AbstractLocation implements MachineLocat public static final ConfigKey DETECT_MACHINE_DETAILS = ConfigKeys.newBooleanConfigKey("detectMachineDetails", "Attempt to detect machine details automatically. Works with SSH-accessible Linux instances.", true); +@SuppressWarnings("serial") public static final ConfigKey PRIVATE_ADDRESSES = ConfigKeys.newConfigKey( new TypeToken () {}, "privateAddresses", "Private addresses of this machine, e.g. those within the private network", null); +@SuppressWarnings("serial") public static final ConfigKey > TCP_PORT_MAPPINGS = ConfigKeys.newConfigKey( new TypeToken >() {}, "tcpPortMappings", @@ -248,7 +250,7 @@ public class SshMachineLocation extends AbstractLocation implements MachineLocat * i.e. they can be specified per command on the tool */ // TODO: Fully specify. -public static final Set REUSABLE_SSH_PROPS = ImmutableSet.of( +public static final Set REUSABLE_SSH_PROPS = ImmutableSet. of( STDOUT, STDERR, SCRIPT_DIR, CLOSE_CONNECTION, SshTool.PROP_SCRIPT_HEADER, SshTool.PROP_PERMISSIONS, SshTool.PROP_LAST_MODIFICATION_DATE, SshTool.PROP_LAST_ACCESS_DATE, SshTool.PROP_OWNER_UID, SshTool.PROP_SSH_RETRY_DELAY);
[01/11] brooklyn-server git commit: Add DurationSinceSensor
Repository: brooklyn-server Updated Branches: refs/heads/master 495b1d335 -> 3f02cccac Add DurationSinceSensor Records the duration since an event. Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/d2cdb41c Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/d2cdb41c Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/d2cdb41c Branch: refs/heads/master Commit: d2cdb41c7a3e01a26002799d59fe68836d1fd7d5 Parents: 0a5f3e1 Author: Sam CorbettAuthored: Wed Feb 10 17:12:24 2016 + Committer: Sam Corbett Committed: Fri Feb 12 13:36:38 2016 + -- .../core/sensor/DurationSinceSensor.java| 108 +++ .../core/sensor/http/HttpRequestSensor.java | 5 +- .../core/sensor/DurationSinceSensorTest.java| 73 + 3 files changed, 184 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/d2cdb41c/core/src/main/java/org/apache/brooklyn/core/sensor/DurationSinceSensor.java -- diff --git a/core/src/main/java/org/apache/brooklyn/core/sensor/DurationSinceSensor.java b/core/src/main/java/org/apache/brooklyn/core/sensor/DurationSinceSensor.java new file mode 100644 index 000..9dc89a5 --- /dev/null +++ b/core/src/main/java/org/apache/brooklyn/core/sensor/DurationSinceSensor.java @@ -0,0 +1,108 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.brooklyn.core.sensor; + +import java.util.concurrent.Callable; + +import org.apache.brooklyn.api.entity.Entity; +import org.apache.brooklyn.api.entity.EntityLocal; +import org.apache.brooklyn.api.sensor.AttributeSensor; +import org.apache.brooklyn.config.ConfigKey; +import org.apache.brooklyn.core.config.ConfigKeys; +import org.apache.brooklyn.core.effector.AddSensor; +import org.apache.brooklyn.feed.function.FunctionFeed; +import org.apache.brooklyn.feed.function.FunctionPollConfig; +import org.apache.brooklyn.util.core.config.ConfigBag; +import org.apache.brooklyn.util.time.Duration; + +import com.google.common.base.Supplier; +import com.google.common.reflect.TypeToken; + +public class DurationSinceSensor extends AddSensor { + +private static final Supplier CURRENT_TIME_SUPPLIER = new CurrentTimeSupplier(); + +public static final ConfigKey EPOCH_SUPPLIER = ConfigKeys.builder(new TypeToken () {}) +.name("duration.since.epochsupplier") +.description("The source of time from which durations are measured. Defaults to System.currentTimeMillis.") +.defaultValue(CURRENT_TIME_SUPPLIER) +.build(); + +public static final ConfigKey TIME_SUPPLIER = ConfigKeys.builder(new TypeToken () {}) +.name("duration.since.timesupplier") +.description("The source of the current time. Defaults to System.currentTimeMillis.") +.defaultValue(CURRENT_TIME_SUPPLIER) +.build(); + +private final Supplier epochSupplier; +private final Supplier timeSupplier; +private final AttributeSensor epochSensor; + +public DurationSinceSensor(ConfigBag params) { +super(params); +epochSupplier = params.get(EPOCH_SUPPLIER); +timeSupplier = params.get(TIME_SUPPLIER); +epochSensor = Sensors.newLongSensor(sensor.getName() + ".epoch"); +} + +@Override +public void apply(final EntityLocal entity) { +super.apply(entity); + +if (entity.sensors().get(epochSensor) == null) { +entity.sensors().set(epochSensor, epochSupplier.get()); +} + +FunctionFeed feed = FunctionFeed.builder() +.entity(entity) +.poll(new FunctionPollConfig<>(sensor).callable(new UpdateTimeSince(entity))) +.period(period) +.build(); + +entity.addFeed(feed); +} + +private static
[06/11] brooklyn-server git commit: Adds pre- and post- customize commands
Adds pre- and post- customize commands Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/cef7f468 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/cef7f468 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/cef7f468 Branch: refs/heads/master Commit: cef7f4683effbd208317f2d558766922bea8cdd4 Parents: 495b1d3 Author: Martin HarrisAuthored: Mon Feb 15 13:11:12 2016 + Committer: Martin Harris Committed: Tue Feb 16 15:47:48 2016 + -- .../core/entity/BrooklynConfigKeys.java | 4 +++ .../base/AbstractSoftwareProcessDriver.java | 16 +-- .../base/AbstractSoftwareProcessSshDriver.java | 18 ++-- .../AbstractSoftwareProcessWinRmDriver.java | 30 .../entity/software/base/SoftwareProcess.java | 6 .../software/base/VanillaWindowsProcess.java| 6 ...SoftwareProcessSshDriverIntegrationTest.java | 22 ++ ...laWindowsProcessWinrmExitStatusLiveTest.java | 4 +++ 8 files changed, 97 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/cef7f468/core/src/main/java/org/apache/brooklyn/core/entity/BrooklynConfigKeys.java -- diff --git a/core/src/main/java/org/apache/brooklyn/core/entity/BrooklynConfigKeys.java b/core/src/main/java/org/apache/brooklyn/core/entity/BrooklynConfigKeys.java index 974f88c..607a22b 100644 --- a/core/src/main/java/org/apache/brooklyn/core/entity/BrooklynConfigKeys.java +++ b/core/src/main/java/org/apache/brooklyn/core/entity/BrooklynConfigKeys.java @@ -102,6 +102,10 @@ public class BrooklynConfigKeys { "Command to be run prior to the install method being called on the driver"); public static final ConfigKey POST_INSTALL_COMMAND = ConfigKeys.newStringConfigKey("post.install.command", "Command to be run after the install method being called on the driver"); +public static final ConfigKey PRE_CUSTOMIZE_COMMAND = ConfigKeys.newStringConfigKey("pre.customize.command", +"Command to be run prior to the customize method being called on the driver"); +public static final ConfigKey POST_CUSTOMIZE_COMMAND = ConfigKeys.newStringConfigKey("post.customize.command", +"Command to be run after the customize method being called on the driver"); public static final ConfigKey PRE_LAUNCH_COMMAND = ConfigKeys.newStringConfigKey("pre.launch.command", "Command to be run prior to the launch method being called on the driver"); public static final ConfigKey POST_LAUNCH_COMMAND = ConfigKeys.newStringConfigKey("post.launch.command", http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/cef7f468/software/base/src/main/java/org/apache/brooklyn/entity/software/base/AbstractSoftwareProcessDriver.java -- diff --git a/software/base/src/main/java/org/apache/brooklyn/entity/software/base/AbstractSoftwareProcessDriver.java b/software/base/src/main/java/org/apache/brooklyn/entity/software/base/AbstractSoftwareProcessDriver.java index 4ffeb1a..79a150c 100644 --- a/software/base/src/main/java/org/apache/brooklyn/entity/software/base/AbstractSoftwareProcessDriver.java +++ b/software/base/src/main/java/org/apache/brooklyn/entity/software/base/AbstractSoftwareProcessDriver.java @@ -147,8 +147,18 @@ public abstract class AbstractSoftwareProcessDriver implements SoftwareProcessDr }}); DynamicTasks.queue("customize", new Runnable() { public void run() { -waitForConfigKey(BrooklynConfigKeys.CUSTOMIZE_LATCH); -customize(); +DynamicTasks.queue("pre-customize-command", new Runnable() { public void run() { +runPreCustomizeCommand(); +}}); + +DynamicTasks.queue("customize (main)", new Runnable() { public void run() { +waitForConfigKey(BrooklynConfigKeys.CUSTOMIZE_LATCH); +customize(); +}}); + +DynamicTasks.queue("post-customize-command", new Runnable() { public void run() { +runPostCustomizeCommand(); +}}); }}); DynamicTasks.queue("launch", new Runnable() { public void run() { @@ -189,7 +199,9 @@ public abstract class AbstractSoftwareProcessDriver implements SoftwareProcessDr public abstract void setup(); public abstract void install(); public abstract void runPostInstallCommand(); +public abstract void runPreCustomizeCommand(); public abstract void customize(); +public abstract void
[05/11] brooklyn-server git commit: Prevent ApplicationBuilderOverridingTest hanging
Prevent ApplicationBuilderOverridingTest hanging I had an invalid entry in my brooklyn.properties, which caused builder.manage to fail. This caused the entire test to hang forever. Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/83727570 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/83727570 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/83727570 Branch: refs/heads/master Commit: 83727570672952d0a3f2fd2baccbf390ab8a6a34 Parents: 3cb3b8f Author: Aled SageAuthored: Mon Feb 15 12:11:59 2016 + Committer: Aled Sage Committed: Mon Feb 15 12:11:59 2016 + -- .../ApplicationBuilderOverridingTest.java | 26 +++- 1 file changed, 20 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/83727570/core/src/test/java/org/apache/brooklyn/core/entity/proxying/ApplicationBuilderOverridingTest.java -- diff --git a/core/src/test/java/org/apache/brooklyn/core/entity/proxying/ApplicationBuilderOverridingTest.java b/core/src/test/java/org/apache/brooklyn/core/entity/proxying/ApplicationBuilderOverridingTest.java index 824439b..912c434 100644 --- a/core/src/test/java/org/apache/brooklyn/core/entity/proxying/ApplicationBuilderOverridingTest.java +++ b/core/src/test/java/org/apache/brooklyn/core/entity/proxying/ApplicationBuilderOverridingTest.java @@ -40,13 +40,14 @@ import org.apache.brooklyn.core.entity.Entities; import org.apache.brooklyn.core.entity.EntityInternal; import org.apache.brooklyn.core.entity.StartableApplication; import org.apache.brooklyn.core.entity.factory.ApplicationBuilder; -import org.apache.brooklyn.core.mgmt.internal.LocalManagementContext; import org.apache.brooklyn.core.objs.proxy.EntityProxy; import org.apache.brooklyn.core.test.entity.LocalManagementContextForTests; import org.apache.brooklyn.core.test.entity.TestApplication; import org.apache.brooklyn.core.test.entity.TestEntity; import org.apache.brooklyn.entity.stock.BasicApplication; import org.apache.brooklyn.util.exceptions.Exceptions; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; @@ -57,6 +58,8 @@ import com.google.common.collect.Iterables; public class ApplicationBuilderOverridingTest { +private static final Logger LOG = LoggerFactory.getLogger(ApplicationBuilderOverridingTest.class); + private static final long TIMEOUT_MS = 10*1000; private ManagementContext spareManagementContext; @@ -65,7 +68,7 @@ public class ApplicationBuilderOverridingTest { @BeforeMethod(alwaysRun=true) public void setUp() throws Exception { -spareManagementContext = new LocalManagementContextForTests(); +spareManagementContext = LocalManagementContextForTests.newInstance(); executor = Executors.newCachedThreadPool(); } @@ -147,7 +150,7 @@ public class ApplicationBuilderOverridingTest { @Test(expectedExceptions=IllegalStateException.class) public void testRentrantCallToManageForbidden() { -ManagementContext secondManagementContext = new LocalManagementContext(); +ManagementContext secondManagementContext = LocalManagementContextForTests.newInstance(); try { app = new ApplicationBuilder() { @Override public void doBuild() { @@ -192,13 +195,14 @@ public class ApplicationBuilderOverridingTest { @Test public void testConcurrentCallToManageForbidden() throws Exception { +final AtomicReference err = new AtomicReference(); final CountDownLatch inbuildLatch = new CountDownLatch(1); final CountDownLatch continueLatch = new CountDownLatch(1); final ApplicationBuilder builder = new ApplicationBuilder() { @Override public void doBuild() { +inbuildLatch.countDown(); try { -inbuildLatch.countDown(); -continueLatch.await(); +assertTrue(continueLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS)); } catch (InterruptedException e) { throw Exceptions.propagate(e); } @@ -206,11 +210,21 @@ public class ApplicationBuilderOverridingTest { }; Future future = executor.submit(new Callable() { public StartableApplication call() { -return builder.manage(); +try { +return builder.manage(); +} catch (Throwable t) { +LOG.error("Problem
[09/11] brooklyn-server git commit: This closes #26
This closes #26 Adds pre- and post- customize commands Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/67a347db Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/67a347db Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/67a347db Branch: refs/heads/master Commit: 67a347db90886259047f4fc623f51a8a0c1e0077 Parents: 495b1d3 cef7f46 Author: Sam CorbettAuthored: Tue Feb 16 17:19:44 2016 + Committer: Sam Corbett Committed: Tue Feb 16 17:19:44 2016 + -- .../core/entity/BrooklynConfigKeys.java | 4 +++ .../base/AbstractSoftwareProcessDriver.java | 16 +-- .../base/AbstractSoftwareProcessSshDriver.java | 18 ++-- .../AbstractSoftwareProcessWinRmDriver.java | 30 .../entity/software/base/SoftwareProcess.java | 6 .../software/base/VanillaWindowsProcess.java| 6 ...SoftwareProcessSshDriverIntegrationTest.java | 22 ++ ...laWindowsProcessWinrmExitStatusLiveTest.java | 4 +++ 8 files changed, 97 insertions(+), 9 deletions(-) --
[08/11] brooklyn-server git commit: Add StopAfterDurationPolicy
Add StopAfterDurationPolicy Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/e162d209 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/e162d209 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/e162d209 Branch: refs/heads/master Commit: e162d2091c7ad744af33e59a0b5a3441a784a92b Parents: d2cdb41 Author: Sam CorbettAuthored: Thu Feb 11 12:28:37 2016 + Committer: Sam Corbett Committed: Tue Feb 16 16:55:46 2016 + -- .../core/sensor/DurationSinceSensor.java| 18 ++- .../policy/action/StopAfterDurationPolicy.java | 135 +++ .../action/StopAfterDurationPolicyTest.java | 46 +++ .../org/apache/brooklyn/util/time/Duration.java | 6 +- 4 files changed, 200 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/e162d209/core/src/main/java/org/apache/brooklyn/core/sensor/DurationSinceSensor.java -- diff --git a/core/src/main/java/org/apache/brooklyn/core/sensor/DurationSinceSensor.java b/core/src/main/java/org/apache/brooklyn/core/sensor/DurationSinceSensor.java index 9dc89a5..4be57d8 100644 --- a/core/src/main/java/org/apache/brooklyn/core/sensor/DurationSinceSensor.java +++ b/core/src/main/java/org/apache/brooklyn/core/sensor/DurationSinceSensor.java @@ -41,13 +41,15 @@ public class DurationSinceSensor extends AddSensor { public static final ConfigKey EPOCH_SUPPLIER = ConfigKeys.builder(new TypeToken () {}) .name("duration.since.epochsupplier") -.description("The source of time from which durations are measured. Defaults to System.currentTimeMillis.") +.description("The source of time from which durations are measured. Defaults to System.currentTimeMillis when " + +"if no supplier is given or the configured supplier returns null.") .defaultValue(CURRENT_TIME_SUPPLIER) .build(); public static final ConfigKey TIME_SUPPLIER = ConfigKeys.builder(new TypeToken () {}) .name("duration.since.timesupplier") -.description("The source of the current time. Defaults to System.currentTimeMillis.") +.description("The source of the current time. Defaults to System.currentTimeMillis if unconfigured or the " + +"supplier returns null.") .defaultValue(CURRENT_TIME_SUPPLIER) .build(); @@ -67,7 +69,11 @@ public class DurationSinceSensor extends AddSensor { super.apply(entity); if (entity.sensors().get(epochSensor) == null) { -entity.sensors().set(epochSensor, epochSupplier.get()); +Long epoch = epochSupplier.get(); +if (epoch == null) { +epoch = CURRENT_TIME_SUPPLIER.get(); +} +entity.sensors().set(epochSensor, epoch); } FunctionFeed feed = FunctionFeed.builder() @@ -98,7 +104,11 @@ public class DurationSinceSensor extends AddSensor { Long referencePoint = entity.sensors().get(epochSensor); // Defensive check. Someone has done something silly if this is false. if (referencePoint != null) { -return Duration.millis(timeSupplier.get() - referencePoint); +Long time = timeSupplier.get(); +if (time == null) { +time = CURRENT_TIME_SUPPLIER.get(); +} +return Duration.millis(time - referencePoint); } else { throw new IllegalStateException("Cannot calculate duration since sensor: " + entity + " missing required value for " + epochSensor); http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/e162d209/policy/src/main/java/org/apache/brooklyn/policy/action/StopAfterDurationPolicy.java -- diff --git a/policy/src/main/java/org/apache/brooklyn/policy/action/StopAfterDurationPolicy.java b/policy/src/main/java/org/apache/brooklyn/policy/action/StopAfterDurationPolicy.java new file mode 100644 index 000..3b5eefa --- /dev/null +++ b/policy/src/main/java/org/apache/brooklyn/policy/action/StopAfterDurationPolicy.java @@ -0,0 +1,135 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use
[07/11] brooklyn-server git commit: Better toString for WebAppContextProvider
Better toString for WebAppContextProvider Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/9b9dfa4c Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/9b9dfa4c Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/9b9dfa4c Branch: refs/heads/master Commit: 9b9dfa4cacd74e58379dbf15412dee8431da8f08 Parents: e162d20 Author: Sam CorbettAuthored: Thu Feb 11 15:14:06 2016 + Committer: Sam Corbett Committed: Tue Feb 16 16:55:46 2016 + -- .../org/apache/brooklyn/launcher/WebAppContextProvider.java| 6 ++ 1 file changed, 6 insertions(+) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/9b9dfa4c/launcher/src/main/java/org/apache/brooklyn/launcher/WebAppContextProvider.java -- diff --git a/launcher/src/main/java/org/apache/brooklyn/launcher/WebAppContextProvider.java b/launcher/src/main/java/org/apache/brooklyn/launcher/WebAppContextProvider.java index b6f955d..c845661 100644 --- a/launcher/src/main/java/org/apache/brooklyn/launcher/WebAppContextProvider.java +++ b/launcher/src/main/java/org/apache/brooklyn/launcher/WebAppContextProvider.java @@ -112,4 +112,10 @@ public class WebAppContextProvider { public String getWarUrl() { return warUrl; } + +@Override +public String toString() { +return warUrl + "@" + pathSpec; +} + }
[10/11] brooklyn-server git commit: This closes #27
This closes #27 Fix brooklyn-225 Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/a25f66df Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/a25f66df Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/a25f66df Branch: refs/heads/master Commit: a25f66dfad3e961b63163a6727b7adb384713ef5 Parents: 67a347d 8372757 Author: Sam CorbettAuthored: Tue Feb 16 17:19:49 2016 + Committer: Sam Corbett Committed: Tue Feb 16 17:19:49 2016 + -- .../location/ssh/SshMachineLocation.java| 30 +--- .../ApplicationBuilderOverridingTest.java | 26 + .../brooklyn/util/collections/MutableList.java | 11 +++ .../brooklyn/util/collections/MutableSet.java | 10 +++ .../util/collections/MutableListTest.java | 8 ++ .../util/collections/MutableSetTest.java| 10 +++ 6 files changed, 78 insertions(+), 17 deletions(-) --
[2/2] brooklyn-server git commit: This closes #64
This closes #64 Remove DISCLAIMER remnant Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/a16f8c74 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/a16f8c74 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/a16f8c74 Branch: refs/heads/master Commit: a16f8c740a782a3fdf08ac8cf15e0469604df8cd Parents: b8fe166 cc25554 Author: Sam CorbettAuthored: Thu Mar 17 18:25:02 2016 + Committer: Sam Corbett Committed: Thu Mar 17 18:25:02 2016 + -- utils/jmx/jmxmp-ssl-agent/src/main/license/DISCLAIMER.shaded | 8 1 file changed, 8 deletions(-) --
[1/2] brooklyn-server git commit: Disable tests on Windows
Repository: brooklyn-server Updated Branches: refs/heads/master b70c2b0b6 -> b8fe16647 Disable tests on Windows Windows doesn't support the expected file attributes, disable tests. Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/8dbd6542 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/8dbd6542 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/8dbd6542 Branch: refs/heads/master Commit: 8dbd6542623562e3dbc1ab29730ea12efe58e704 Parents: b70c2b0 Author: Svetoslav NeykovAuthored: Thu Mar 17 18:38:34 2016 +0200 Committer: Svetoslav Neykov Committed: Thu Mar 17 18:49:09 2016 +0200 -- .../launcher/common/BrooklynPropertiesFactoryHelperTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/8dbd6542/launcher-common/src/test/java/org/apache/brooklyn/launcher/common/BrooklynPropertiesFactoryHelperTest.java -- diff --git a/launcher-common/src/test/java/org/apache/brooklyn/launcher/common/BrooklynPropertiesFactoryHelperTest.java b/launcher-common/src/test/java/org/apache/brooklyn/launcher/common/BrooklynPropertiesFactoryHelperTest.java index 9629bd5..9c31fcc 100644 --- a/launcher-common/src/test/java/org/apache/brooklyn/launcher/common/BrooklynPropertiesFactoryHelperTest.java +++ b/launcher-common/src/test/java/org/apache/brooklyn/launcher/common/BrooklynPropertiesFactoryHelperTest.java @@ -43,7 +43,7 @@ import com.google.common.io.Files; public class BrooklynPropertiesFactoryHelperTest { -@Test +@Test(groups="UNIX") public void testChecksGlobalBrooklynPropertiesPermissionsX00() throws Exception { File propsFile = File.createTempFile("testChecksGlobalBrooklynPropertiesPermissionsX00", ".properties"); propsFile.setReadable(true, false); @@ -59,7 +59,7 @@ public class BrooklynPropertiesFactoryHelperTest { } } -@Test +@Test(groups="UNIX") public void testChecksLocalBrooklynPropertiesPermissionsX00() throws Exception { File propsFile = File.createTempFile("testChecksLocalBrooklynPropertiesPermissionsX00", ".properties"); propsFile.setReadable(true, false);
[6/9] brooklyn-server git commit: Remove jersey compatibility
http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/3be4fe11/rest/rest-server-jersey/src/main/java/org/apache/brooklyn/rest/filter/SwaggerFilter.java -- diff --git a/rest/rest-server-jersey/src/main/java/org/apache/brooklyn/rest/filter/SwaggerFilter.java b/rest/rest-server-jersey/src/main/java/org/apache/brooklyn/rest/filter/SwaggerFilter.java deleted file mode 100644 index ce8b747..000 --- a/rest/rest-server-jersey/src/main/java/org/apache/brooklyn/rest/filter/SwaggerFilter.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.brooklyn.rest.filter; - -import java.io.IOException; - -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletContext; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; - -import org.apache.brooklyn.rest.apidoc.RestApiResourceScanner; - -import io.swagger.config.ScannerFactory; -import io.swagger.models.Info; -import io.swagger.models.License; -import io.swagger.models.Swagger; - -/** - * Bootstraps swagger. - * - * Swagger was intended to run as a servlet. - * - * @author Ciprian Ciubotariu- */ -public class SwaggerFilter implements Filter { - -static Info info = new Info() -.title("Brooklyn API Documentation") -.version("v1") // API version, not BROOKLYN_VERSION -.license(new License() -.name("Apache 2.0") -.url("http://www.apache.org/licenses/LICENSE-2.0.html;)); - -@Override -public void init(FilterConfig filterConfig) throws ServletException { -//ReflectiveJaxrsScanner scanner = new ReflectiveJaxrsScanner(); -// scanner.setResourcePackage("org.apache.brooklyn.rest.api,org.apache.brooklyn.rest.apidoc,org.apache.brooklyn.rest.resources"); -//ScannerFactory.setScanner(scanner); -ScannerFactory.setScanner(new RestApiResourceScanner()); - -ServletContext context = filterConfig.getServletContext(); -Swagger swagger = new Swagger() -.info(info); -context.setAttribute("swagger", swagger); -} - -@Override -public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { -chain.doFilter(request, response); -} - -@Override -public void destroy() { -} - -} http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/3be4fe11/rest/rest-server-jersey/src/main/java/org/apache/brooklyn/rest/resources/ApiListingResource.java -- diff --git a/rest/rest-server-jersey/src/main/java/org/apache/brooklyn/rest/resources/ApiListingResource.java b/rest/rest-server-jersey/src/main/java/org/apache/brooklyn/rest/resources/ApiListingResource.java deleted file mode 100644 index 74f8426..000 --- a/rest/rest-server-jersey/src/main/java/org/apache/brooklyn/rest/resources/ApiListingResource.java +++ /dev/null @@ -1,260 +0,0 @@ -/* - * Copyright 2015 The Apache Software Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.brooklyn.rest.resources; - -import com.sun.jersey.spi.container.servlet.WebConfig; -import io.swagger.annotations.ApiOperation; -import io.swagger.config.FilterFactory; -import io.swagger.config.Scanner; -import io.swagger.config.ScannerFactory; -import io.swagger.config.SwaggerConfig; -import io.swagger.core.filter.SpecFilter; -import
[5/9] brooklyn-server git commit: Remove jersey compatibility
http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/3be4fe11/rest/rest-server-jersey/src/test/java/org/apache/brooklyn/rest/domain/ApiErrorTest.java -- diff --git a/rest/rest-server-jersey/src/test/java/org/apache/brooklyn/rest/domain/ApiErrorTest.java b/rest/rest-server-jersey/src/test/java/org/apache/brooklyn/rest/domain/ApiErrorTest.java deleted file mode 100644 index f73bd30..000 --- a/rest/rest-server-jersey/src/test/java/org/apache/brooklyn/rest/domain/ApiErrorTest.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.brooklyn.rest.domain; - -import static org.apache.brooklyn.rest.util.RestApiTestUtils.asJson; -import static org.apache.brooklyn.rest.util.RestApiTestUtils.fromJson; -import static org.apache.brooklyn.rest.util.RestApiTestUtils.jsonFixture; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertFalse; - -import java.io.IOException; -import java.net.URI; - -import org.testng.annotations.Test; -import org.testng.util.Strings; - -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; - -public class ApiErrorTest extends AbstractDomainTest { - -@Override -protected String getPath() { -return "fixtures/api-error-basic.json"; -} - -@Override -protected Object getDomainObject() { -return ApiError.builder() -.message("explanatory message") -.details("accompanying details") -.build(); -} - -@Test -public void testSerializeApiErrorFromThrowable() throws IOException { -Exception e = new Exception("error"); -e.setStackTrace(Thread.currentThread().getStackTrace()); - -ApiError error = ApiError.builderFromThrowable(e).build(); -ApiError deserialised = fromJson(asJson(error), ApiError.class); - -assertFalse(Strings.isNullOrEmpty(deserialised.getDetails()), "Expected details to contain exception stack trace"); -assertEquals(deserialised, error); -} - -@Test -public void testSerializeApiErrorWithoutDetails() throws IOException { -ApiError error = ApiError.builder() -.message("explanatory message") -.build(); -assertEquals(asJson(error), jsonFixture("fixtures/api-error-no-details.json")); -} - -} http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/3be4fe11/rest/rest-server-jersey/src/test/java/org/apache/brooklyn/rest/domain/ApplicationSpecTest.java -- diff --git a/rest/rest-server-jersey/src/test/java/org/apache/brooklyn/rest/domain/ApplicationSpecTest.java b/rest/rest-server-jersey/src/test/java/org/apache/brooklyn/rest/domain/ApplicationSpecTest.java deleted file mode 100644 index b2690d6..000 --- a/rest/rest-server-jersey/src/test/java/org/apache/brooklyn/rest/domain/ApplicationSpecTest.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.brooklyn.rest.domain; - -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; - -public class ApplicationSpecTest extends AbstractDomainTest { - -@Override -protected String getPath() { -return "fixtures/application-spec.json"; -} - -
[2/9] brooklyn-server git commit: Remove jersey compatibility
http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/3be4fe11/rest/rest-server-jersey/src/test/java/org/apache/brooklyn/rest/resources/UsageResourceTest.java -- diff --git a/rest/rest-server-jersey/src/test/java/org/apache/brooklyn/rest/resources/UsageResourceTest.java b/rest/rest-server-jersey/src/test/java/org/apache/brooklyn/rest/resources/UsageResourceTest.java deleted file mode 100644 index 72392fe..000 --- a/rest/rest-server-jersey/src/test/java/org/apache/brooklyn/rest/resources/UsageResourceTest.java +++ /dev/null @@ -1,443 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.brooklyn.rest.resources; - -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertTrue; - -import java.util.Arrays; -import java.util.Calendar; -import java.util.GregorianCalendar; -import java.util.List; -import java.util.Map; -import java.util.concurrent.Callable; -import java.util.concurrent.TimeUnit; - -import javax.ws.rs.core.Response; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Test; -import org.apache.brooklyn.api.entity.EntitySpec; -import org.apache.brooklyn.api.location.Location; -import org.apache.brooklyn.api.location.LocationSpec; -import org.apache.brooklyn.api.location.NoMachinesAvailableException; -import org.apache.brooklyn.core.mgmt.internal.LocalUsageManager; -import org.apache.brooklyn.core.mgmt.internal.ManagementContextInternal; -import org.apache.brooklyn.core.test.entity.TestApplication; -import org.apache.brooklyn.entity.software.base.SoftwareProcessEntityTest; -import org.apache.brooklyn.location.localhost.LocalhostMachineProvisioningLocation; -import org.apache.brooklyn.location.ssh.SshMachineLocation; -import org.apache.brooklyn.rest.domain.ApplicationSpec; -import org.apache.brooklyn.rest.domain.Status; -import org.apache.brooklyn.rest.domain.TaskSummary; -import org.apache.brooklyn.rest.domain.UsageStatistic; -import org.apache.brooklyn.rest.domain.UsageStatistics; -import org.apache.brooklyn.rest.testing.BrooklynRestResourceTest; -import org.apache.brooklyn.rest.testing.mocks.RestMockSimpleEntity; -import org.apache.brooklyn.util.repeat.Repeater; -import org.apache.brooklyn.util.time.Time; - -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Iterables; -import com.sun.jersey.api.client.ClientResponse; -import com.sun.jersey.api.client.GenericType; - -public class UsageResourceTest extends BrooklynRestResourceTest { - -@SuppressWarnings("unused") -private static final Logger LOG = LoggerFactory.getLogger(UsageResourceTest.class); - -private static final long TIMEOUT_MS = 10*1000; - -private Calendar testStartTime; - -private final ApplicationSpec simpleSpec = ApplicationSpec.builder().name("simple-app"). -entities(ImmutableSet.of(new org.apache.brooklyn.rest.domain.EntitySpec("simple-ent", RestMockSimpleEntity.class.getName(. -locations(ImmutableSet.of("localhost")). -build(); - -@BeforeMethod(alwaysRun=true) -public void setUpMethod() { - ((ManagementContextInternal)getManagementContext()).getStorage().remove(LocalUsageManager.APPLICATION_USAGE_KEY); - ((ManagementContextInternal)getManagementContext()).getStorage().remove(LocalUsageManager.LOCATION_USAGE_KEY); -testStartTime = new GregorianCalendar(); -} - -@Test -public void testListApplicationUsages() throws Exception { -// Create an app -Calendar preStart = new GregorianCalendar(); -String appId = createApp(simpleSpec); -Calendar postStart = new GregorianCalendar(); - -// We will retrieve usage from one millisecond after start; this guarantees to not be -// told about both STARTING+RUNNING, which could otherwise happen if they are in the -// same milliscond. -Calendar afterPostStart = Time.newCalendarFromMillisSinceEpochUtc(postStart.getTime().getTime()+1); - -//
[8/9] brooklyn-server git commit: Fix failing tests - add missing test dependency
Fix failing tests - add missing test dependency Test dependencies are not transitive, all need to be explicit. Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/5838d166 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/5838d166 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/5838d166 Branch: refs/heads/master Commit: 5838d166f2bbe191bf1b8d1541ee36d3479fe96f Parents: 3be4fe1 Author: Svetoslav NeykovAuthored: Fri Apr 1 09:14:28 2016 +0300 Committer: Svetoslav Neykov Committed: Fri Apr 1 09:31:12 2016 +0300 -- launcher/pom.xml | 7 +++ 1 file changed, 7 insertions(+) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/5838d166/launcher/pom.xml -- diff --git a/launcher/pom.xml b/launcher/pom.xml index 2ecb2f8..7bf7a11 100644 --- a/launcher/pom.xml +++ b/launcher/pom.xml @@ -187,6 +187,13 @@ org.apache.brooklyn +brooklyn-rest-resources +${project.version} +tests +test + + +org.apache.brooklyn brooklyn-rest-server ${project.version} tests
[7/9] brooklyn-server git commit: Remove jersey compatibility
Remove jersey compatibility Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/3be4fe11 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/3be4fe11 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/3be4fe11 Branch: refs/heads/master Commit: 3be4fe11e74b01a85234fe5d0c96d043d3cb44e1 Parents: 36a2918 Author: Svetoslav NeykovAuthored: Thu Mar 31 11:37:30 2016 +0300 Committer: Svetoslav Neykov Committed: Fri Apr 1 09:31:08 2016 +0300 -- camp/camp-server-jersey/pom.xml | 225 -- .../brooklyn/camp/server/RestApiSetup.java | 53 -- .../rest/resource/ApiListingResource.java | 260 --- .../rest/resource/ApidocRestResource.java | 32 - .../src/main/webapp/WEB-INF/web.xml | 142 camp/pom.xml| 1 - karaf/features/src/main/feature/feature.xml | 3 - launcher/pom.xml| 25 +- parent/pom.xml | 59 -- pom.xml | 3 - rest/rest-client/pom.xml| 13 - rest/rest-server-jersey/pom.xml | 351 -- .../org/apache/brooklyn/rest/RestApiSetup.java | 113 --- .../rest/filter/EntitlementContextFilter.java | 63 -- .../rest/filter/HaHotCheckResourceFilter.java | 196 -- .../brooklyn/rest/filter/NoCacheFilter.java | 42 -- .../rest/filter/RequestTaggingRsFilter.java | 76 -- .../brooklyn/rest/filter/SwaggerFilter.java | 76 -- .../rest/resources/ApiListingResource.java | 260 --- .../brooklyn/rest/resources/ApidocResource.java | 33 - .../brooklyn/rest/util/FormMapProvider.java | 81 --- .../main/resources/build-metadata.properties| 18 - .../src/main/webapp/WEB-INF/web.xml | 149 .../BrooklynPropertiesSecurityFilterTest.java | 151 .../brooklyn/rest/BrooklynRestApiLauncher.java | 498 - .../rest/BrooklynRestApiLauncherTest.java | 77 -- .../BrooklynRestApiLauncherTestFixture.java | 109 --- .../apache/brooklyn/rest/HaHotCheckTest.java| 160 - .../brooklyn/rest/HaMasterCheckFilterTest.java | 218 -- .../rest/domain/AbstractDomainTest.java | 44 -- .../brooklyn/rest/domain/ApiErrorTest.java | 71 -- .../rest/domain/ApplicationSpecTest.java| 40 -- .../brooklyn/rest/domain/ApplicationTest.java | 87 --- .../rest/domain/EffectorSummaryTest.java| 44 -- .../brooklyn/rest/domain/EntitySpecTest.java| 48 -- .../brooklyn/rest/domain/EntitySummaryTest.java | 48 -- .../brooklyn/rest/domain/LocationSpecTest.java | 58 -- .../rest/domain/LocationSummaryTest.java| 41 -- .../brooklyn/rest/domain/SensorSummaryTest.java | 103 --- .../rest/domain/VersionSummaryTest.java | 49 -- .../AbstractRestApiEntitlementsTest.java| 111 --- .../ActivityApiEntitlementsTest.java| 122 .../AuthenticateAnyoneSecurityProvider.java | 41 -- .../EntityConfigApiEntitlementsTest.java| 103 --- .../entitlement/SensorApiEntitlementsTest.java | 108 --- .../entitlement/ServerApiEntitlementsTest.java | 34 - .../StaticDelegatingEntitlementManager.java | 37 - .../rest/resources/AccessResourceTest.java | 68 -- .../rest/resources/ApidocResourceTest.java | 173 - .../ApplicationResourceIntegrationTest.java | 133 .../rest/resources/ApplicationResourceTest.java | 701 --- .../rest/resources/CatalogResetTest.java| 113 --- .../rest/resources/CatalogResourceTest.java | 515 -- .../rest/resources/DelegatingPrintStream.java | 183 - .../rest/resources/DescendantsTest.java | 130 .../resources/EntityConfigResourceTest.java | 172 - .../rest/resources/EntityResourceTest.java | 189 - .../rest/resources/ErrorResponseTest.java | 98 --- .../rest/resources/LocationResourceTest.java| 188 - .../rest/resources/PolicyResourceTest.java | 145 .../rest/resources/ScriptResourceTest.java | 54 -- .../SensorResourceIntegrationTest.java | 82 --- .../rest/resources/SensorResourceTest.java | 271 --- .../ServerResourceIntegrationTest.java | 125 .../rest/resources/ServerResourceTest.java | 168 - .../rest/resources/ServerShutdownTest.java | 185 - .../rest/resources/UsageResourceTest.java | 443 .../rest/resources/VersionResourceTest.java | 52 -- .../rest/security/PasswordHasherTest.java | 37 - .../security/provider/TestSecurityProvider.java | 46 -- .../test/config/render/TestRendererHints.java | 36 - .../brooklynnode/DeployBlueprintTest.java |
[1/9] brooklyn-server git commit: Remove jersey compatibility
Repository: brooklyn-server Updated Branches: refs/heads/master dc6a313d7 -> d27d6c72b http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/3be4fe11/rest/rest-server-jersey/src/test/java/org/apache/brooklyn/rest/util/EntityLocationUtilsTest.java -- diff --git a/rest/rest-server-jersey/src/test/java/org/apache/brooklyn/rest/util/EntityLocationUtilsTest.java b/rest/rest-server-jersey/src/test/java/org/apache/brooklyn/rest/util/EntityLocationUtilsTest.java deleted file mode 100644 index 3aee845..000 --- a/rest/rest-server-jersey/src/test/java/org/apache/brooklyn/rest/util/EntityLocationUtilsTest.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.brooklyn.rest.util; - -import static org.testng.Assert.assertEquals; - -import java.util.Arrays; -import java.util.Map; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Test; -import org.apache.brooklyn.api.entity.EntitySpec; -import org.apache.brooklyn.api.location.Location; -import org.apache.brooklyn.core.entity.Entities; -import org.apache.brooklyn.core.location.AbstractLocation; -import org.apache.brooklyn.core.location.geo.HostGeoInfo; -import org.apache.brooklyn.core.location.internal.LocationInternal; -import org.apache.brooklyn.core.test.BrooklynAppUnitTestSupport; -import org.apache.brooklyn.entity.software.base.SoftwareProcess; -import org.apache.brooklyn.rest.testing.mocks.RestMockSimpleEntity; - -import com.google.common.collect.ImmutableList; - -public class EntityLocationUtilsTest extends BrooklynAppUnitTestSupport { - -private static final Logger log = LoggerFactory.getLogger(EntityLocationUtilsTest.class); - -private Location loc; - -@BeforeMethod(alwaysRun=true) -@Override -public void setUp() throws Exception { -super.setUp(); -loc = mgmt.getLocationRegistry().getLocationManaged("localhost"); -((AbstractLocation)loc).setHostGeoInfo(new HostGeoInfo("localhost", "localhost", 50, 0)); -} - -@Test -public void testCount() { -@SuppressWarnings("unused") -SoftwareProcess r1 = app.createAndManageChild(EntitySpec.create(SoftwareProcess.class, RestMockSimpleEntity.class)); -SoftwareProcess r2 = app.createAndManageChild(EntitySpec.create(SoftwareProcess.class, RestMockSimpleEntity.class)); -Entities.start(app, Arrays.asList(loc)); - -Entities.dumpInfo(app); - -log.info("r2loc: "+r2.getLocations()); -log.info("props: "+((LocationInternal)r2.getLocations().iterator().next()).config().getBag().getAllConfig()); - -Mapcounts = new EntityLocationUtils(mgmt).countLeafEntitiesByLocatedLocations(); -log.info("count: "+counts); -assertEquals(ImmutableList.copyOf(counts.values()), ImmutableList.of(2), "counts="+counts); -} -} http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/3be4fe11/rest/rest-server-jersey/src/test/java/org/apache/brooklyn/rest/util/NoOpRecordingShutdownHandler.java -- diff --git a/rest/rest-server-jersey/src/test/java/org/apache/brooklyn/rest/util/NoOpRecordingShutdownHandler.java b/rest/rest-server-jersey/src/test/java/org/apache/brooklyn/rest/util/NoOpRecordingShutdownHandler.java deleted file mode 100644 index a99d3d9..000 --- a/rest/rest-server-jersey/src/test/java/org/apache/brooklyn/rest/util/NoOpRecordingShutdownHandler.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in
[9/9] brooklyn-server git commit: This closes #95
This closes #95 Remove jersey compatibility Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/d27d6c72 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/d27d6c72 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/d27d6c72 Branch: refs/heads/master Commit: d27d6c72b570405f71ea8316f0bda6581b8237ea Parents: dc6a313 5838d16 Author: Sam CorbettAuthored: Thu Apr 7 12:13:43 2016 +0100 Committer: Sam Corbett Committed: Thu Apr 7 12:13:43 2016 +0100 -- camp/camp-server-jersey/pom.xml | 225 -- .../brooklyn/camp/server/RestApiSetup.java | 53 -- .../rest/resource/ApiListingResource.java | 260 --- .../rest/resource/ApidocRestResource.java | 32 - .../src/main/webapp/WEB-INF/web.xml | 142 camp/pom.xml| 1 - karaf/features/src/main/feature/feature.xml | 3 - launcher/pom.xml| 32 +- parent/pom.xml | 59 -- pom.xml | 3 - rest/rest-client/pom.xml| 13 - rest/rest-server-jersey/pom.xml | 351 -- .../org/apache/brooklyn/rest/RestApiSetup.java | 113 --- .../rest/filter/EntitlementContextFilter.java | 63 -- .../rest/filter/HaHotCheckResourceFilter.java | 196 -- .../brooklyn/rest/filter/NoCacheFilter.java | 42 -- .../rest/filter/RequestTaggingRsFilter.java | 76 -- .../brooklyn/rest/filter/SwaggerFilter.java | 76 -- .../rest/resources/ApiListingResource.java | 260 --- .../brooklyn/rest/resources/ApidocResource.java | 33 - .../brooklyn/rest/util/FormMapProvider.java | 81 --- .../main/resources/build-metadata.properties| 18 - .../src/main/webapp/WEB-INF/web.xml | 149 .../BrooklynPropertiesSecurityFilterTest.java | 151 .../brooklyn/rest/BrooklynRestApiLauncher.java | 498 - .../rest/BrooklynRestApiLauncherTest.java | 77 -- .../BrooklynRestApiLauncherTestFixture.java | 109 --- .../apache/brooklyn/rest/HaHotCheckTest.java| 160 - .../brooklyn/rest/HaMasterCheckFilterTest.java | 218 -- .../rest/domain/AbstractDomainTest.java | 44 -- .../brooklyn/rest/domain/ApiErrorTest.java | 71 -- .../rest/domain/ApplicationSpecTest.java| 40 -- .../brooklyn/rest/domain/ApplicationTest.java | 87 --- .../rest/domain/EffectorSummaryTest.java| 44 -- .../brooklyn/rest/domain/EntitySpecTest.java| 48 -- .../brooklyn/rest/domain/EntitySummaryTest.java | 48 -- .../brooklyn/rest/domain/LocationSpecTest.java | 58 -- .../rest/domain/LocationSummaryTest.java| 41 -- .../brooklyn/rest/domain/SensorSummaryTest.java | 103 --- .../rest/domain/VersionSummaryTest.java | 49 -- .../AbstractRestApiEntitlementsTest.java| 111 --- .../ActivityApiEntitlementsTest.java| 122 .../AuthenticateAnyoneSecurityProvider.java | 41 -- .../EntityConfigApiEntitlementsTest.java| 103 --- .../entitlement/SensorApiEntitlementsTest.java | 108 --- .../entitlement/ServerApiEntitlementsTest.java | 34 - .../StaticDelegatingEntitlementManager.java | 37 - .../rest/resources/AccessResourceTest.java | 68 -- .../rest/resources/ApidocResourceTest.java | 173 - .../ApplicationResourceIntegrationTest.java | 133 .../rest/resources/ApplicationResourceTest.java | 701 --- .../rest/resources/CatalogResetTest.java| 113 --- .../rest/resources/CatalogResourceTest.java | 515 -- .../rest/resources/DelegatingPrintStream.java | 183 - .../rest/resources/DescendantsTest.java | 130 .../resources/EntityConfigResourceTest.java | 172 - .../rest/resources/EntityResourceTest.java | 189 - .../rest/resources/ErrorResponseTest.java | 98 --- .../rest/resources/LocationResourceTest.java| 188 - .../rest/resources/PolicyResourceTest.java | 145 .../rest/resources/ScriptResourceTest.java | 54 -- .../SensorResourceIntegrationTest.java | 82 --- .../rest/resources/SensorResourceTest.java | 271 --- .../ServerResourceIntegrationTest.java | 125 .../rest/resources/ServerResourceTest.java | 168 - .../rest/resources/ServerShutdownTest.java | 185 - .../rest/resources/UsageResourceTest.java | 443 .../rest/resources/VersionResourceTest.java | 52 -- .../rest/security/PasswordHasherTest.java | 37 - .../security/provider/TestSecurityProvider.java | 46 -- .../test/config/render/TestRendererHints.java | 36 - .../brooklynnode/DeployBlueprintTest.java
brooklyn-server git commit: Add missing license header
Repository: brooklyn-server Updated Branches: refs/heads/master cce75a105 -> 3f8171dc8 Add missing license header Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/3f8171dc Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/3f8171dc Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/3f8171dc Branch: refs/heads/master Commit: 3f8171dc868a8e249b57a5a16fb90c7a8aa565bc Parents: cce75a1 Author: Sam CorbettAuthored: Wed Apr 6 11:18:23 2016 +0100 Committer: Sam Corbett Committed: Wed Apr 6 11:18:23 2016 +0100 -- .../JcloudsRebindWithExternalConfigTest.java | 18 ++ 1 file changed, 18 insertions(+) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/3f8171dc/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/JcloudsRebindWithExternalConfigTest.java -- diff --git a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/JcloudsRebindWithExternalConfigTest.java b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/JcloudsRebindWithExternalConfigTest.java index 6d0d4ec..4d6064f 100644 --- a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/JcloudsRebindWithExternalConfigTest.java +++ b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/JcloudsRebindWithExternalConfigTest.java @@ -1,3 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.apache.brooklyn.camp.brooklyn; import static com.google.common.base.Preconditions.checkNotNull;
[1/4] brooklyn-server git commit: Add actions to SEE_ALL_SERVER_INFO entitlement group
Repository: brooklyn-server Updated Branches: refs/heads/master 06f68e134 -> 3b746e3ec Add actions to SEE_ALL_SERVER_INFO entitlement group Groovy console and reloading Brookyln properties. Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/4ff1e1ae Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/4ff1e1ae Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/4ff1e1ae Branch: refs/heads/master Commit: 4ff1e1ae999147ae087e2adcec821ad0dbe3fc88 Parents: 27dacc3 Author: Sam CorbettAuthored: Thu Apr 7 15:54:47 2016 +0100 Committer: Sam Corbett Committed: Mon Apr 11 15:47:00 2016 +0100 -- .../brooklyn/rest/resources/ScriptResource.java | 6 +++ .../brooklyn/rest/resources/ServerResource.java | 6 ++- .../entitlement/ScriptApiEntitlementsTest.java | 56 .../entitlement/ServerApiEntitlementsTest.java | 24 + 4 files changed, 91 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/4ff1e1ae/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/ScriptResource.java -- diff --git a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/ScriptResource.java b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/ScriptResource.java index 77989c3..7b558b6 100644 --- a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/ScriptResource.java +++ b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/ScriptResource.java @@ -18,8 +18,10 @@ */ package org.apache.brooklyn.rest.resources; +import org.apache.brooklyn.core.mgmt.entitlement.Entitlements; import org.apache.brooklyn.rest.api.ScriptApi; import org.apache.brooklyn.rest.domain.ScriptExecutionSummary; +import org.apache.brooklyn.rest.util.WebResourceUtils; import org.apache.brooklyn.util.stream.ThreadLocalPrintStream; import org.apache.brooklyn.util.stream.ThreadLocalPrintStream.OutputCapturingContext; @@ -45,6 +47,10 @@ public class ScriptResource extends AbstractBrooklynRestResource implements Scri @SuppressWarnings("rawtypes") @Override public ScriptExecutionSummary groovy(HttpServletRequest request, String script) { +if (!Entitlements.isEntitled(mgmt().getEntitlementManager(), Entitlements.SEE_ALL_SERVER_INFO, null)) { +throw WebResourceUtils.forbidden("User '%s' is not authorized for this operation", Entitlements.getEntitlementContext().user()); +} + log.info("Web REST executing user-supplied script"); if (log.isDebugEnabled()) { log.debug("Web REST user-supplied script contents:\n"+script); http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/4ff1e1ae/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/ServerResource.java -- diff --git a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/ServerResource.java b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/ServerResource.java index 0b99fc8..7be07de 100644 --- a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/ServerResource.java +++ b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/ServerResource.java @@ -96,7 +96,11 @@ public class ServerResource extends AbstractBrooklynRestResource implements Serv @Override public void reloadBrooklynProperties() { -brooklyn().reloadBrooklynProperties(); +if (Entitlements.isEntitled(mgmt().getEntitlementManager(), Entitlements.SEE_ALL_SERVER_INFO, null)) { +brooklyn().reloadBrooklynProperties(); +} else { +throw WebResourceUtils.forbidden("User '%s' is not authorized for this operation", Entitlements.getEntitlementContext().user()); +} } private boolean isMaster() { http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/4ff1e1ae/rest/rest-server/src/test/java/org/apache/brooklyn/rest/entitlement/ScriptApiEntitlementsTest.java -- diff --git a/rest/rest-server/src/test/java/org/apache/brooklyn/rest/entitlement/ScriptApiEntitlementsTest.java b/rest/rest-server/src/test/java/org/apache/brooklyn/rest/entitlement/ScriptApiEntitlementsTest.java new file mode 100644 index 000..5f6498a --- /dev/null +++ b/rest/rest-server/src/test/java/org/apache/brooklyn/rest/entitlement/ScriptApiEntitlementsTest.java @@ -0,0 +1,56 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license
[4/4] brooklyn-server git commit: This closes #108
This closes #108 New PerUserEntitlementManager keyword: user Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/3b746e3e Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/3b746e3e Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/3b746e3e Branch: refs/heads/master Commit: 3b746e3ece6ed5a3e78e418294f0bceba024da3b Parents: 06f68e1 4ff1e1a Author: Sam CorbettAuthored: Mon Apr 11 18:30:41 2016 +0100 Committer: Sam Corbett Committed: Mon Apr 11 18:30:41 2016 +0100 -- .../entitlement/EntitlementManagerAdapter.java | 4 + .../core/mgmt/entitlement/Entitlements.java | 117 --- .../entitlement/PerUserEntitlementManager.java | 6 +- .../org/apache/brooklyn/rest/api/ScriptApi.java | 8 +- .../brooklyn/rest/resources/ScriptResource.java | 6 + .../brooklyn/rest/resources/ServerResource.java | 6 +- .../AbstractRestApiEntitlementsTest.java| 35 +- .../ActivityApiEntitlementsTest.java| 2 + .../EntityConfigApiEntitlementsTest.java| 2 + .../entitlement/ScriptApiEntitlementsTest.java | 56 + .../entitlement/SensorApiEntitlementsTest.java | 2 + .../entitlement/ServerApiEntitlementsTest.java | 24 12 files changed, 215 insertions(+), 53 deletions(-) --
[3/4] brooklyn-server git commit: Add SEE_CATALOG_ITEM to readOnly entitlement group
Add SEE_CATALOG_ITEM to readOnly entitlement group Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/235e0c3b Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/235e0c3b Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/235e0c3b Branch: refs/heads/master Commit: 235e0c3bf51c22e18e5a4add05505e59dc3748cb Parents: 06f68e1 Author: Sam CorbettAuthored: Thu Apr 7 15:49:59 2016 +0100 Committer: Sam Corbett Committed: Mon Apr 11 15:47:00 2016 +0100 -- .../org/apache/brooklyn/core/mgmt/entitlement/Entitlements.java | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/235e0c3b/core/src/main/java/org/apache/brooklyn/core/mgmt/entitlement/Entitlements.java -- diff --git a/core/src/main/java/org/apache/brooklyn/core/mgmt/entitlement/Entitlements.java b/core/src/main/java/org/apache/brooklyn/core/mgmt/entitlement/Entitlements.java index c5b62a4..6d2c85c 100644 --- a/core/src/main/java/org/apache/brooklyn/core/mgmt/entitlement/Entitlements.java +++ b/core/src/main/java/org/apache/brooklyn/core/mgmt/entitlement/Entitlements.java @@ -329,6 +329,7 @@ public class Entitlements { return FineGrainedEntitlements.anyOf( FineGrainedEntitlements.allowing(SEE_ENTITY), FineGrainedEntitlements.allowing(SEE_ACTIVITY_STREAMS), +FineGrainedEntitlements.allowing(SEE_CATALOG_ITEM), FineGrainedEntitlements.seeNonSecretSensors(), FineGrainedEntitlements.seeNonSecretConfig() );
[1/2] brooklyn-server git commit: Remove DISCLAIMER remnant
Repository: brooklyn-server Updated Branches: refs/heads/master b8fe16647 -> a16f8c740 Remove DISCLAIMER remnant Missed one file in my earlier attempt to clean up DISCLAIMERs. Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/cc255544 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/cc255544 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/cc255544 Branch: refs/heads/master Commit: cc2555441b04a273aeed5b44b0145064fc311e54 Parents: b70c2b0 Author: Richard DownerAuthored: Tue Mar 15 13:57:56 2016 + Committer: Richard Downer Committed: Tue Mar 15 13:57:56 2016 + -- utils/jmx/jmxmp-ssl-agent/src/main/license/DISCLAIMER.shaded | 8 1 file changed, 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/cc255544/utils/jmx/jmxmp-ssl-agent/src/main/license/DISCLAIMER.shaded -- diff --git a/utils/jmx/jmxmp-ssl-agent/src/main/license/DISCLAIMER.shaded b/utils/jmx/jmxmp-ssl-agent/src/main/license/DISCLAIMER.shaded deleted file mode 100644 index 9e6119b..000 --- a/utils/jmx/jmxmp-ssl-agent/src/main/license/DISCLAIMER.shaded +++ /dev/null @@ -1,8 +0,0 @@ - -Apache Brooklyn is an effort undergoing incubation at The Apache Software Foundation (ASF), -sponsored by the Apache Incubator. Incubation is required of all newly accepted projects until -a further review indicates that the infrastructure, communications, and decision making process -have stabilized in a manner consistent with other successful ASF projects. While incubation -status is not necessarily a reflection of the completeness or stability of the code, it does -indicate that the project has yet to be fully endorsed by the ASF. -
[3/6] brooklyn-server git commit: Change preInstall to prepare and add ARCHIVE_DIRECTORY_NAME_FORMAT config
Change preInstall to prepare and add ARCHIVE_DIRECTORY_NAME_FORMAT config Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/d50580be Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/d50580be Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/d50580be Branch: refs/heads/master Commit: d50580bea44bd48c0cba66190c9e545158e629f9 Parents: 48e8fd7 Author: Andrew Donald KennedyAuthored: Thu Mar 3 16:33:52 2016 + Committer: Andrew Donald Kennedy Committed: Fri Mar 4 17:57:48 2016 + -- .../brooklynnode/BrooklynNodeSshDriver.java | 7 +- .../base/AbstractSoftwareProcessDriver.java | 68 +--- .../base/AbstractSoftwareProcessSshDriver.java | 62 -- .../AbstractSoftwareProcessWinRmDriver.java | 35 -- .../entity/software/base/SoftwareProcess.java | 34 -- 5 files changed, 101 insertions(+), 105 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/d50580be/software/base/src/main/java/org/apache/brooklyn/entity/brooklynnode/BrooklynNodeSshDriver.java -- diff --git a/software/base/src/main/java/org/apache/brooklyn/entity/brooklynnode/BrooklynNodeSshDriver.java b/software/base/src/main/java/org/apache/brooklyn/entity/brooklynnode/BrooklynNodeSshDriver.java index 8058d0f..5e2caa2 100644 --- a/software/base/src/main/java/org/apache/brooklyn/entity/brooklynnode/BrooklynNodeSshDriver.java +++ b/software/base/src/main/java/org/apache/brooklyn/entity/brooklynnode/BrooklynNodeSshDriver.java @@ -88,8 +88,7 @@ public class BrooklynNodeSshDriver extends JavaSoftwareProcessSshDriver implemen } @Override -public void preInstall() { -resolver = Entities.newDownloader(this); +public String getArchiveNameFormat() { String subpath = entity.getConfig(BrooklynNode.SUBPATH_IN_ARCHIVE); if (subpath==null) { // assume the dir name is `basename-VERSION` where download link is `basename-VERSION-dist.tar.gz` @@ -112,8 +111,8 @@ public class BrooklynNodeSshDriver extends JavaSoftwareProcessSshDriver implemen } } } -if (subpath==null) subpath = format("brooklyn-dist-%s", getVersion()); -setExpandedInstallDir(Os.mergePaths(getInstallDir(), resolver.getUnpackedDirectoryName(subpath))); +if (subpath==null) subpath = "brooklyn-dist-%s"; +return subpath; } @Override http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/d50580be/software/base/src/main/java/org/apache/brooklyn/entity/software/base/AbstractSoftwareProcessDriver.java -- diff --git a/software/base/src/main/java/org/apache/brooklyn/entity/software/base/AbstractSoftwareProcessDriver.java b/software/base/src/main/java/org/apache/brooklyn/entity/software/base/AbstractSoftwareProcessDriver.java index b48fab8..6e0f24f 100644 --- a/software/base/src/main/java/org/apache/brooklyn/entity/software/base/AbstractSoftwareProcessDriver.java +++ b/software/base/src/main/java/org/apache/brooklyn/entity/software/base/AbstractSoftwareProcessDriver.java @@ -91,7 +91,7 @@ public abstract class AbstractSoftwareProcessDriver implements SoftwareProcessDr * skipped, {@link BrooklynConfigKeys#SKIP_ENTITY_START} can be set on the entity. * The {@link BrooklynConfigKeys#SKIP_ENTITY_INSTALLATION} key can also be used to * skip the {@link #setup()}, {@link #copyInstallResources()} and - * {@link #install()} methods if set on the entity or location. + * {@link #install()} methods if set on the entity or location. * * @see #stop() */ @@ -106,26 +106,31 @@ public abstract class AbstractSoftwareProcessDriver implements SoftwareProcessDr } else { skipStart = entityStarted.or(false); } + +DynamicTasks.queue("prepare", new Runnable() { public void run() { +prepare(); +}}); + if (!skipStart) { DynamicTasks.queue("install", new Runnable() { public void run() { Optional locationInstalled = Optional.fromNullable(getLocation().getConfig(BrooklynConfigKeys.SKIP_ENTITY_INSTALLATION)); Optional entityInstalled = Optional.fromNullable(entity.getConfig(BrooklynConfigKeys.SKIP_ENTITY_INSTALLATION)); -DynamicTasks.queue("copy-pre-install-resources", new Runnable() { public void run() { - waitForConfigKey(BrooklynConfigKeys.PRE_INSTALL_RESOURCES_LATCH); -copyPreInstallResources(); -}}); +
[4/6] brooklyn-server git commit: Fix test count of params on Application
Fix test count of params on Application Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/50cf857c Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/50cf857c Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/50cf857c Branch: refs/heads/master Commit: 50cf857ca7ae7da59d45d76319de86ab3f2180e3 Parents: d50580b Author: Andrew Donald KennedyAuthored: Thu Mar 3 17:26:54 2016 + Committer: Andrew Donald Kennedy Committed: Fri Mar 4 17:58:49 2016 + -- .../camp/brooklyn/catalog/SpecParameterUnwrappingTest.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/50cf857c/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/SpecParameterUnwrappingTest.java -- diff --git a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/SpecParameterUnwrappingTest.java b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/SpecParameterUnwrappingTest.java index 29788ce..e129229 100644 --- a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/SpecParameterUnwrappingTest.java +++ b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/SpecParameterUnwrappingTest.java @@ -294,9 +294,8 @@ public class SpecParameterUnwrappingTest extends AbstractYamlTest { "services:", "- type: " + ver(SYMBOLIC_NAME)); List params = spec.getParameters(); -assertEquals(params.size(), 3, "Wrong number of params: "+params); // sample + defaultDisplayName + destroy_on_stop -assertEquals(ImmutableSet.copyOf(params), -ImmutableSet.copyOf(BasicSpecParameter.fromClass(mgmt(), ConfigAppForTest.class))); +assertEquals(params.size(), 4, "Wrong number of params: "+params); // sample + defaultDisplayName + destroy_on_stop + start.latch +assertEquals(ImmutableSet.copyOf(params), ImmutableSet.copyOf(BasicSpecParameter.fromClass(mgmt(), ConfigAppForTest.class))); } @Test
[2/6] brooklyn-server git commit: Added start latch to BasicStartable and StartableApplication
Added start latch to BasicStartable and StartableApplication Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/a5660eae Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/a5660eae Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/a5660eae Branch: refs/heads/master Commit: a5660eae10a4c64b09028402f2c85ae5ff7862a5 Parents: 975a599 Author: Andrew Donald KennedyAuthored: Wed Feb 24 08:30:54 2016 + Committer: Andrew Donald Kennedy Committed: Fri Mar 4 17:57:47 2016 + -- .../core/entity/AbstractApplication.java| 27 .../core/entity/StartableApplication.java | 6 - .../entity/stock/BasicApplicationImpl.java | 4 +-- .../brooklyn/entity/stock/BasicEntityImpl.java | 7 ++--- .../brooklyn/entity/stock/BasicStartable.java | 14 +++--- .../entity/stock/BasicStartableImpl.java| 17 +++- 6 files changed, 45 insertions(+), 30 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/a5660eae/core/src/main/java/org/apache/brooklyn/core/entity/AbstractApplication.java -- diff --git a/core/src/main/java/org/apache/brooklyn/core/entity/AbstractApplication.java b/core/src/main/java/org/apache/brooklyn/core/entity/AbstractApplication.java index 18a79cd..db2cd9f 100644 --- a/core/src/main/java/org/apache/brooklyn/core/entity/AbstractApplication.java +++ b/core/src/main/java/org/apache/brooklyn/core/entity/AbstractApplication.java @@ -21,6 +21,11 @@ package org.apache.brooklyn.core.entity; import java.util.Collection; import java.util.Map; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.common.collect.ImmutableSet; + import org.apache.brooklyn.api.entity.Application; import org.apache.brooklyn.api.entity.Entity; import org.apache.brooklyn.api.location.Location; @@ -35,10 +40,6 @@ import org.apache.brooklyn.util.exceptions.Exceptions; import org.apache.brooklyn.util.exceptions.RuntimeInterruptedException; import org.apache.brooklyn.util.text.Strings; import org.apache.brooklyn.util.time.Time; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.google.common.collect.ImmutableSet; /** * Users can extend this to define the entities in their application, and the relationships between @@ -132,12 +133,12 @@ public abstract class AbstractApplication extends AbstractEntity implements Star @Override protected void initEnrichers() { super.initEnrichers(); - + // default app logic; easily overridable by adding a different enricher with the same tag ServiceStateLogic.newEnricherFromChildren().checkChildrenAndMembers().addTo(this); ServiceStateLogic.ServiceNotUpLogic.updateNotUpIndicator(this, Attributes.SERVICE_STATE_ACTUAL, "Application created but not yet started, at "+Time.makeDateString()); } - + /** * Default start will start all Startable children (child.start(Collection)), * calling preStart(locations) first and postStart(locations) afterwards. @@ -152,15 +153,19 @@ public abstract class AbstractApplication extends AbstractEntity implements Star setExpectedStateAndRecordLifecycleEvent(Lifecycle.STARTING); try { preStart(locationsToUse); -// if there are other items which should block service_up, they should be done in preStart -ServiceStateLogic.ServiceNotUpLogic.clearNotUpIndicator(this, Attributes.SERVICE_STATE_ACTUAL); - + +// Opportunity to block startup until other dependent components are available +Object val = config().get(START_LATCH); +if (val != null) log.debug("{} finished waiting for start-latch; continuing...", this); + doStart(locationsToUse); postStart(locationsToUse); + +ServiceStateLogic.ServiceNotUpLogic.clearNotUpIndicator(this, Attributes.SERVICE_STATE_ACTUAL); } catch (Exception e) { // TODO should probably remember these problems then clear? if so, do it here ... or on all effectors? -//ServiceProblemsLogic.updateProblemsIndicator(this, START, e); - +// ServiceProblemsLogic.updateProblemsIndicator(this, START, e); + recordApplicationEvent(Lifecycle.ON_FIRE); // no need to log here; the effector invocation should do that throw Exceptions.propagate(e); http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/a5660eae/core/src/main/java/org/apache/brooklyn/core/entity/StartableApplication.java
[1/2] brooklyn-ui git commit: Rollback version of jasmin-maven-plugin to 1.3.1.6
Repository: brooklyn-ui Updated Branches: refs/heads/master 7bd22baad -> 6ed340f86 Rollback version of jasmin-maven-plugin to 1.3.1.6 Due to 2.X requiring maven 3.1.0 Project: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/commit/874e310b Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/tree/874e310b Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/diff/874e310b Branch: refs/heads/master Commit: 874e310b8b711d1b753f97939bcc53093396f536 Parents: 7bd22ba Author: Mark McKennaAuthored: Fri Mar 4 10:00:28 2016 + Committer: Mark McKenna Committed: Fri Mar 4 10:00:28 2016 + -- pom.xml | 12 +- .../javascript/specs/model/application-spec.js | 39 +++- .../specs/view/application-explorer-spec.js | 20 ++ 3 files changed, 43 insertions(+), 28 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/874e310b/pom.xml -- diff --git a/pom.xml b/pom.xml index 53c88e3..d91bb2b 100644 --- a/pom.xml +++ b/pom.xml @@ -44,7 +44,7 @@ ${project.build.directory}/${project.build.finalName} ${project.basedir}/target/nodejs/node -2.1 +1.3.1.6 2.1.1 2.8 1.0.3 @@ -113,16 +113,6 @@ - - -${phantomjs.version} -true -true -REPOSITORY - -target/phantomjs - - REQUIRE_JS http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/874e310b/src/test/javascript/specs/model/application-spec.js -- diff --git a/src/test/javascript/specs/model/application-spec.js b/src/test/javascript/specs/model/application-spec.js index dce9b06..17f2fac 100644 --- a/src/test/javascript/specs/model/application-spec.js +++ b/src/test/javascript/specs/model/application-spec.js @@ -15,19 +15,19 @@ * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. -*/ + */ define([ "model/application", "model/entity" ], function (Application, Entity) { -$.ajaxSetup({ async:false }); +$.ajaxSetup({async: false}); describe('model/application Application model', function () { var application = new Application.Model(); application.url = 'fixtures/application.json'; -application.fetch({async:false}); +application.fetch({async: false}); it('loads all model properties defined in fixtures/application.json', function () { expect(application.get("status")).toEqual('STARTING'); @@ -56,10 +56,10 @@ define([ beforeEach(function () { spec = new Application.Spec; location = "/locations/2"; -entity = new Entity.Model({name:'test'}); +entity = new Entity.Model({name: 'test'}); spec.url = 'fixtures/application-spec.json'; -spec.fetch({async:false}); +spec.fetch({async: false}); }); it('loads the properties from fixtures/application-spec.json', function () { @@ -77,7 +77,12 @@ define([ }); it("triggers 'change' when we add a location", function () { -spyOn(spec, "trigger").and.callThrough(); +if (jasmine.version) {// If version > 2.0 +spyOn(spec, "trigger").and.callThrough(); +} else { +spyOn(spec, "trigger").andCallThrough(); +} + spec.addLocation(location); expect(spec.trigger).toHaveBeenCalled(); expect(spec.get("locations").length).toEqual(2); @@ -85,7 +90,12 @@ define([ it("triggers 'change' when we remove a location", function () { spec.addLocation(location); -spyOn(spec, "trigger").and.callThrough(); +if (jasmine.version) {// If version > 2.0 +spyOn(spec, "trigger").and.callThrough(); +} else { +spyOn(spec, "trigger").andCallThrough(); +} + spec.removeLocation('/invalid/location'); expect(spec.trigger).not.toHaveBeenCalled(); @@ -103,7 +113,11 @@ define([ }); it("triggers 'change' when you add an entity", function () { -spyOn(spec, "trigger").and.callThrough(); +if (jasmine.version) {// If
[2/2] brooklyn-ui git commit: This closes #14
This closes #14 Rollback version of jasmin-maven-plugin to 1.3.1.6 Project: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/commit/6ed340f8 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/tree/6ed340f8 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/diff/6ed340f8 Branch: refs/heads/master Commit: 6ed340f864357eaf784440af3019b4b2a805acc8 Parents: 7bd22ba 874e310 Author: Sam CorbettAuthored: Fri Mar 4 11:32:38 2016 + Committer: Sam Corbett Committed: Fri Mar 4 11:32:38 2016 + -- pom.xml | 12 +- .../javascript/specs/model/application-spec.js | 39 +++- .../specs/view/application-explorer-spec.js | 20 ++ 3 files changed, 43 insertions(+), 28 deletions(-) --
[2/2] brooklyn-dist git commit: This closes #11
This closes #11 Update commons-lang3 version to match brooklyn server Project: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/commit/f1561b63 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/tree/f1561b63 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/diff/f1561b63 Branch: refs/heads/master Commit: f1561b6312c69cfac7602949b723af43c8d89ff9 Parents: 8975719 7ed7081 Author: Sam CorbettAuthored: Fri Mar 4 17:48:36 2016 + Committer: Sam Corbett Committed: Fri Mar 4 17:48:36 2016 + -- downstream-parent/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --
[1/2] brooklyn-server git commit: Modified InfrastructureDeploymentTestCase changing the testSpecs config to Startable rather than SoftwareProcess
Repository: brooklyn-server Updated Branches: refs/heads/master 1dbe97f40 -> 975a59993 Modified InfrastructureDeploymentTestCase changing the testSpecs config to Startable rather than SoftwareProcess Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/ef9f48df Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/ef9f48df Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/ef9f48df Branch: refs/heads/master Commit: ef9f48df37470f19eb664385409fb2d074136c9c Parents: 972854a Author: graeme.millerAuthored: Thu Mar 3 11:41:23 2016 + Committer: graeme.miller Committed: Thu Mar 3 12:10:09 2016 + -- .../InfrastructureDeploymentTestCase.java | 3 +- .../InfrastructureDeploymentTestCaseImpl.java | 8 ++-- .../InfrastructureDeploymentTestCaseTest.java | 48 +--- 3 files changed, 27 insertions(+), 32 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/ef9f48df/test-framework/src/main/java/org/apache/brooklyn/test/framework/InfrastructureDeploymentTestCase.java -- diff --git a/test-framework/src/main/java/org/apache/brooklyn/test/framework/InfrastructureDeploymentTestCase.java b/test-framework/src/main/java/org/apache/brooklyn/test/framework/InfrastructureDeploymentTestCase.java index a3ffa53..41ba1b7 100644 --- a/test-framework/src/main/java/org/apache/brooklyn/test/framework/InfrastructureDeploymentTestCase.java +++ b/test-framework/src/main/java/org/apache/brooklyn/test/framework/InfrastructureDeploymentTestCase.java @@ -27,6 +27,7 @@ import org.apache.brooklyn.api.entity.ImplementedBy; import org.apache.brooklyn.config.ConfigKey; import org.apache.brooklyn.core.config.ConfigKeys; import org.apache.brooklyn.core.entity.StartableApplication; +import org.apache.brooklyn.core.entity.trait.Startable; import org.apache.brooklyn.entity.software.base.SoftwareProcess; /** @@ -39,7 +40,7 @@ public interface InfrastructureDeploymentTestCase extends TargetableTestComponen * Entity specs to deploy. These will be deployed second, after the INFRASTRUCTURE_SPEC has been deployed. These specs will be deployed to the DEPLOYMENT_LOCATION. * All children will be deployed after this */ -ConfigKey > ENTITY_SPEC_TO_DEPLOY = ConfigKeys.newConfigKey(new TypeToken
>(){}, "infrastructure.deployment.entity.specs", "Entity specs to deploy to infrastructure"); +ConfigKey
> ENTITY_SPEC_TO_DEPLOY = ConfigKeys.newConfigKey(new TypeToken
>(){}, "infrastructure.deployment.entity.specs", "Entity specs to deploy to infrastructure"); /** http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/ef9f48df/test-framework/src/main/java/org/apache/brooklyn/test/framework/InfrastructureDeploymentTestCaseImpl.java -- diff --git a/test-framework/src/main/java/org/apache/brooklyn/test/framework/InfrastructureDeploymentTestCaseImpl.java b/test-framework/src/main/java/org/apache/brooklyn/test/framework/InfrastructureDeploymentTestCaseImpl.java index 55f3e63..13504c8 100644 --- a/test-framework/src/main/java/org/apache/brooklyn/test/framework/InfrastructureDeploymentTestCaseImpl.java +++ b/test-framework/src/main/java/org/apache/brooklyn/test/framework/InfrastructureDeploymentTestCaseImpl.java @@ -29,8 +29,8 @@ import org.apache.brooklyn.core.annotation.EffectorParam; import org.apache.brooklyn.core.entity.Attributes; import org.apache.brooklyn.core.entity.StartableApplication; import org.apache.brooklyn.core.entity.lifecycle.Lifecycle; +import org.apache.brooklyn.core.entity.trait.Startable; import org.apache.brooklyn.core.sensor.Sensors; -import org.apache.brooklyn.entity.software.base.SoftwareProcess; /** * Created by graememiller on 04/12/2015. @@ -65,13 +65,13 @@ public class InfrastructureDeploymentTestCaseImpl extends TestCaseImpl implement } //Start the child entity -List
entitySpecsToDeploy = config().get(ENTITY_SPEC_TO_DEPLOY); +List entitySpecsToDeploy = config().get(ENTITY_SPEC_TO_DEPLOY); if (entitySpecsToDeploy == null || entitySpecsToDeploy.isEmpty()) { setServiceState(false, Lifecycle.ON_FIRE); throw new IllegalArgumentException(ENTITY_SPEC_TO_DEPLOY + " not configured"); } -for (EntitySpec softwareProcessEntitySpec : entitySpecsToDeploy) { -SoftwareProcess entityToDeploy = this.addChild(softwareProcessEntitySpec); +for (EntitySpec entitySpec :
[1/2] brooklyn-dist git commit: Update commons-lang3 version to match brooklyn server
Repository: brooklyn-dist Updated Branches: refs/heads/master 8975719dc -> f1561b631 Update commons-lang3 version to match brooklyn server Project: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/commit/7ed70817 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/tree/7ed70817 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-dist/diff/7ed70817 Branch: refs/heads/master Commit: 7ed70817771271f2bd310c6c36bd713fc16207ce Parents: b14ee79 Author: graeme.millerAuthored: Thu Mar 3 13:47:38 2016 + Committer: graeme.miller Committed: Thu Mar 3 13:47:38 2016 + -- downstream-parent/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-dist/blob/7ed70817/downstream-parent/pom.xml -- diff --git a/downstream-parent/pom.xml b/downstream-parent/pom.xml index f97dba3..2f75d1b 100644 --- a/downstream-parent/pom.xml +++ b/downstream-parent/pom.xml @@ -66,7 +66,7 @@ 2.4.5 1.19 4.4.1 -3.1 +3.3.2 2.3.7 2.0.1 1.11
[2/2] brooklyn-server git commit: This closes #94
This closes #94 Fix noConsoleSecurity option Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/36a29180 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/36a29180 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/36a29180 Branch: refs/heads/master Commit: 36a29180def4b504fdd3da97f215f27eab3e226d Parents: e79353c e0244a9 Author: Sam CorbettAuthored: Thu Mar 31 16:46:58 2016 +0100 Committer: Sam Corbett Committed: Thu Mar 31 16:46:58 2016 +0100 -- .../brooklyn/launcher/BrooklynWebServer.java| 3 +- .../brooklyn/launcher/NopSecurityHandler.java | 34 .../jsgui/BrooklynJavascriptGuiLauncher.java| 4 +++ .../rest/BrooklynRestApiLauncherTest.java | 6 ++-- .../brooklynnode/DeployBlueprintTest.java | 2 +- .../brooklyn/rest/NopSecurityHandler.java | 34 .../brooklyn/rest/BrooklynRestApiLauncher.java | 20 ++-- 7 files changed, 55 insertions(+), 48 deletions(-) --
[1/2] brooklyn-server git commit: Fix noConsoleSecurity option
Repository: brooklyn-server Updated Branches: refs/heads/master e79353ce1 -> 36a29180d Fix noConsoleSecurity option Also skip security by default for BrooklynRestApiLauncher. Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/e0244a90 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/e0244a90 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/e0244a90 Branch: refs/heads/master Commit: e0244a90e41a3f038ed35d517852abb58e1aecef Parents: e79353c Author: Svetoslav NeykovAuthored: Thu Mar 31 12:45:20 2016 +0300 Committer: Svetoslav Neykov Committed: Thu Mar 31 16:48:38 2016 +0300 -- .../brooklyn/launcher/BrooklynWebServer.java| 3 +- .../brooklyn/launcher/NopSecurityHandler.java | 34 .../jsgui/BrooklynJavascriptGuiLauncher.java| 4 +++ .../rest/BrooklynRestApiLauncherTest.java | 6 ++-- .../brooklynnode/DeployBlueprintTest.java | 2 +- .../brooklyn/rest/NopSecurityHandler.java | 34 .../brooklyn/rest/BrooklynRestApiLauncher.java | 20 ++-- 7 files changed, 55 insertions(+), 48 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/e0244a90/launcher/src/main/java/org/apache/brooklyn/launcher/BrooklynWebServer.java -- diff --git a/launcher/src/main/java/org/apache/brooklyn/launcher/BrooklynWebServer.java b/launcher/src/main/java/org/apache/brooklyn/launcher/BrooklynWebServer.java index 29085c1..7dbcc96 100644 --- a/launcher/src/main/java/org/apache/brooklyn/launcher/BrooklynWebServer.java +++ b/launcher/src/main/java/org/apache/brooklyn/launcher/BrooklynWebServer.java @@ -36,6 +36,7 @@ import java.util.Map; import javax.annotation.Nullable; import javax.security.auth.spi.LoginModule; +import org.apache.brooklyn.rest.NopSecurityHandler; import org.apache.brooklyn.api.location.PortRange; import org.apache.brooklyn.api.mgmt.ManagementContext; import org.apache.brooklyn.config.ConfigKey; @@ -649,7 +650,7 @@ public class BrooklynWebServer { // to have security pre-configured and ignore it if noConsoleSecurity used. // // Ignore security config in web.xml. -context.setDefaultSecurityHandlerClass(NopSecurityHandler.class); +context.setSecurityHandler(new NopSecurityHandler()); } else { // Cover for downstream projects which don't have the changes. context.addOverrideDescriptor(getClass().getResource("/web-security.xml").toExternalForm()); http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/e0244a90/launcher/src/main/java/org/apache/brooklyn/launcher/NopSecurityHandler.java -- diff --git a/launcher/src/main/java/org/apache/brooklyn/launcher/NopSecurityHandler.java b/launcher/src/main/java/org/apache/brooklyn/launcher/NopSecurityHandler.java deleted file mode 100644 index 88b2a27..000 --- a/launcher/src/main/java/org/apache/brooklyn/launcher/NopSecurityHandler.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.brooklyn.launcher; - -import org.eclipse.jetty.security.ConstraintMapping; -import org.eclipse.jetty.security.ConstraintSecurityHandler; - -/** - * Ignores elements from web.xml, so - * we can skip configuration even if requested by web app. - */ -public class NopSecurityHandler extends ConstraintSecurityHandler { - -@Override -public void addConstraintMapping(ConstraintMapping mapping) { -} - -} http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/e0244a90/launcher/src/test/java/org/apache/brooklyn/rest/jsgui/BrooklynJavascriptGuiLauncher.java -- diff --git
[1/7] brooklyn-docs git commit: Updating port inferencing documentation
Repository: brooklyn-docs Updated Branches: refs/heads/master d0376bdaa -> 3b99db2da Updating port inferencing documentation Project: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/commit/ad61cbca Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/tree/ad61cbca Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/diff/ad61cbca Branch: refs/heads/master Commit: ad61cbcae87c9e7f964e1769aa20edb34b837d8d Parents: 7c41f83 Author: Kiuby88Authored: Fri May 13 14:37:09 2016 +0200 Committer: Kiuby88 Committed: Fri May 13 14:37:09 2016 +0200 -- guide/yaml/custom-entities.md | 4 1 file changed, 4 insertions(+) -- http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/ad61cbca/guide/yaml/custom-entities.md -- diff --git a/guide/yaml/custom-entities.md b/guide/yaml/custom-entities.md index 9698aa8..69d0d02 100644 --- a/guide/yaml/custom-entities.md +++ b/guide/yaml/custom-entities.md @@ -75,6 +75,10 @@ In addition, any such config key will be opened, irrespective of whether it matches the `inboundPorts.configRegex`. To prevent any inferencing of ports to open, you can set the config `inboundPorts.autoInfer` to `false`. +Furthermore, the port inferencing capability takes in account static `ConfigKey` fields that +are defined on any Entity sub-class. So, `ConfigKey` fields that are based on `PortRanges` type will +be also included as required open ports. + Note that in the example above, `netcat.port` must be specified in a `brooklyn.config` block. This block can be used to hold any config (including for example the `launch.command`), but for convenience Brooklyn allows config keys declared on the underlying type
[4/7] brooklyn-docs git commit: Corrected broken link 'git-clone'
Corrected broken link 'git-clone' Found a broken link on the Brooklyn website https://brooklyn.apache.org/v/latest/yaml/creating-yaml.html - its the git-clone link towards the bottom. Current is: https://brooklyn.apache.org/v/latest/dev/code/index.html It should be: https://brooklyn.apache.org/developers/code/index.html Project: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/commit/63c7a733 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/tree/63c7a733 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/diff/63c7a733 Branch: refs/heads/master Commit: 63c7a7333c09c21b6058d40f8c646bb6fb26670a Parents: d0376bd Author: David BushAuthored: Thu May 19 17:01:59 2016 +0100 Committer: David Bush Committed: Thu May 19 17:01:59 2016 +0100 -- guide/yaml/creating-yaml.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/63c7a733/guide/yaml/creating-yaml.md -- diff --git a/guide/yaml/creating-yaml.md b/guide/yaml/creating-yaml.md index 34a0d29..8bc22c4 100644 --- a/guide/yaml/creating-yaml.md +++ b/guide/yaml/creating-yaml.md @@ -57,7 +57,7 @@ Topics to explore next on the topic of YAML blueprints are: {% include list-children.html %} Plenty of examples of blueprints exist in the Brooklyn codebase, -so another starting point is to [`git clone`]({{ site.path.guide }}/dev/code/index.html) it +so another starting point is to [`git clone`]({{ site.path.guide }}/developers/code/index.html) it and search for `*.yaml` files therein. Brooklyn lived as a Java framework for many years before we felt confident
[2/3] brooklyn-ui git commit: Improve location wizard cloud names
Improve location wizard cloud names Project: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/commit/9e387e21 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/tree/9e387e21 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/diff/9e387e21 Branch: refs/heads/master Commit: 9e387e21aefbe2c765b313b9e1e5a5a72f9e1e19 Parents: 2121fde Author: Sam CorbettAuthored: Thu May 19 15:34:40 2016 +0100 Committer: Sam Corbett Committed: Thu May 19 15:34:40 2016 +0100 -- src/main/webapp/assets/js/view/location-wizard.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/9e387e21/src/main/webapp/assets/js/view/location-wizard.js -- diff --git a/src/main/webapp/assets/js/view/location-wizard.js b/src/main/webapp/assets/js/view/location-wizard.js index 14531bb..0a317b2 100644 --- a/src/main/webapp/assets/js/view/location-wizard.js +++ b/src/main/webapp/assets/js/view/location-wizard.js @@ -345,10 +345,10 @@ define([ label: 'Cloud Provider', type: 'select', values: { -'jclouds:aws-ec2': 'Amazon', -'jclouds:google-compute-engine': 'Google', -'jclouds:softlayer': 'Softlayer', +'jclouds:aws-ec2': 'Amazon EC2', +'jclouds:google-compute-engine': 'Google Compute Engine', 'jclouds:openstack-nova': 'Openstack Nova', +'jclouds:softlayer': 'SoftLayer', other: 'Other (supply location spec string)' } },
[3/3] brooklyn-ui git commit: This closes #26
This closes #26 Location wizard generates correct spec for Openstack Project: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/commit/6ecfb16d Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/tree/6ecfb16d Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/diff/6ecfb16d Branch: refs/heads/master Commit: 6ecfb16d13ffc70b743ab7d1b674c9df3a63f489 Parents: 4006148 9e387e2 Author: Sam CorbettAuthored: Thu May 19 16:17:51 2016 +0100 Committer: Sam Corbett Committed: Thu May 19 16:17:51 2016 +0100 -- src/main/webapp/assets/js/view/location-wizard.js | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) --
[2/7] brooklyn-docs git commit: Fix code block formatting
Fix code block formatting ```yaml does not work on the website. Project: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/commit/46640cb8 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/tree/46640cb8 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/diff/46640cb8 Branch: refs/heads/master Commit: 46640cb89531a342f26071f8f52f63164afe0ab1 Parents: d0376bd Author: Sam CorbettAuthored: Thu May 19 16:13:18 2016 +0100 Committer: Sam Corbett Committed: Thu May 19 16:13:18 2016 +0100 -- guide/ops/locations/_clouds.md | 2 - guide/ops/locations/_more-clouds.md | 65 ++-- guide/yaml/test/test-entities.md| 17 - guide/yaml/winrm/index.md | 7 ++-- 4 files changed, 39 insertions(+), 52 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/46640cb8/guide/ops/locations/_clouds.md -- diff --git a/guide/ops/locations/_clouds.md b/guide/ops/locations/_clouds.md index ffde083..8d04599 100644 --- a/guide/ops/locations/_clouds.md +++ b/guide/ops/locations/_clouds.md @@ -241,8 +241,6 @@ If the method call cannot be matched to the template options available - for exa specific option but your location is an OpenStack cloud - then a warning is logged and the option is ignored. - - See the following resources for more information: - [AWS VPC issues which may affect users with older AWS accounts](vpc-issues.html) http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/46640cb8/guide/ops/locations/_more-clouds.md -- diff --git a/guide/ops/locations/_more-clouds.md b/guide/ops/locations/_more-clouds.md index acfd274..ee8b979 100644 --- a/guide/ops/locations/_more-clouds.md +++ b/guide/ops/locations/_more-clouds.md @@ -26,7 +26,6 @@ is included below. You may also find these sources helpful: sometimes required for various clouds. - ## Amazon Web Services (AWS) ### Credentials @@ -172,6 +171,7 @@ For example, for dev/demo purposes an "everything" network could be created that || Source IP Ranges|| 0.0.0.0/0 | || Allowed protocols and ports || tcp:0-65535 and udp:0-65535 | + ## IBM SoftLayer ### VLAN Selection @@ -185,15 +185,13 @@ The VLAN ID can be set explicitly using the fields `primaryBackendNetworkComponentNetworkVlanId` of `SoftLayerTemplateOptions` when specifying the location being used in the blueprint, as follows: -```YAML -location: - jclouds:softlayer: -region: ams01 -templateOptions: - # Enter your preferred network IDs - primaryNetworkComponentNetworkVlanId: 1153481 - primaryBackendNetworkComponentNetworkVlanId: 1153483 -``` +location: + jclouds:softlayer: +region: ams01 +templateOptions: + # Enter your preferred network IDs + primaryNetworkComponentNetworkVlanId: 1153481 + primaryBackendNetworkComponentNetworkVlanId: 1153483 This method requires that a VM already exist and you look up the IDs of its VLANs, for example in the SoftLayer console UI, and that subsequently at least @@ -210,16 +208,14 @@ end-users. To use this method, we tell brooklyn to use `SoftLayerSameVlanLocationCustomizer` as a location customizer. This can be done on a location as follows: -```YAML -location: - jclouds:softlayer: -region: lon02 -customizers: -- $brooklyn:object: -type: org.apache.brooklyn.location.jclouds.softlayer.SoftLayerSameVlanLocationCustomizer -softlayer.vlan.scopeUid: "my-custom-scope" -softlayer.vlan.timeout: 10m -``` +location: + jclouds:softlayer: +region: lon02 +customizers: +- $brooklyn:object: +type: org.apache.brooklyn.location.jclouds.softlayer.SoftLayerSameVlanLocationCustomizer +softlayer.vlan.scopeUid: "my-custom-scope" +softlayer.vlan.timeout: 10m Usually you will want the scope to be unique to a single application, but if you need multiple applications to share the same VLAN, simply configure them with @@ -228,27 +224,24 @@ the same scope identifier. It is also possible with many blueprints to specify this as one of the `provisioning.properties` on an *application*: -```YAML -services: -- type: org.apache.brooklyn.entity.stock.BasicApplication - id: same-vlan-application - brooklyn.config: -provisioning.properties: - customizers: - - $brooklyn:object: - type: org.apache.brooklyn.location.jclouds.softlayer.SoftLayerSameVlanLocationCustomizer -softlayer.vlan.scopeUid: "my-custom-scope" -softlayer.vlan.timeout: 10m -``` +
[7/7] brooklyn-docs git commit: This closes #69
This closes #69 Corrected broken link 'git-clone' Project: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/commit/3b99db2d Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/tree/3b99db2d Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/diff/3b99db2d Branch: refs/heads/master Commit: 3b99db2da1ce3734290012924f4ff580552a31f6 Parents: fe774fc 63c7a73 Author: Sam CorbettAuthored: Fri May 20 10:13:08 2016 +0100 Committer: Sam Corbett Committed: Fri May 20 10:13:08 2016 +0100 -- guide/yaml/creating-yaml.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --
[1/4] brooklyn-docs git commit: Corrected brooklyn references
Repository: brooklyn-docs Updated Branches: refs/heads/master ffc3ee63d -> 0de526b9d Corrected brooklyn references Project: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/commit/e70716eb Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/tree/e70716eb Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/diff/e70716eb Branch: refs/heads/master Commit: e70716eb8da0151ca80350ae15bf52589e095ee6 Parents: 6f8c37b Author: Duncan GodwinAuthored: Mon Apr 4 16:27:25 2016 +0100 Committer: Duncan Godwin Committed: Mon Apr 4 16:27:25 2016 +0100 -- guide/ops/locations/clouds.md | 2 +- guide/ops/persistence/index.md| 2 +- guide/start/running.md| 2 +- guide/yaml/chef/about-chef.md | 4 ++-- website/documentation/increase-entropy.md | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/e70716eb/guide/ops/locations/clouds.md -- diff --git a/guide/ops/locations/clouds.md b/guide/ops/locations/clouds.md index 08109e0..89195fa 100644 --- a/guide/ops/locations/clouds.md +++ b/guide/ops/locations/clouds.md @@ -59,7 +59,7 @@ Brooklyn to use specific credentials for the initial login to a cloud-provisione (This custom login is particularly useful when using a custom image templates where the cloud-side account management logic is not enabled. For example, a vCloud (vCD) template can have guest customization that will change -the root password. This setting tells AMP to only use the given password, rather than the initial +the root password. This setting tells Apache Brooklyn to only use the given password, rather than the initial randomly generated password that vCD returns. Without this property, there is a race for such templates: does Brooklyn manage to create the admin user before the guest customization changes the login and reboots, or is the password reset first (the latter means Brooklyn can never ssh to the VM). With this property, http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/e70716eb/guide/ops/persistence/index.md -- diff --git a/guide/ops/persistence/index.md b/guide/ops/persistence/index.md index 58b5915..30c3d5f 100644 --- a/guide/ops/persistence/index.md +++ b/guide/ops/persistence/index.md @@ -367,7 +367,7 @@ An example script to be invoked by CRON is shown below: BACKUP_FILENAME=/path/to/archives/back-${DATE}.tar.gz TEMP_DATA_DIR=/path/to/tempdir -amp copy-state \ +brooklyn copy-state \ --persistenceLocation named:my-persistence-location \ --persistenceDir /path/to/bucket \ --destinationDir $TEMP_DATA_DIR http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/e70716eb/guide/start/running.md -- diff --git a/guide/start/running.md b/guide/start/running.md index 0518743..3464023 100644 --- a/guide/start/running.md +++ b/guide/start/running.md @@ -55,7 +55,7 @@ $ cd apache-brooklyn-{{site.brooklyn-version}}-vagrant For Centos 7 and RHEL 7 users, the recommended way to install Apache Brooklyn on RPM-based Linux distributions is by using the RPM package. -RPM is the de facto standard for packaging software on these Linux distributions and provides a mechanism for installing, upgrading and removing packages such as Apache Brooklyn. The AMP package contains all the necessary files associated with the Apache Brooklyn application. +RPM is the de facto standard for packaging software on these Linux distributions and provides a mechanism for installing, upgrading and removing packages such as Apache Brooklyn. The RPM package contains all the necessary files associated with the Apache Brooklyn application. Download the Apache Brooklyn [RPM distribution](https://www.apache.org/dyn/closer.lua/brooklyn/apache-brooklyn-{{site.brooklyn-version}}-1.noarch.rpm){:target="_blank"}. http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/e70716eb/guide/yaml/chef/about-chef.md -- diff --git a/guide/yaml/chef/about-chef.md b/guide/yaml/chef/about-chef.md index db3ec3c..8f87d07 100644 --- a/guide/yaml/chef/about-chef.md +++ b/guide/yaml/chef/about-chef.md @@ -38,13 +38,13 @@ the server. This is not the case - the bootstrap operation does not involve `kni itself to the server, passing on its configuration. This diagram summarises the interaction between Brooklyn, the new node, and the various Chef tools. Note that there -is no
[4/4] brooklyn-docs git commit: This closes #48
This closes #48 Typos Project: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/commit/0de526b9 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/tree/0de526b9 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/diff/0de526b9 Branch: refs/heads/master Commit: 0de526b9db061241b741d7d118afa81564c802c8 Parents: 10f4927 2437192 Author: Sam CorbettAuthored: Wed Apr 20 18:00:55 2016 +0100 Committer: Sam Corbett Committed: Wed Apr 20 18:00:55 2016 +0100 -- contributing/inline-children.md | 4 ++-- guide/ops/locations/index.md| 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) --
[3/4] brooklyn-docs git commit: This closes #41
This closes #41 Corrected brooklyn references Project: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/commit/10f49278 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/tree/10f49278 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/diff/10f49278 Branch: refs/heads/master Commit: 10f492785a3dfb37f53fb573c001b58f4eaa5a67 Parents: ffc3ee6 e70716e Author: Sam CorbettAuthored: Wed Apr 20 18:00:50 2016 +0100 Committer: Sam Corbett Committed: Wed Apr 20 18:00:50 2016 +0100 -- guide/ops/locations/clouds.md | 2 +- guide/ops/persistence/index.md| 2 +- guide/start/running.md| 2 +- guide/yaml/chef/about-chef.md | 4 ++-- website/documentation/increase-entropy.md | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) --
[2/4] brooklyn-docs git commit: Typos
Typos Project: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/commit/24371929 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/tree/24371929 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/diff/24371929 Branch: refs/heads/master Commit: 243719295311a80c78a8faa88d58cfa69b9e9faa Parents: ffc3ee6 Author: Sam CorbettAuthored: Wed Apr 20 17:54:24 2016 +0100 Committer: Sam Corbett Committed: Wed Apr 20 17:54:24 2016 +0100 -- contributing/inline-children.md | 4 ++-- guide/ops/locations/index.md| 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/24371929/contributing/inline-children.md -- diff --git a/contributing/inline-children.md b/contributing/inline-children.md index 08eaa38..480f451 100644 --- a/contributing/inline-children.md +++ b/contributing/inline-children.md @@ -48,7 +48,7 @@ Brooklyn supports a wide range of locations: Configuration can be set in `~/.brooklyn/brooklyn.properties` or directly in YAML when specifying a location. -On some entities, config keys determining maching selection and provisioning behavior -can also be set `in `provisioning.properties`. +On some entities, config keys determining matching selection and provisioning behavior +can also be set in `provisioning.properties`. { child_content } http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/24371929/guide/ops/locations/index.md -- diff --git a/guide/ops/locations/index.md b/guide/ops/locations/index.md index 8b74698..fbcf35f 100644 --- a/guide/ops/locations/index.md +++ b/guide/ops/locations/index.md @@ -20,7 +20,7 @@ Brooklyn supports a wide range of locations: Configuration can be set in `~/.brooklyn/brooklyn.properties`, through the location wizard tool available within the web console or directly in YAML when specifying a location. -On some entities, config keys determining maching selection and provisioning behavior -can also be set `in `provisioning.properties`. +On some entities, config keys determining matching selection and provisioning behavior +can also be set in `provisioning.properties`. {% child_content %}
[5/5] brooklyn-server git commit: This closes #209
This closes #209 Test relative entities Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/c4d50555 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/c4d50555 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/c4d50555 Branch: refs/heads/master Commit: c4d505551df278014ec5c3a1172f3565e323f4f7 Parents: 749f75b 07942b1 Author: Sam CorbettAuthored: Wed Jul 13 18:11:40 2016 +0100 Committer: Sam Corbett Committed: Wed Jul 13 18:11:40 2016 +0100 -- .../brooklyn/spi/dsl/methods/DslComponent.java | 14 +- .../brooklyn/core/sensor/StaticSensor.java | 8 +- .../InfrastructureDeploymentTestCase.java | 3 - .../InfrastructureDeploymentTestCaseImpl.java | 3 - .../framework/LoopOverGroupMembersTestCase.java | 3 - .../LoopOverGroupMembersTestCaseImpl.java | 10 +- .../test/framework/ParallelTestCase.java| 2 - .../test/framework/ParallelTestCaseImpl.java| 2 - .../test/framework/RelativeEntityTestCase.java | 65 + .../framework/RelativeEntityTestCaseImpl.java | 144 +++ .../test/framework/TargetableTestComponent.java | 2 - .../brooklyn/test/framework/TestCase.java | 2 - .../brooklyn/test/framework/TestEffector.java | 2 - .../test/framework/TestEffectorImpl.java| 3 - .../test/framework/TestFrameworkAssertions.java | 2 - .../brooklyn/test/framework/TestHttpCall.java | 2 - .../brooklyn/test/framework/TestSensor.java | 2 - .../InfrastructureDeploymentTestCaseTest.java | 3 - .../LoopOverGroupMembersTestCaseTest.java | 4 - .../framework/RelativeEntityTestCaseTest.java | 135 + .../test/framework/TestEffectorTest.java| 3 - .../framework/TestFrameworkAssertionsTest.java | 4 - .../test/framework/TestHttpCallTest.java| 3 - .../brooklyn/test/framework/TestSensorTest.java | 3 - .../test/framework/entity/TestEntity.java | 4 - .../test/framework/entity/TestEntityImpl.java | 13 +- .../framework/entity/TestInfrastructure.java| 4 - .../entity/TestInfrastructureImpl.java | 3 - 28 files changed, 370 insertions(+), 78 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/c4d50555/camp/camp-brooklyn/src/main/java/org/apache/brooklyn/camp/brooklyn/spi/dsl/methods/DslComponent.java --
[4/5] brooklyn-server git commit: Add RelativeEntityTestCaseImpl
Add RelativeEntityTestCaseImpl Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/07942b12 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/07942b12 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/07942b12 Branch: refs/heads/master Commit: 07942b12168c591fe2a0b1cd1c791c36e5f1afc5 Parents: 0c0ec60 Author: Sam CorbettAuthored: Mon Jun 20 18:45:50 2016 +0100 Committer: Sam Corbett Committed: Wed Jul 6 12:02:07 2016 +0100 -- .../brooklyn/spi/dsl/methods/DslComponent.java | 14 +- .../test/framework/RelativeEntityTestCase.java | 65 + .../framework/RelativeEntityTestCaseImpl.java | 144 +++ .../framework/RelativeEntityTestCaseTest.java | 135 + 4 files changed, 356 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/07942b12/camp/camp-brooklyn/src/main/java/org/apache/brooklyn/camp/brooklyn/spi/dsl/methods/DslComponent.java -- diff --git a/camp/camp-brooklyn/src/main/java/org/apache/brooklyn/camp/brooklyn/spi/dsl/methods/DslComponent.java b/camp/camp-brooklyn/src/main/java/org/apache/brooklyn/camp/brooklyn/spi/dsl/methods/DslComponent.java index cfb343f..b02f736 100644 --- a/camp/camp-brooklyn/src/main/java/org/apache/brooklyn/camp/brooklyn/spi/dsl/methods/DslComponent.java +++ b/camp/camp-brooklyn/src/main/java/org/apache/brooklyn/camp/brooklyn/spi/dsl/methods/DslComponent.java @@ -61,14 +61,24 @@ public class DslComponent extends BrooklynDslDeferredSupplier { private final DslComponent scopeComponent; private final Scope scope; +/** + * Resolve componentId in the {@link Scope#GLOBAL} scope. + */ public DslComponent(String componentId) { this(Scope.GLOBAL, componentId); } - + +/** + * Resolve componentId in scope relative to the current + * {@link BrooklynTaskTags#getTargetOrContextEntity) target or context} entity. + */ public DslComponent(Scope scope, String componentId) { this(null, scope, componentId); } - + +/** + * Resolve componentId in scope relative to scopeComponent. + */ public DslComponent(DslComponent scopeComponent, Scope scope, String componentId) { Preconditions.checkNotNull(scope, "scope"); this.scopeComponent = scopeComponent; http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/07942b12/test-framework/src/main/java/org/apache/brooklyn/test/framework/RelativeEntityTestCase.java -- diff --git a/test-framework/src/main/java/org/apache/brooklyn/test/framework/RelativeEntityTestCase.java b/test-framework/src/main/java/org/apache/brooklyn/test/framework/RelativeEntityTestCase.java new file mode 100644 index 000..3796bf4 --- /dev/null +++ b/test-framework/src/main/java/org/apache/brooklyn/test/framework/RelativeEntityTestCase.java @@ -0,0 +1,65 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.brooklyn.test.framework; + +import org.apache.brooklyn.api.entity.Entity; +import org.apache.brooklyn.api.entity.ImplementedBy; +import org.apache.brooklyn.api.sensor.AttributeSensor; +import org.apache.brooklyn.camp.brooklyn.spi.dsl.methods.DslComponent; +import org.apache.brooklyn.config.ConfigKey; +import org.apache.brooklyn.core.config.ConfigKeys; +import org.apache.brooklyn.core.sensor.AttributeSensorAndConfigKey; +import org.apache.brooklyn.core.sensor.Sensors; + +import com.google.common.base.Predicates; + +/** + * A test case that resolves target ID relative to an anchor entity. + * + * For example, to run tests against a named child of an entity: + * + * services + * - id: app + * brooklyn.children: + * id: child-id + * - id: test-case + * brooklyn.config: + * anchor:
[3/5] brooklyn-server git commit: LoopOverGroupMembersTestCase checks status of entities before deciding success/failure
LoopOverGroupMembersTestCase checks status of entities before deciding success/failure Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/8af60af0 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/8af60af0 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/8af60af0 Branch: refs/heads/master Commit: 8af60af0b5fcc7abfc4dad76598cd0dddcd4d4a9 Parents: 921a776 Author: Sam CorbettAuthored: Mon Jun 20 18:46:23 2016 +0100 Committer: Sam Corbett Committed: Wed Jul 6 12:02:07 2016 +0100 -- .../test/framework/LoopOverGroupMembersTestCaseImpl.java | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/8af60af0/test-framework/src/main/java/org/apache/brooklyn/test/framework/LoopOverGroupMembersTestCaseImpl.java -- diff --git a/test-framework/src/main/java/org/apache/brooklyn/test/framework/LoopOverGroupMembersTestCaseImpl.java b/test-framework/src/main/java/org/apache/brooklyn/test/framework/LoopOverGroupMembersTestCaseImpl.java index 8a10797..cbde76e 100644 --- a/test-framework/src/main/java/org/apache/brooklyn/test/framework/LoopOverGroupMembersTestCaseImpl.java +++ b/test-framework/src/main/java/org/apache/brooklyn/test/framework/LoopOverGroupMembersTestCaseImpl.java @@ -75,7 +75,12 @@ public class LoopOverGroupMembersTestCaseImpl extends TargetableTestComponentImp try { TargetableTestComponent targetableTestComponent = this.addChild(testSpecCopy); targetableTestComponent.start(locations); -logger.debug("Task of {} successfully run, targetting {}", this, member); +if (Lifecycle.RUNNING.equals(targetableTestComponent.sensors().get(Attributes.SERVICE_STATE_ACTUAL))) { +logger.debug("Task of {} successfully run, targetting {}", this, member); +} else { +logger.warn("Problem in child test-case of {}, targetting {}", this, member); +allSuccesful = false; +} } catch (Throwable t) { Exceptions.propagateIfFatal(t); logger.warn("Problem in child test-case of "+this+", targetting "+member, t);
[2/5] brooklyn-server git commit: Include entity in StaticSensor log statements
Include entity in StaticSensor log statements Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/0c0ec603 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/0c0ec603 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/0c0ec603 Branch: refs/heads/master Commit: 0c0ec603d1c10628f426af6d713f69a538e28d8a Parents: 8af60af Author: Sam CorbettAuthored: Wed Jul 6 11:26:41 2016 +0100 Committer: Sam Corbett Committed: Wed Jul 6 12:02:07 2016 +0100 -- .../java/org/apache/brooklyn/core/sensor/StaticSensor.java | 8 1 file changed, 4 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0c0ec603/core/src/main/java/org/apache/brooklyn/core/sensor/StaticSensor.java -- diff --git a/core/src/main/java/org/apache/brooklyn/core/sensor/StaticSensor.java b/core/src/main/java/org/apache/brooklyn/core/sensor/StaticSensor.java index 18978fa..a6a6170 100644 --- a/core/src/main/java/org/apache/brooklyn/core/sensor/StaticSensor.java +++ b/core/src/main/java/org/apache/brooklyn/core/sensor/StaticSensor.java @@ -83,15 +83,15 @@ public class StaticSensor extends AddSensor { public T call() throws Exception { Maybe v = resolveValue.get(); if (!v.isPresent()) { -log.debug(this+" not setting sensor "+sensor+"; cannot resolve "+value+" after timeout " + timeout); +log.debug(this+" not setting sensor "+sensor+" on "+entity+"; cannot resolve "+value+" after timeout " + timeout); return null; } -log.debug(this+" setting sensor "+sensor+" to "+v.get()); +log.debug(this+" setting sensor "+sensor+" to "+v.get()+" on "+entity); return entity.sensors().set(sensor, v.get()); } } -Task setValue = Tasks.builder().displayName("setting " + sensor).body(new SetValue()).build(); +Task setValue = Tasks.builder().displayName("Setting " + sensor + " on " + entity).body(new SetValue()).build(); -Entities.submit(entity, Tasks.sequential("resolving and setting " + sensor, resolveValue, setValue)); +Entities.submit(entity, Tasks.sequential("Resolving and setting " + sensor + " on " + entity, resolveValue, setValue)); } }
[1/5] brooklyn-server git commit: Delete all @author Javadoc from test-framework
Repository: brooklyn-server Updated Branches: refs/heads/master 749f75bf2 -> c4d505551 Delete all @author Javadoc from test-framework Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/921a7767 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/921a7767 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/921a7767 Branch: refs/heads/master Commit: 921a7767f06799447de75164915f4f1e263dafbd Parents: 1f2e2a1 Author: Sam CorbettAuthored: Wed Jun 15 16:47:20 2016 +0100 Committer: Sam Corbett Committed: Wed Jul 6 12:02:06 2016 +0100 -- .../framework/InfrastructureDeploymentTestCase.java| 3 --- .../InfrastructureDeploymentTestCaseImpl.java | 3 --- .../test/framework/LoopOverGroupMembersTestCase.java | 3 --- .../framework/LoopOverGroupMembersTestCaseImpl.java| 3 --- .../brooklyn/test/framework/ParallelTestCase.java | 2 -- .../brooklyn/test/framework/ParallelTestCaseImpl.java | 2 -- .../test/framework/TargetableTestComponent.java| 2 -- .../org/apache/brooklyn/test/framework/TestCase.java | 2 -- .../apache/brooklyn/test/framework/TestEffector.java | 2 -- .../brooklyn/test/framework/TestEffectorImpl.java | 3 --- .../test/framework/TestFrameworkAssertions.java| 2 -- .../apache/brooklyn/test/framework/TestHttpCall.java | 2 -- .../org/apache/brooklyn/test/framework/TestSensor.java | 2 -- .../InfrastructureDeploymentTestCaseTest.java | 3 --- .../framework/LoopOverGroupMembersTestCaseTest.java| 4 .../brooklyn/test/framework/TestEffectorTest.java | 3 --- .../test/framework/TestFrameworkAssertionsTest.java| 4 .../brooklyn/test/framework/TestHttpCallTest.java | 3 --- .../apache/brooklyn/test/framework/TestSensorTest.java | 3 --- .../brooklyn/test/framework/entity/TestEntity.java | 4 .../brooklyn/test/framework/entity/TestEntityImpl.java | 13 - .../test/framework/entity/TestInfrastructure.java | 4 .../test/framework/entity/TestInfrastructureImpl.java | 3 --- 23 files changed, 4 insertions(+), 71 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/921a7767/test-framework/src/main/java/org/apache/brooklyn/test/framework/InfrastructureDeploymentTestCase.java -- diff --git a/test-framework/src/main/java/org/apache/brooklyn/test/framework/InfrastructureDeploymentTestCase.java b/test-framework/src/main/java/org/apache/brooklyn/test/framework/InfrastructureDeploymentTestCase.java index 41ba1b7..7b2872e 100644 --- a/test-framework/src/main/java/org/apache/brooklyn/test/framework/InfrastructureDeploymentTestCase.java +++ b/test-framework/src/main/java/org/apache/brooklyn/test/framework/InfrastructureDeploymentTestCase.java @@ -30,9 +30,6 @@ import org.apache.brooklyn.core.entity.StartableApplication; import org.apache.brooklyn.core.entity.trait.Startable; import org.apache.brooklyn.entity.software.base.SoftwareProcess; -/** - * Created by graememiller on 04/12/2015. - */ @ImplementedBy(value = InfrastructureDeploymentTestCaseImpl.class) public interface InfrastructureDeploymentTestCase extends TargetableTestComponent { http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/921a7767/test-framework/src/main/java/org/apache/brooklyn/test/framework/InfrastructureDeploymentTestCaseImpl.java -- diff --git a/test-framework/src/main/java/org/apache/brooklyn/test/framework/InfrastructureDeploymentTestCaseImpl.java b/test-framework/src/main/java/org/apache/brooklyn/test/framework/InfrastructureDeploymentTestCaseImpl.java index 13504c8..b6eccd2 100644 --- a/test-framework/src/main/java/org/apache/brooklyn/test/framework/InfrastructureDeploymentTestCaseImpl.java +++ b/test-framework/src/main/java/org/apache/brooklyn/test/framework/InfrastructureDeploymentTestCaseImpl.java @@ -32,9 +32,6 @@ import org.apache.brooklyn.core.entity.lifecycle.Lifecycle; import org.apache.brooklyn.core.entity.trait.Startable; import org.apache.brooklyn.core.sensor.Sensors; -/** - * Created by graememiller on 04/12/2015. - */ public class InfrastructureDeploymentTestCaseImpl extends TestCaseImpl implements InfrastructureDeploymentTestCase { @Override http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/921a7767/test-framework/src/main/java/org/apache/brooklyn/test/framework/LoopOverGroupMembersTestCase.java -- diff --git
[2/2] brooklyn-docs git commit: This closes #84
This closes #84 Fix broken links to SSH keys docs Project: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/commit/ed10f420 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/tree/ed10f420 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/diff/ed10f420 Branch: refs/heads/master Commit: ed10f420b062b98f0beeebce89574baedcbcc9ba Parents: 9f2f0cf d922f5a Author: Sam CorbettAuthored: Thu Jun 30 17:28:41 2016 +0100 Committer: Sam Corbett Committed: Thu Jun 30 17:28:41 2016 +0100 -- guide/ops/locations/_byon.md | 2 +- guide/ops/locations/_clouds.md| 2 +- guide/ops/locations/_localhost.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) --
[1/2] brooklyn-docs git commit: Fix broken links to SSH keys docs
Repository: brooklyn-docs Updated Branches: refs/heads/master 9f2f0cf35 -> ed10f420b Fix broken links to SSH keys docs Project: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/commit/d922f5a9 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/tree/d922f5a9 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/diff/d922f5a9 Branch: refs/heads/master Commit: d922f5a9f000a90b53e9a659231ed8c831da1e61 Parents: 9f2f0cf Author: Mike ZaccardoAuthored: Wed Jun 29 12:49:03 2016 -0700 Committer: Mike Zaccardo Committed: Wed Jun 29 12:49:03 2016 -0700 -- guide/ops/locations/_byon.md | 2 +- guide/ops/locations/_clouds.md| 2 +- guide/ops/locations/_localhost.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/d922f5a9/guide/ops/locations/_byon.md -- diff --git a/guide/ops/locations/_byon.md b/guide/ops/locations/_byon.md index 38f6595..a7ab71b 100644 --- a/guide/ops/locations/_byon.md +++ b/guide/ops/locations/_byon.md @@ -13,7 +13,7 @@ Your nodes must meet the following prerequisites: - A suitable OS must have been installed on all nodes - The node must be running sshd (or similar) -- the brooklyn user must be able to ssh to each node as root or as a user with passwordless sudo permission. (For more information on SSH keys, see [here](ssh-keys.html).) +- the brooklyn user must be able to ssh to each node as root or as a user with passwordless sudo permission. (For more information on SSH keys, see [here](#ssh-keys).) To deploy to machines with known IP's in a blueprint, use the following syntax: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/d922f5a9/guide/ops/locations/_clouds.md -- diff --git a/guide/ops/locations/_clouds.md b/guide/ops/locations/_clouds.md index 4072a1a..24b92d0 100644 --- a/guide/ops/locations/_clouds.md +++ b/guide/ops/locations/_clouds.md @@ -154,7 +154,7 @@ For more keys and more detail on the keys below, see - Private keys can be specified using `privateKeyFile`; these are not copied to provisioned machines, but are required if using a local public key or a pre-defined `authorized_keys` on the server. - (For more information on SSH keys, see [here](ssh-keys.html).) + (For more information on SSH keys, see [here](#ssh-keys).) - If there is a passphrase on the key file being used, you must supply it to Brooklyn for it to work, of course! `privateKeyPassphrase` does the trick (as in `brooklyn.location.jclouds.privateKeyPassphrase`, or other places http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/d922f5a9/guide/ops/locations/_localhost.md -- diff --git a/guide/ops/locations/_localhost.md b/guide/ops/locations/_localhost.md index 7ac906a..8743be5 100644 --- a/guide/ops/locations/_localhost.md +++ b/guide/ops/locations/_localhost.md @@ -20,7 +20,7 @@ brooklyn.location.localhost.privateKeyPassphrase=s3cr3tPASSPHRASE Alternatively, you can create a specific localhost location through the location wizard tool available within the web console. This location will be saved as a [catalog entry]({{ site.path.guide }}/ops/catalog/index.html#locations-in-catalog) for easy reusability. -If you encounter issues or for more information, see [SSH Keys Localhost Setup](ssh-keys.html#localhost-setup). +If you encounter issues or for more information, see [SSH Keys Localhost Setup](#localhost-setup). If you are normally prompted for a password when executing `sudo` commands, passwordless `sudo` must also be enabled. To enable passwordless `sudo` for your account, a line must be added to the system `/etc/sudoers` file. To edit the file, use the `visudo` command: {% highlight bash %}
[1/4] brooklyn-server git commit: Machines.findUniqueElement returns absent when items is null
Repository: brooklyn-server Updated Branches: refs/heads/master 984a1e18f -> 6571bab4a Machines.findUniqueElement returns absent when items is null Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/79977e76 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/79977e76 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/79977e76 Branch: refs/heads/master Commit: 79977e768a88e6e3b36d59adb63c0ca32ad6ebcc Parents: 15d6c98 Author: Sam CorbettAuthored: Wed Feb 8 12:22:57 2017 + Committer: Sam Corbett Committed: Wed Feb 8 12:29:31 2017 + -- .../main/java/org/apache/brooklyn/core/location/Machines.java | 7 ++- .../java/org/apache/brooklyn/core/location/MachinesTest.java | 5 + 2 files changed, 11 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/79977e76/core/src/main/java/org/apache/brooklyn/core/location/Machines.java -- diff --git a/core/src/main/java/org/apache/brooklyn/core/location/Machines.java b/core/src/main/java/org/apache/brooklyn/core/location/Machines.java index 9163694..2a2ccba 100644 --- a/core/src/main/java/org/apache/brooklyn/core/location/Machines.java +++ b/core/src/main/java/org/apache/brooklyn/core/location/Machines.java @@ -23,6 +23,8 @@ import java.util.Collection; import java.util.Iterator; import java.util.Set; +import javax.annotation.Nonnull; + import org.apache.brooklyn.api.entity.Entity; import org.apache.brooklyn.api.location.Location; import org.apache.brooklyn.api.location.MachineLocation; @@ -83,9 +85,12 @@ public class Machines { return Maybe.fromNullable(result); } +@Nonnull @SuppressWarnings("unchecked") public static Maybe findUniqueElement(Iterable items, Class type) { -if (items==null) return null; +if (items == null) { +return Maybe.absent(new NullPointerException("Null iterable")); +} Iterator i = items.iterator(); T result = null; while (i.hasNext()) { http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/79977e76/core/src/test/java/org/apache/brooklyn/core/location/MachinesTest.java -- diff --git a/core/src/test/java/org/apache/brooklyn/core/location/MachinesTest.java b/core/src/test/java/org/apache/brooklyn/core/location/MachinesTest.java index bc578bd..3e36f7a 100644 --- a/core/src/test/java/org/apache/brooklyn/core/location/MachinesTest.java +++ b/core/src/test/java/org/apache/brooklyn/core/location/MachinesTest.java @@ -90,6 +90,11 @@ public class MachinesTest extends BrooklynAppUnitTestSupport { } @Test +public void testFindUniqueElementAbsentWhenItemsNull() throws Exception { +assertTrue(Machines.findUniqueElement(null, SshMachineLocation.class).isAbsent()); +} + +@Test public void testFindSubnetIpFromAttribute() throws Exception { TestEntity entity = app.addChild(EntitySpec.create(TestEntity.class) .location(sshMachineSpec));
[3/4] brooklyn-server git commit: MultimapSerializer works with non-String keys
MultimapSerializer works with non-String keys Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/148ac04c Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/148ac04c Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/148ac04c Branch: refs/heads/master Commit: 148ac04c0655e2207171073f7bf4e5d1dba7e751 Parents: 79977e7 Author: Sam CorbettAuthored: Wed Feb 8 12:22:28 2017 + Committer: Sam Corbett Committed: Wed Feb 8 14:21:00 2017 + -- .../util/core/json/MultimapSerializer.java | 2 +- .../util/core/json/MultimapSerializerTest.java | 72 2 files changed, 73 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/148ac04c/core/src/main/java/org/apache/brooklyn/util/core/json/MultimapSerializer.java -- diff --git a/core/src/main/java/org/apache/brooklyn/util/core/json/MultimapSerializer.java b/core/src/main/java/org/apache/brooklyn/util/core/json/MultimapSerializer.java index 53ce3f5..a6522fa 100644 --- a/core/src/main/java/org/apache/brooklyn/util/core/json/MultimapSerializer.java +++ b/core/src/main/java/org/apache/brooklyn/util/core/json/MultimapSerializer.java @@ -56,7 +56,7 @@ public class MultimapSerializer extends StdSerializer { private void writeEntries(Multimap value, JsonGenerator jgen, SerializerProvider provider) throws IOException { for (Map.Entry> entry : value.asMap().entrySet()) { -provider.findKeySerializer(provider.constructType(String.class), null) +provider.findKeySerializer(provider.constructType(Object.class), null) .serialize(entry.getKey(), jgen, provider); provider.defaultSerializeValue(Lists.newArrayList(entry.getValue()), jgen); } http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/148ac04c/core/src/test/java/org/apache/brooklyn/util/core/json/MultimapSerializerTest.java -- diff --git a/core/src/test/java/org/apache/brooklyn/util/core/json/MultimapSerializerTest.java b/core/src/test/java/org/apache/brooklyn/util/core/json/MultimapSerializerTest.java new file mode 100644 index 000..902e377 --- /dev/null +++ b/core/src/test/java/org/apache/brooklyn/util/core/json/MultimapSerializerTest.java @@ -0,0 +1,72 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.brooklyn.util.core.json; + +import static org.testng.Assert.assertEquals; + +import org.apache.brooklyn.api.entity.Entity; +import org.apache.brooklyn.api.entity.EntitySpec; +import org.apache.brooklyn.core.test.BrooklynAppUnitTestSupport; +import org.apache.brooklyn.entity.stock.BasicEntity; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +import com.fasterxml.jackson.core.Version; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.module.SimpleModule; +import com.google.common.collect.Multimap; +import com.google.common.collect.MultimapBuilder; + +public class MultimapSerializerTest extends BrooklynAppUnitTestSupport { + +ObjectMapper mapper; + +@Override +@BeforeMethod(alwaysRun = true) +public void setUp() throws Exception { +super.setUp(); +mapper = new ObjectMapper(); +SimpleModule mapperModule = new SimpleModule("MultimapSerializerTest", new Version(0, 0, 0, "ignored", null, null)); +mapperModule.addSerializer(new MultimapSerializer()); +mapper.registerModule(mapperModule); +} + +@Test +public void testSerializeStringKey() throws Exception { +Multimap map = MultimapBuilder.hashKeys().arrayListValues().build(); +map.put("a", 1); +map.put("a", 2); +map.put("a", 3); +String json =
[4/4] brooklyn-server git commit: This closes #553
This closes #553 MultimapSerializer works with non-String keys Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/6571bab4 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/6571bab4 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/6571bab4 Branch: refs/heads/master Commit: 6571bab4a91c6a038c5bb564173e9a8101d417a3 Parents: 984a1e1 148ac04 Author: Sam CorbettAuthored: Wed Feb 8 15:21:45 2017 + Committer: Sam Corbett Committed: Wed Feb 8 15:21:45 2017 + -- .../apache/brooklyn/core/location/Machines.java | 7 +- .../util/core/json/MultimapSerializer.java | 2 +- .../brooklyn/core/location/MachinesTest.java| 5 ++ .../util/core/json/MultimapSerializerTest.java | 72 .../jclouds/networking/SecurityGroupEditor.java | 18 ++--- 5 files changed, 90 insertions(+), 14 deletions(-) --
[2/2] brooklyn-client git commit: This closes #37
This closes #37 Add missing @Override annotations and other cleanup Project: http://git-wip-us.apache.org/repos/asf/brooklyn-client/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-client/commit/88bb5e7b Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-client/tree/88bb5e7b Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-client/diff/88bb5e7b Branch: refs/heads/master Commit: 88bb5e7bda81869ff4957e7f50ada7decbaf1dbe Parents: 8ecbfe7 ee59562 Author: Sam CorbettAuthored: Mon Feb 6 14:58:15 2017 + Committer: Sam Corbett Committed: Mon Feb 6 14:58:15 2017 + -- .../brooklyn/rest/client/ApplicationResourceIntegrationTest.java | 2 ++ 1 file changed, 2 insertions(+) --
[1/2] brooklyn-library git commit: Fix test to work on any combination of OS & eol type.
Repository: brooklyn-library Updated Branches: refs/heads/master a72962bee -> f3cbc42e7 Fix test to work on any combination of OS & eol type. Change line endings for generated script as it's most likely to run in a unix environment. Normalize line endings when comparing scripts to work with any combination of OS & line endings (for tests running on Windows mostly). On Windows you can have both CRLF or LF line endings in the files (or even mixed), depending on how git is configured. That's out of our control so try to support any environment. The recommended confgiuration is "git --global core.autocrlf true", but Apache Jenkins machines have "core.autocrlf" set to "input". The former will lead to CRLF line endings, the latter to LF line endings on checkout. Project: http://git-wip-us.apache.org/repos/asf/brooklyn-library/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-library/commit/a59863f0 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-library/tree/a59863f0 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-library/diff/a59863f0 Branch: refs/heads/master Commit: a59863f0a653840067ad6ab63d7475d4af1fa402 Parents: f1ff646 Author: Svetoslav NeykovAuthored: Tue Nov 1 18:38:47 2016 +0200 Committer: Svetoslav Neykov Committed: Tue Nov 1 18:38:47 2016 +0200 -- .../dns/geoscaling/GeoscalingScriptGenerator.java | 14 +++--- .../geoscaling/GeoscalingScriptGeneratorTest.java | 18 +++--- 2 files changed, 22 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/a59863f0/software/webapp/src/main/java/org/apache/brooklyn/entity/dns/geoscaling/GeoscalingScriptGenerator.java -- diff --git a/software/webapp/src/main/java/org/apache/brooklyn/entity/dns/geoscaling/GeoscalingScriptGenerator.java b/software/webapp/src/main/java/org/apache/brooklyn/entity/dns/geoscaling/GeoscalingScriptGenerator.java index 1d1f4f5..367afbb 100644 --- a/software/webapp/src/main/java/org/apache/brooklyn/entity/dns/geoscaling/GeoscalingScriptGenerator.java +++ b/software/webapp/src/main/java/org/apache/brooklyn/entity/dns/geoscaling/GeoscalingScriptGenerator.java @@ -54,18 +54,18 @@ public class GeoscalingScriptGenerator { private static String getHostsDeclaration(Collection hosts) { StringBuffer sb = new StringBuffer(); -sb.append("$hosts = array(").append(Os.LINE_SEPARATOR); +sb.append("$hosts = array(\n"); Iterator iServer = hosts.iterator(); while (iServer.hasNext()) { HostGeoInfo server = iServer.next(); -sb.append("array('name' => '").append(escape(server.displayName)).append("',").append(Os.LINE_SEPARATOR); -sb.append(" 'latitude' => ").append(server.latitude).append(",").append(Os.LINE_SEPARATOR); -sb.append(" 'longitude' => ").append(server.longitude).append(",").append(Os.LINE_SEPARATOR); +sb.append("array('name' => '").append(escape(server.displayName)).append("',\n"); +sb.append(" 'latitude' => ").append(server.latitude).append(",\n"); +sb.append(" 'longitude' => ").append(server.longitude).append(",\n"); sb.append(" 'ip'=> '").append(escape(server.address)).append("')"); -if (iServer.hasNext()) sb.append(",").append(Os.LINE_SEPARATOR); -sb.append(Os.LINE_SEPARATOR); +if (iServer.hasNext()) sb.append(",\n"); +sb.append("\n"); } -sb.append(");").append(Os.LINE_SEPARATOR); +sb.append(");").append("\n"); return sb.toString(); } http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/a59863f0/software/webapp/src/test/java/org/apache/brooklyn/entity/dns/geoscaling/GeoscalingScriptGeneratorTest.java -- diff --git a/software/webapp/src/test/java/org/apache/brooklyn/entity/dns/geoscaling/GeoscalingScriptGeneratorTest.java b/software/webapp/src/test/java/org/apache/brooklyn/entity/dns/geoscaling/GeoscalingScriptGeneratorTest.java index 4e8ef2c..627feee 100644 --- a/software/webapp/src/test/java/org/apache/brooklyn/entity/dns/geoscaling/GeoscalingScriptGeneratorTest.java +++ b/software/webapp/src/test/java/org/apache/brooklyn/entity/dns/geoscaling/GeoscalingScriptGeneratorTest.java @@ -48,10 +48,22 @@ public class GeoscalingScriptGeneratorTest { String generatedScript = GeoscalingScriptGenerator.generateScriptString(generationTime, HOSTS); assertTrue(generatedScript.contains("1.2.3")); String expectedScript =
[2/2] brooklyn-library git commit: This closes #72
This closes #72 Fix test to work on any combination of OS & eol type. Project: http://git-wip-us.apache.org/repos/asf/brooklyn-library/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-library/commit/f3cbc42e Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-library/tree/f3cbc42e Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-library/diff/f3cbc42e Branch: refs/heads/master Commit: f3cbc42e7b87c12a56d158dcd52a531f0fd3943e Parents: a72962b a59863f Author: Sam CorbettAuthored: Mon Feb 6 14:57:12 2017 + Committer: Sam Corbett Committed: Mon Feb 6 14:57:12 2017 + -- .../dns/geoscaling/GeoscalingScriptGenerator.java | 14 +++--- .../geoscaling/GeoscalingScriptGeneratorTest.java | 18 +++--- 2 files changed, 22 insertions(+), 10 deletions(-) --
[1/2] brooklyn-client git commit: Add missing @Override annotation to method signatures overriding interface methods
Repository: brooklyn-client Updated Branches: refs/heads/master 8ecbfe786 -> 88bb5e7bd Add missing @Override annotation to method signatures overriding interface methods Project: http://git-wip-us.apache.org/repos/asf/brooklyn-client/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-client/commit/ee595623 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-client/tree/ee595623 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-client/diff/ee595623 Branch: refs/heads/master Commit: ee59562307d9305b4c4d08b897285076c6d5ff7e Parents: 8ecbfe7 Author: Svetoslav NeykovAuthored: Fri Jan 20 16:07:33 2017 +0200 Committer: Svetoslav Neykov Committed: Fri Feb 3 18:52:58 2017 +0200 -- .../brooklyn/rest/client/ApplicationResourceIntegrationTest.java | 2 ++ 1 file changed, 2 insertions(+) -- http://git-wip-us.apache.org/repos/asf/brooklyn-client/blob/ee595623/java/src/test/java/org/apache/brooklyn/rest/client/ApplicationResourceIntegrationTest.java -- diff --git a/java/src/test/java/org/apache/brooklyn/rest/client/ApplicationResourceIntegrationTest.java b/java/src/test/java/org/apache/brooklyn/rest/client/ApplicationResourceIntegrationTest.java index 81d789f..df91ba8 100644 --- a/java/src/test/java/org/apache/brooklyn/rest/client/ApplicationResourceIntegrationTest.java +++ b/java/src/test/java/org/apache/brooklyn/rest/client/ApplicationResourceIntegrationTest.java @@ -162,6 +162,7 @@ public class ApplicationResourceIntegrationTest { Assert.assertNotNull(response); try { Asserts.succeedsEventually(ImmutableMap.of("timeout", Duration.minutes(1)), new Runnable() { +@Override public void run() { try { ApplicationSummary summary = api.getApplicationApi().get("redis-app"); @@ -182,6 +183,7 @@ public class ApplicationResourceIntegrationTest { private void assertServiceStateEventually(final String app, final String entity, final Lifecycle state, Duration timeout) { Asserts.succeedsEventually(ImmutableMap.of("timeout", timeout), new Runnable() { +@Override public void run() { Object status = api.getSensorApi().get(app, entity, "service.state", false); assertTrue(state.toString().equalsIgnoreCase(status.toString()), "status="+status);
[1/2] brooklyn-server git commit: Adds test for catalog-effector from OSGi bundle
Repository: brooklyn-server Updated Branches: refs/heads/master c5fc588c3 -> 8ad5578c1 Adds test for catalog-effector from OSGi bundle Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/d893d529 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/d893d529 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/d893d529 Branch: refs/heads/master Commit: d893d529bccb2cea3b4511a4409a378d2253b8be Parents: 494ae6f Author: Aled SageAuthored: Thu Jan 19 12:37:42 2017 + Committer: Aled Sage Committed: Thu Jan 19 12:37:42 2017 + -- .../CatalogOsgiVersionMoreEntityRebindTest.java | 41 1 file changed, 41 insertions(+) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/d893d529/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogOsgiVersionMoreEntityRebindTest.java -- diff --git a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogOsgiVersionMoreEntityRebindTest.java b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogOsgiVersionMoreEntityRebindTest.java index b4af697..cee7a4d 100644 --- a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogOsgiVersionMoreEntityRebindTest.java +++ b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogOsgiVersionMoreEntityRebindTest.java @@ -20,6 +20,7 @@ package org.apache.brooklyn.camp.brooklyn.catalog; import static org.testng.Assert.assertEquals; +import org.apache.brooklyn.api.effector.Effector; import org.apache.brooklyn.api.entity.Entity; import org.apache.brooklyn.api.location.Location; import org.apache.brooklyn.api.location.LocationSpec; @@ -39,6 +40,7 @@ import org.slf4j.LoggerFactory; import org.testng.annotations.Test; import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; import com.google.common.collect.Iterables; /** Many of the same tests as per {@link OsgiVersionMoreEntityTest} but using YAML for catalog and entities, so catalog item ID is set automatically */ @@ -128,4 +130,43 @@ public class CatalogOsgiVersionMoreEntityRebindTest extends AbstractYamlRebindTe Location newLoc = Iterables.getOnlyElement(newEntity.getLocations()); assertEquals(newLoc.getClass().getName(), locationType); } + +@Test +public void testEffectorInBundleReferencedByStockCatalogItem() throws Exception { + TestResourceUnavailableException.throwIfResourceUnavailable(getClass(), OsgiTestResources.BROOKLYN_TEST_OSGI_ENTITIES_COM_EXAMPLE_PATH); + +String effectorType = OsgiTestResources.BROOKLYN_TEST_OSGI_ENTITIES_COM_EXAMPLE_EFFECTOR; + +addCatalogItems( +"brooklyn.catalog:", +" id: wrapped-entity", +" version: 1.0", +" item:", +"services:", +"- type: " + TestEntity.class.getName()); + +addCatalogItems( +"brooklyn.catalog:", +" id: with-effector-from-library", +" version: 1.0", +" brooklyn.libraries:", +" - classpath:" + OsgiTestResources.BROOKLYN_TEST_OSGI_ENTITIES_COM_EXAMPLE_PATH, +" item:", +"services:", +"- type: " + BasicApplication.class.getName(), +" brooklyn.children:", +" - type: wrapped-entity:1.0", +"brooklyn.initializers:", +"- type: " + effectorType); + +Entity app = createAndStartApplication("services: [ { type: 'with-effector-from-library:1.0' } ]"); +Entity entity = Iterables.getOnlyElement(app.getChildren()); +Effector effector = entity.getEntityType().getEffectorByName("myEffector").get(); +entity.invoke(effector, ImmutableMap. of()).get(); + +StartableApplication newApp = rebind(); +Entity newEntity = Iterables.getOnlyElement(newApp.getChildren()); +Effector newEffector = newEntity.getEntityType().getEffectorByName("myEffector").get(); +newEntity.invoke(newEffector, ImmutableMap. of()).get(); +} }
[16/17] brooklyn-server git commit: Remove unnecessary casts
Remove unnecessary casts Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/c0f11d07 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/c0f11d07 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/c0f11d07 Branch: refs/heads/master Commit: c0f11d0748698d8368a7a0619f53ad6806ac7b5b Parents: 070d4ef Author: Svetoslav NeykovAuthored: Fri Jan 20 16:58:08 2017 +0200 Committer: Svetoslav Neykov Committed: Fri Jan 20 16:58:08 2017 +0200 -- .../apache/brooklyn/camp/spi/pdp/Artifact.java | 2 +- .../camp/spi/pdp/ArtifactRequirement.java | 2 +- .../BrooklynComponentTemplateResolver.java | 2 +- .../creation/BrooklynYamlLocationResolver.java | 2 +- .../spi/dsl/BrooklynDslInterpreter.java | 2 +- .../spi/dsl/DslDeferredFunctionCall.java| 2 +- .../spi/dsl/methods/BrooklynDslCommon.java | 4 +-- .../brooklyn/spi/dsl/methods/DslComponent.java | 4 +-- .../camp/brooklyn/EnrichersYamlTest.java| 2 +- .../camp/brooklyn/EntitiesYamlTest.java | 4 +-- .../camp/brooklyn/LocationsYamlTest.java| 22 - .../brooklyn/camp/brooklyn/ObjectsYamlTest.java | 2 +- .../camp/brooklyn/PoliciesYamlTest.java | 2 +- .../camp/brooklyn/WindowsYamlLiveTest.java | 2 +- .../catalog/CatalogYamlLocationTest.java| 2 +- .../camp/server/rest/util/DtoFactory.java | 2 +- .../catalog/internal/BasicBrooklynCatalog.java | 6 ++--- .../core/catalog/internal/CatalogDto.java | 2 +- .../config/internal/AbstractConfigMapImpl.java | 2 +- .../brooklyn/core/entity/AbstractEntity.java| 2 +- .../brooklyn/core/entity/EntityFunctions.java | 4 +-- .../brooklyn/core/entity/EntityRelations.java | 2 +- .../drivers/ReflectiveEntityDriverFactory.java | 2 +- .../core/entity/factory/ApplicationBuilder.java | 4 +-- .../entity/lifecycle/ServiceStateLogic.java | 2 +- .../core/feed/AttributePollHandler.java | 2 +- .../impl/ConcurrentMapAcceptingNullVals.java| 2 +- .../core/location/CatalogLocationResolver.java | 2 +- .../core/mgmt/EntityManagementUtils.java| 2 +- .../ha/dto/BasicManagementNodeSyncRecord.java | 2 +- .../core/mgmt/internal/EffectorUtils.java | 2 +- .../core/mgmt/internal/LocalEntityManager.java | 2 +- .../mgmt/rebind/BasicEntityRebindSupport.java | 6 ++--- .../core/mgmt/rebind/RebindIteration.java | 8 +++--- .../mgmt/rebind/dto/MementosGenerators.java | 2 +- .../core/objs/proxy/InternalEntityFactory.java | 2 +- .../brooklyn/core/sensor/AttributeMap.java | 2 +- ...platedStringAttributeSensorAndConfigKey.java | 2 +- .../core/server/BrooklynServerPaths.java| 2 +- .../stock/CustomAggregatingEnricher.java| 2 +- .../brooklyn/enricher/stock/Enrichers.java | 8 +++--- .../SshCommandMembershipTrackingPolicy.java | 2 +- .../brooklyn/entity/stock/DelegateEntity.java | 2 +- .../brooklyn/feed/http/HttpValueFunctions.java | 2 +- .../brooklyn/feed/http/JsonFunctions.java | 4 +-- .../location/byon/ByonLocationResolver.java | 2 +- .../FixedListMachineProvisioningLocation.java | 2 +- .../LocalhostMachineProvisioningLocation.java | 4 +-- .../location/ssh/SshMachineLocation.java| 2 +- .../util/core/internal/ssh/sshj/SshjTool.java | 2 +- .../util/core/json/MultimapSerializer.java | 2 +- .../util/core/task/BasicExecutionContext.java | 2 +- .../util/core/task/BasicExecutionManager.java | 2 +- .../brooklyn/util/core/task/BasicTask.java | 4 +-- .../core/effector/EffectorTaskTest.java | 6 ++--- .../core/effector/ssh/SshEffectorTasksTest.java | 4 +-- .../entity/DynamicEntityTypeConfigTest.java | 2 +- .../core/entity/EntityConfigUsageTest.java | 2 +- .../core/location/TestPortSupplierLocation.java | 2 +- .../core/mgmt/internal/EffectorUtilsTest.java | 6 ++--- .../mgmt/osgi/OsgiVersionMoreEntityTest.java| 2 +- .../core/mgmt/rebind/RebindEnricherTest.java| 8 +++--- .../core/mgmt/rebind/RebindEntityTest.java | 2 +- .../core/mgmt/rebind/RebindFeedTest.java| 12 - .../core/mgmt/rebind/RebindFeedWithHaTest.java | 6 ++--- .../rebind/RebindLocalhostLocationTest.java | 2 +- .../core/mgmt/rebind/RebindLocationTest.java| 18 +++--- .../core/mgmt/rebind/RebindPolicyTest.java | 2 +- .../rebind/RebindSshMachineLocationTest.java| 4 +-- .../network/OnPublicNetworkEnricherTest.java| 6 ++--- .../network/OnSubnetNetworkEnricherTest.java| 4 +-- .../core/test/entity/TestApplicationImpl.java | 2 +- .../typereg/RegisteredTypePredicatesTest.java | 4 +-- ...CustomAggregatingEnricherDeprecatedTest.java | 2 +-
[09/17] brooklyn-server git commit: Add missing @Override annotation to method signatures overriding interface methods
Add missing @Override annotation to method signatures overriding interface methods Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/e61caea4 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/e61caea4 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/e61caea4 Branch: refs/heads/master Commit: e61caea44a535ea1aeda0ea8633b3a0d7c38c8ec Parents: 0d2d5d6 Author: Svetoslav NeykovAuthored: Fri Jan 20 16:00:40 2017 +0200 Committer: Svetoslav Neykov Committed: Fri Jan 20 16:17:09 2017 +0200 -- .../org/apache/brooklyn/api/entity/Entity.java | 2 + .../apache/brooklyn/api/entity/EntityLocal.java | 1 + .../brooklyn/api/location/MachineLocation.java | 1 + .../java/org/apache/brooklyn/api/mgmt/Task.java | 1 + .../mementos/BrooklynMementoManifest.java | 1 + .../org/apache/brooklyn/api/policy/Policy.java | 1 + .../brooklyn/camp/AggregatingCampPlatform.java | 6 +++ .../collection/AggregatingResourceLookup.java | 2 + .../spi/collection/BasicResourceLookup.java | 2 + .../camp/spi/collection/ResourceLookup.java | 3 ++ .../BasicAssemblyTemplateInstantiator.java | 1 + .../brooklyn/camp/spi/resolve/PdpMatcher.java | 2 + .../web/MockAssemblyTemplateInstantiator.java | 1 + .../camp/test/mock/web/MockWebPlatform.java | 2 + .../camp/brooklyn/BrooklynCampPlatform.java | 2 + .../brooklyn/ConfigInheritanceYamlTest.java | 2 + .../camp/brooklyn/ConfigParametersYamlTest.java | 1 + .../brooklyn/camp/brooklyn/ConfigYamlTest.java | 3 ++ .../DependentConfigPollingYamlTest.java | 2 + .../camp/brooklyn/EnrichersYamlTest.java| 3 ++ .../camp/brooklyn/EntitiesYamlTest.java | 1 + .../brooklyn/TestEntityWithInitConfigImpl.java | 1 + .../TestSensorAndEffectorInitializer.java | 1 + .../qa/performance/CatalogPerformanceTest.java | 6 +++ .../brooklyn/camp/brooklyn/spi/dsl/DslTest.java | 3 ++ .../camp/server/rest/util/CampRestGuavas.java | 1 + .../camp/server/rest/util/DtoFactory.java | 2 + .../AbstractExternalConfigSupplier.java | 1 + .../external/InPlaceExternalConfigSupplier.java | 1 + .../PropertiesFileExternalConfigSupplier.java | 1 + .../external/UrlsExternalConfigSupplier.java| 1 + .../config/internal/AbstractConfigMapImpl.java | 2 + .../internal/AbstractStructuredConfigKey.java | 2 + .../core/config/render/RendererHints.java | 1 + .../core/effector/ssh/SshEffectorTasks.java | 3 ++ .../brooklyn/core/entity/AbstractEntity.java| 1 + .../apache/brooklyn/core/entity/Entities.java | 2 + .../drivers/BasicEntityDriverManager.java | 1 + .../drivers/RegistryEntityDriverFactory.java| 1 + .../DownloadProducerFromCloudsoftRepo.java | 1 + .../DownloadProducerFromLocalRepo.java | 1 + .../DownloadProducerFromProperties.java | 1 + .../AbstractConfigurableEntityFactory.java | 6 +++ .../org/apache/brooklyn/core/feed/Poller.java | 4 +- .../core/internal/BrooklynProperties.java | 1 + .../core/internal/BrooklynPropertiesImpl.java | 17 ++- .../storage/impl/BrooklynStorageImpl.java | 1 + .../core/location/BasicLocationDefinition.java | 3 ++ .../core/location/BasicMachineMetadata.java | 5 ++ .../brooklyn/core/location/PortRanges.java | 6 +-- .../location/access/PortForwardManager.java | 1 + .../cloud/names/AbstractCloudMachineNamer.java | 3 ++ .../location/geo/GeoBytesHostGeoLookup.java | 1 + .../location/geo/MaxMind2HostGeoLookup.java | 1 + .../core/location/geo/UtraceHostGeoLookup.java | 1 + .../core/mgmt/ha/BasicMasterChooser.java| 1 + .../mgmt/ha/HighAvailabilityManagerImpl.java| 2 + .../internal/AbstractManagementContext.java | 3 ++ .../internal/AbstractSubscriptionManager.java | 9 .../internal/AsyncCollectionChangeAdapter.java | 2 + ...PropertyChangeToCollectionChangeAdapter.java | 1 + .../core/mgmt/internal/LocalEntityManager.java | 5 +- .../mgmt/internal/LocalLocationManager.java | 5 +- .../mgmt/internal/LocalSubscriptionManager.java | 5 ++ .../core/mgmt/internal/LocalUsageManager.java | 4 ++ .../BrooklynMementoPersisterToObjectStore.java | 5 ++ .../rebind/PeriodicDeltaChangeListener.java | 1 + .../core/mgmt/rebind/PersisterDeltaImpl.java| 2 + .../core/mgmt/rebind/RebindContextImpl.java | 3 ++ .../mgmt/rebind/RebindExceptionHandlerImpl.java | 1 + .../core/mgmt/rebind/RebindManagerImpl.java | 2 + .../mgmt/rebind/dto/BasicEntityMemento.java | 1 + .../transformer/impl/XsltTransformer.java | 1 + .../AbstractConfigurationSupportInternal.java | 2 + .../core/objs/BasicConfigurableObject.java | 2 +
[14/17] brooklyn-server git commit: Remove unnecessary casts
http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/c0f11d07/utils/common/src/main/java/org/apache/brooklyn/util/javalang/Boxing.java -- diff --git a/utils/common/src/main/java/org/apache/brooklyn/util/javalang/Boxing.java b/utils/common/src/main/java/org/apache/brooklyn/util/javalang/Boxing.java index 87529ad..5838df9 100644 --- a/utils/common/src/main/java/org/apache/brooklyn/util/javalang/Boxing.java +++ b/utils/common/src/main/java/org/apache/brooklyn/util/javalang/Boxing.java @@ -116,7 +116,7 @@ public class Boxing { Array.setShort(target, index, (Short)value); else if (type.equals(Void.TYPE)) -Array.set(target, index, (Void)value); +Array.set(target, index, value); else // should not happen! http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/c0f11d07/utils/common/src/main/java/org/apache/brooklyn/util/javalang/coerce/EnumTypeCoercions.java -- diff --git a/utils/common/src/main/java/org/apache/brooklyn/util/javalang/coerce/EnumTypeCoercions.java b/utils/common/src/main/java/org/apache/brooklyn/util/javalang/coerce/EnumTypeCoercions.java index b57625a..e8e84b7 100644 --- a/utils/common/src/main/java/org/apache/brooklyn/util/javalang/coerce/EnumTypeCoercions.java +++ b/utils/common/src/main/java/org/apache/brooklyn/util/javalang/coerce/EnumTypeCoercions.java @@ -52,7 +52,7 @@ public class EnumTypeCoercions { @SuppressWarnings({ "unchecked", "rawtypes" }) public static FunctionstringToEnumUntyped(final Class type, @Nullable final T defaultValue) { if (!type.isEnum()) return new Functionals.ConstantFunction (null); -return (Function ) new StringToEnumFunction((Class)type, (Enum)defaultValue); +return new StringToEnumFunction((Class)type, (Enum)defaultValue); } private static class StringToEnumFunction> implements Function { http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/c0f11d07/utils/common/src/main/java/org/apache/brooklyn/util/javalang/coerce/PrimitiveStringTypeCoercions.java -- diff --git a/utils/common/src/main/java/org/apache/brooklyn/util/javalang/coerce/PrimitiveStringTypeCoercions.java b/utils/common/src/main/java/org/apache/brooklyn/util/javalang/coerce/PrimitiveStringTypeCoercions.java index 9812d93..0b2a636 100644 --- a/utils/common/src/main/java/org/apache/brooklyn/util/javalang/coerce/PrimitiveStringTypeCoercions.java +++ b/utils/common/src/main/java/org/apache/brooklyn/util/javalang/coerce/PrimitiveStringTypeCoercions.java @@ -96,7 +96,7 @@ public class PrimitiveStringTypeCoercions { // (we could say 0=false, nonzero=true, but there is no compelling use case so better // to encourage users to write as boolean) if (sourceWrapType == Character.class) -return (T) stringToPrimitive(value.toString(), targetType); +return stringToPrimitive(value.toString(), targetType); throw new ClassCoercionException("Cannot cast "+sourceWrapType+" ("+value+") to "+targetType); } else if (sourceWrapType == Boolean.class) { @@ -109,13 +109,13 @@ public class PrimitiveStringTypeCoercions { long v = 0; boolean islong = true; if (sourceWrapType == Character.class) { -v = (long) ((Character)value).charValue(); +v = ((Character)value).charValue(); } else if (sourceWrapType == Byte.class) { -v = (long) ((Byte)value).byteValue(); +v = ((Byte)value).byteValue(); } else if (sourceWrapType == Short.class) { -v = (long) ((Short)value).shortValue(); +v = ((Short)value).shortValue(); } else if (sourceWrapType == Integer.class) { -v = (long) ((Integer)value).intValue(); +v = ((Integer)value).intValue(); } else if (sourceWrapType == Long.class) { v = ((Long)value).longValue(); } else { @@ -126,9 +126,9 @@ public class PrimitiveStringTypeCoercions { if (targetWrapType == Byte.class) return (T) Byte.valueOf((byte)v); if (targetWrapType == Short.class) return (T) Short.valueOf((short)v); if (targetWrapType == Integer.class) return (T) Integer.valueOf((int)v); -if (targetWrapType == Long.class) return (T) Long.valueOf((long)v); -if (targetWrapType == Float.class) return (T) Float.valueOf((float)v); -if (targetWrapType == Double.class) return (T) Double.valueOf((double)v); +if (targetWrapType == Long.class) return (T) Long.valueOf(v); +if (targetWrapType == Float.class) return (T)