[3/3] brooklyn-docs git commit: This closes #92
This closes #92 Project: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/commit/9bf6f462 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/tree/9bf6f462 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/diff/9bf6f462 Branch: refs/heads/master Commit: 9bf6f4622527540eac058975fd7f946ca2bda005 Parents: 64edb80 Author: Aled Sage Authored: Tue Jul 19 12:14:04 2016 +0100 Committer: Aled Sage Committed: Tue Jul 19 12:14:04 2016 +0100 -- --
[2/3] brooklyn-docs git commit: tweak to wording of Getting Started guide
tweak to wording of Getting Started guide Project: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/commit/64edb800 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/tree/64edb800 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/diff/64edb800 Branch: refs/heads/master Commit: 64edb8000ec51f7ab4a2848872d047eff0c2 Parents: 670e689 Author: Murdo Aird Authored: Thu Jul 14 21:04:05 2016 +0100 Committer: Aled Sage Committed: Tue Jul 19 12:09:11 2016 +0100 -- guide/start/running.md | 2 -- 1 file changed, 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/64edb800/guide/start/running.md -- diff --git a/guide/start/running.md b/guide/start/running.md index 3db08de..12758c8 100644 --- a/guide/start/running.md +++ b/guide/start/running.md @@ -7,8 +7,6 @@ menu_parent: index.md This guide will walk you through deploying an example 3-tier web application to a public cloud, and demonstrate the autoscaling capabilities of the Brooklyn platform. -An overview of core [Brooklyn concepts](./concept-quickstart.html) is available for reference. - Two methods of deployment are detailed in this tutorial, using virtualisation with Vagrant and an install in your own environment (such as your local machine or in your private/public cloud). The latter assumes that you have a [Java Runtime Environment (JRE)](https://www.java.com){:target="_blank"} installed (version 7 or later), as Brooklyn is Java under the covers.
[1/3] brooklyn-docs git commit: simplified Brooklyn download text
Repository: brooklyn-docs Updated Branches: refs/heads/master 4a2aeadb2 -> 9bf6f4622 simplified Brooklyn download text Project: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/commit/670e689c Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/tree/670e689c Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/diff/670e689c Branch: refs/heads/master Commit: 670e689ce32d2fd2559d3cdee1719209c6ede3dc Parents: 4a2aead Author: Murdo Aird Authored: Tue Jul 12 21:05:14 2016 +0100 Committer: Aled Sage Committed: Tue Jul 19 12:08:54 2016 +0100 -- guide/start/running.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/670e689c/guide/start/running.md -- diff --git a/guide/start/running.md b/guide/start/running.md index b895a84..3db08de 100644 --- a/guide/start/running.md +++ b/guide/start/running.md @@ -7,7 +7,7 @@ menu_parent: index.md This guide will walk you through deploying an example 3-tier web application to a public cloud, and demonstrate the autoscaling capabilities of the Brooklyn platform. -An overview of core [Brooklyn concepts](./concept-quickstart.html){:target="_blank"} is available for reference. +An overview of core [Brooklyn concepts](./concept-quickstart.html) is available for reference. Two methods of deployment are detailed in this tutorial, using virtualisation with Vagrant and an install in your own environment (such as your local machine or in your private/public cloud). @@ -65,7 +65,7 @@ For Centos 7 and RHEL 7 users, the recommended way to install Apache Brooklyn on 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. {% if site.brooklyn-version contains 'SNAPSHOT' %} -This is a snapshot build and no RPM is available, please download [a different version]({{site.path.website}}/download/) or go to [the latest release version](http://brooklyn.apache.org/v/latest/start/running.html) instead. +This is a snapshot build and no RPM is available, please download [a different version]({{site.path.website}}/download/). {% else %} Download the Apache Brooklyn [RPM distribution](https://www.apache.org/dyn/closer.lua/brooklyn/apache-brooklyn-{{site.brooklyn-version}}/apache-brooklyn-{{site.brooklyn-version}}-1.noarch.rpm){:target="_blank"}. {% endif %}
[2/2] brooklyn-docs git commit: This closes #89
This closes #89 Project: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/commit/8567739e Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/tree/8567739e Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/diff/8567739e Branch: refs/heads/master Commit: 8567739e2e87fe4fe1261b8bc63123824732a0f6 Parents: 9bf6f46 3930fc3 Author: Aled Sage Authored: Tue Jul 19 12:20:57 2016 +0100 Committer: Aled Sage Committed: Tue Jul 19 12:20:57 2016 +0100 -- guide/ops/production-installation.md| 1 + guide/ops/troubleshooting/deployment.md | 52 2 files changed, 53 insertions(+) --
[1/2] brooklyn-docs git commit: BROOKLYN-218: document nss upgrade to avoid KeyException
Repository: brooklyn-docs Updated Branches: refs/heads/master 9bf6f4622 -> 8567739e2 BROOKLYN-218: document nss upgrade to avoid KeyException Project: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/commit/3930fc33 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/tree/3930fc33 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/diff/3930fc33 Branch: refs/heads/master Commit: 3930fc3314190c6c57bb0d1def2ba6d2c73c8698 Parents: 218ec13 Author: Aled Sage Authored: Tue Jul 12 19:54:56 2016 +0100 Committer: Aled Sage Committed: Tue Jul 19 12:20:33 2016 +0100 -- guide/ops/production-installation.md| 1 + guide/ops/troubleshooting/deployment.md | 52 2 files changed, 53 insertions(+) -- http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/3930fc33/guide/ops/production-installation.md -- diff --git a/guide/ops/production-installation.md b/guide/ops/production-installation.md index 12f25e8..3748712 100644 --- a/guide/ops/production-installation.md +++ b/guide/ops/production-installation.md @@ -31,6 +31,7 @@ Then configure the server as follows: * create a `~/.brooklyn` directory on the host with `$ mkdir ~/.brooklyn` * check your `iptables` or other firewall service, making sure that incoming connections on port 8443 is not blocked * check that the [linux kernel entropy]({{ site.path.website }}/documentation/increase-entropy.html) is sufficient +* ensure external libraries are up-to-date, including `nss` for SSL. ### Download Apache Brooklyn http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/3930fc33/guide/ops/troubleshooting/deployment.md -- diff --git a/guide/ops/troubleshooting/deployment.md b/guide/ops/troubleshooting/deployment.md index 38b6c5e..9cfc4af 100644 --- a/guide/ops/troubleshooting/deployment.md +++ b/guide/ops/troubleshooting/deployment.md @@ -75,6 +75,58 @@ There are many possible reasons for this ssh failure, which include: A very useful debug configuration is to set `destroyOnFailure` to false. This will allow ssh failures to be more easily investigated. + java.security.KeyException when Provisioning VM + +The exception `java.security.KeyException` can be thrown when jclouds is attempting the SSL handshake, +to make cloud API calls. This can happen if the version of nss is older than 3.16 - the nss package +includes the ssl library. + +To fix this on CentOS, run: + +{% highlight bash %} +sudo yum upgrade nss +{% endhighlight %} + +For a discussion of investigating this kind of issue, see this [Backslasher blog](http://blog.backslasher.net/java-ssl-crash.html). + +The full stacktrace is shown below: + +{% highlight java %} +Caused by: javax.net.ssl.SSLException: java.security.ProviderException: java.security.KeyException + at sun.security.ssl.Alerts.getSSLException(Alerts.java:208) + at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1949) + at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1906) + at sun.security.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1889) + at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1410) + at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387) + at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559) + at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185) + at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1283) + at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1258) + at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250) + at org.jclouds.http.internal.JavaUrlHttpCommandExecutorService.writePayloadToConnection(JavaUrlHttpCommandExecutorService.java:294) + at org.jclouds.http.internal.JavaUrlHttpCommandExecutorService.convert(JavaUrlHttpCommandExecutorService.java:170) + at org.jclouds.http.internal.JavaUrlHttpCommandExecutorService.convert(JavaUrlHttpCommandExecutorService.java:64) + at org.jclouds.http.internal.BaseHttpCommandExecutorService.invoke(BaseHttpCommandExecutorService.java:95) + ... 64 more +Caused by: java.security.ProviderException: java.security.KeyException + at sun.security.ec.ECKeyPairGenerator.generateKeyPair(ECKeyPairGenerator.java:147) + at java.security.KeyPairGenerator$Delegate.generateKeyPair(KeyPairGenerator.java:703) + at sun.security.ssl.ECDHCrypt.(ECDHCrypt.java:77) + at sun.security.ssl.ClientHandshake
[2/4] brooklyn-library git commit: Remove deprecation and unnecessary syncronisation
Remove deprecation and unnecessary syncronisation Project: http://git-wip-us.apache.org/repos/asf/brooklyn-library/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-library/commit/3f965b0d Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-library/tree/3f965b0d Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-library/diff/3f965b0d Branch: refs/heads/master Commit: 3f965b0de8d5a60b4c26d2b4dd1868da4d5bca2a Parents: 112080a Author: Andrew Donald Kennedy Authored: Sat Jun 25 02:25:53 2016 +0100 Committer: Andrew Donald Kennedy Committed: Tue Jul 19 10:32:41 2016 +0100 -- .../brooklyn/entity/nosql/riak/RiakNode.java| 25 +++-- .../entity/nosql/riak/RiakNodeImpl.java | 54 +--- 2 files changed, 30 insertions(+), 49 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/3f965b0d/software/nosql/src/main/java/org/apache/brooklyn/entity/nosql/riak/RiakNode.java -- diff --git a/software/nosql/src/main/java/org/apache/brooklyn/entity/nosql/riak/RiakNode.java b/software/nosql/src/main/java/org/apache/brooklyn/entity/nosql/riak/RiakNode.java index 117c31d..badfe30 100644 --- a/software/nosql/src/main/java/org/apache/brooklyn/entity/nosql/riak/RiakNode.java +++ b/software/nosql/src/main/java/org/apache/brooklyn/entity/nosql/riak/RiakNode.java @@ -21,9 +21,11 @@ package org.apache.brooklyn.entity.nosql.riak; import java.net.URI; import java.util.List; +import com.google.common.collect.ImmutableList; +import com.google.common.reflect.TypeToken; + import org.apache.brooklyn.api.catalog.Catalog; import org.apache.brooklyn.api.entity.ImplementedBy; -import org.apache.brooklyn.api.location.PortRange; import org.apache.brooklyn.api.sensor.AttributeSensor; import org.apache.brooklyn.config.ConfigKey; import org.apache.brooklyn.core.annotation.Effector; @@ -31,7 +33,6 @@ import org.apache.brooklyn.core.annotation.EffectorParam; import org.apache.brooklyn.core.config.ConfigKeys; import org.apache.brooklyn.core.effector.MethodEffector; import org.apache.brooklyn.core.entity.Attributes; -import org.apache.brooklyn.core.location.PortRanges; import org.apache.brooklyn.core.sensor.AttributeSensorAndConfigKey; import org.apache.brooklyn.core.sensor.PortAttributeSensorAndConfigKey; import org.apache.brooklyn.core.sensor.Sensors; @@ -39,9 +40,6 @@ import org.apache.brooklyn.entity.java.UsesJava; import org.apache.brooklyn.entity.software.base.SoftwareProcess; import org.apache.brooklyn.util.core.flags.SetFromFlag; -import com.google.common.collect.ImmutableList; -import com.google.common.reflect.TypeToken; - @Catalog(name="Riak Node", description="Riak is a distributed NoSQL key-value data store that offers " + "extremely high availability, fault tolerance, operational simplicity and scalability.") @ImplementedBy(RiakNodeImpl.class) @@ -133,25 +131,16 @@ public interface RiakNode extends SoftwareProcess, UsesJava { */ @SetFromFlag("handoffListenerPort") -ConfigKey HANDOFF_LISTENER_PORT = ConfigKeys.newIntegerConfigKey("riak.handoff.port.internal", "Handoff Listener Port", 8099); +ConfigKey HANDOFF_LISTENER_PORT = ConfigKeys.newIntegerConfigKey("riak.handoff.port", "Handoff Listener Port", 8099); @SetFromFlag("epmdListenerPort") -ConfigKey EPMD_LISTENER_PORT = ConfigKeys.newIntegerConfigKey("riak.epmd.port.internal", "Erlang Port Mapper Daemon Listener Port", 4369); - -@SetFromFlag("erlangPortRange") -ConfigKey ERLANG_PORT_RANGE = ConfigKeys.newConfigKey(PortRange.class, "riak.erlang.portrange.internal", "Erlang Port Range", new PortRanges.LinearPortRange(6000, 7999)); - -// TODO Change {@link #ERLANG_PORT_RANGE_START} and {@link #ERLANG_PORT_RANGE_END} to sensors +ConfigKey EPMD_LISTENER_PORT = ConfigKeys.newIntegerConfigKey("riak.epmd.port", "Erlang Port Mapper Daemon Listener Port", 4369); -/** @deprecated since 0.10.0; use {@link #ERLANG_PORT_RANGE} instead */ -@Deprecated @SetFromFlag("erlangPortRangeStart") -AttributeSensorAndConfigKey ERLANG_PORT_RANGE_START = ConfigKeys.newIntegerSensorAndConfigKey("riak.erlang.portrange.start.internal", "Erlang Port Range Start"); +AttributeSensorAndConfigKey ERLANG_PORT_RANGE_START = ConfigKeys.newIntegerSensorAndConfigKey("riak.erlang.portrange.start", "Erlang Port Range Start"); -/** @deprecated since 0.10.0; use {@link #ERLANG_PORT_RANGE} instead */ -@Deprecated @SetFromFlag("erlangPortRangeEnd") -AttributeSensorAndConfigKey ERLANG_PORT_RANGE_END = ConfigKeys.newIntegerSensorAndConfigKey("riak.erlang.portrange.end.internal", "Erlang Port Range End"); +AttributeSensorAndConfigKey ERLANG_PORT_RANGE_END = ConfigKeys.newIntegerSensorAndConfigKey("riak.erlang.portrange.e
[1/4] brooklyn-library git commit: Fix backwards compatibility of RiakNode sensors
Repository: brooklyn-library Updated Branches: refs/heads/master 54ad07199 -> 1de87f9e7 Fix backwards compatibility of RiakNode sensors Project: http://git-wip-us.apache.org/repos/asf/brooklyn-library/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-library/commit/87b62f73 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-library/tree/87b62f73 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-library/diff/87b62f73 Branch: refs/heads/master Commit: 87b62f733ecaf2469ab906b295366f498a471fb9 Parents: 3f965b0 Author: Andrew Donald Kennedy Authored: Tue Jul 19 10:32:30 2016 +0100 Committer: Andrew Donald Kennedy Committed: Tue Jul 19 10:32:41 2016 +0100 -- .../java/org/apache/brooklyn/entity/nosql/riak/RiakNode.java | 8 1 file changed, 4 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/87b62f73/software/nosql/src/main/java/org/apache/brooklyn/entity/nosql/riak/RiakNode.java -- diff --git a/software/nosql/src/main/java/org/apache/brooklyn/entity/nosql/riak/RiakNode.java b/software/nosql/src/main/java/org/apache/brooklyn/entity/nosql/riak/RiakNode.java index badfe30..bd3412b 100644 --- a/software/nosql/src/main/java/org/apache/brooklyn/entity/nosql/riak/RiakNode.java +++ b/software/nosql/src/main/java/org/apache/brooklyn/entity/nosql/riak/RiakNode.java @@ -107,10 +107,10 @@ public interface RiakNode extends SoftwareProcess, UsesJava { // NB these two needed for clients to access @SetFromFlag("riakWebPort") -PortAttributeSensorAndConfigKey RIAK_WEB_PORT = ConfigKeys.newPortSensorAndConfigKey("riak.web.port", "Riak Web Port", "8098+"); +PortAttributeSensorAndConfigKey RIAK_WEB_PORT = ConfigKeys.newPortSensorAndConfigKey("riak.webPort", "Riak Web Port", "8098+"); @SetFromFlag("riakPbPort") -PortAttributeSensorAndConfigKey RIAK_PB_PORT = ConfigKeys.newPortSensorAndConfigKey("riak.pb.port", "Riak Protocol Buffers Port", "8087+"); +PortAttributeSensorAndConfigKey RIAK_PB_PORT = ConfigKeys.newPortSensorAndConfigKey("riak.pbPort", "Riak Protocol Buffers Port", "8087+"); @SetFromFlag("useHttpMonitoring") ConfigKey USE_HTTP_MONITORING = ConfigKeys.newConfigKey("httpMonitoring.enabled", "HTTP(S) monitoring enabled", Boolean.TRUE); @@ -131,10 +131,10 @@ public interface RiakNode extends SoftwareProcess, UsesJava { */ @SetFromFlag("handoffListenerPort") -ConfigKey HANDOFF_LISTENER_PORT = ConfigKeys.newIntegerConfigKey("riak.handoff.port", "Handoff Listener Port", 8099); +AttributeSensorAndConfigKey HANDOFF_LISTENER_PORT = ConfigKeys.newIntegerSensorAndConfigKey("riak.handoff.port", "Handoff Listener Port", 8099); @SetFromFlag("epmdListenerPort") -ConfigKey EPMD_LISTENER_PORT = ConfigKeys.newIntegerConfigKey("riak.epmd.port", "Erlang Port Mapper Daemon Listener Port", 4369); +AttributeSensorAndConfigKey EPMD_LISTENER_PORT = ConfigKeys.newIntegerSensorAndConfigKey("riak.epmd.port", "Erlang Port Mapper Daemon Listener Port", 4369); @SetFromFlag("erlangPortRangeStart") AttributeSensorAndConfigKey ERLANG_PORT_RANGE_START = ConfigKeys.newIntegerSensorAndConfigKey("riak.erlang.portrange.start", "Erlang Port Range Start");
[4/4] brooklyn-library git commit: This closes #44
This closes #44 Project: http://git-wip-us.apache.org/repos/asf/brooklyn-library/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-library/commit/1de87f9e Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-library/tree/1de87f9e Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-library/diff/1de87f9e Branch: refs/heads/master Commit: 1de87f9e77fa95b19d4eb6793ffa3d0825f3a65d Parents: 54ad071 87b62f7 Author: Aled Sage Authored: Tue Jul 19 12:56:20 2016 +0100 Committer: Aled Sage Committed: Tue Jul 19 12:56:20 2016 +0100 -- software/nosql/pom.xml | 12 ++- .../brooklyn/entity/nosql/riak/RiakNode.java| 36 +--- .../entity/nosql/riak/RiakNodeImpl.java | 86 +++- 3 files changed, 96 insertions(+), 38 deletions(-) --
[3/4] brooklyn-library git commit: Configure RiakNode internal networking using optional security group customizer
Configure RiakNode internal networking using optional security group customizer Project: http://git-wip-us.apache.org/repos/asf/brooklyn-library/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-library/commit/112080aa Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-library/tree/112080aa Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-library/diff/112080aa Branch: refs/heads/master Commit: 112080aac919776e8e353a1db538a46c2392fbf2 Parents: 54ad071 Author: Andrew Donald Kennedy Authored: Thu Jun 16 08:22:28 2016 +0100 Committer: Andrew Donald Kennedy Committed: Tue Jul 19 10:32:41 2016 +0100 -- software/nosql/pom.xml | 12 ++- .../brooklyn/entity/nosql/riak/RiakNode.java| 41 +++-- .../entity/nosql/riak/RiakNodeImpl.java | 94 +++- 3 files changed, 112 insertions(+), 35 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/112080aa/software/nosql/pom.xml -- diff --git a/software/nosql/pom.xml b/software/nosql/pom.xml index 067629f..bc9dbc2 100644 --- a/software/nosql/pom.xml +++ b/software/nosql/pom.xml @@ -82,6 +82,11 @@ ${project.version} +org.apache.brooklyn +brooklyn-locations-jclouds +${project.version} + + com.google.guava guava @@ -221,13 +226,6 @@ tests test - - -org.apache.brooklyn -brooklyn-locations-jclouds -${project.version} -test -
[1/2] brooklyn-server git commit: Fix for BROOKLYN-314
Repository: brooklyn-server Updated Branches: refs/heads/master 8f9d73ef6 -> aad12a62c Fix for BROOKLYN-314 Try-catch in getOptionalNode/getOptionalImage (e.g. if called by user in rebind code, then donât fail outright if cloud throws exception Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/1f1e7c76 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/1f1e7c76 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/1f1e7c76 Branch: refs/heads/master Commit: 1f1e7c7696c63476880d38a12d6bffbcc8cfb05e Parents: 8f9d73e Author: Aled Sage Authored: Tue Jul 19 16:16:36 2016 +0100 Committer: Aled Sage Committed: Tue Jul 19 16:16:36 2016 +0100 -- .../location/jclouds/JcloudsSshMachineLocation.java | 16 ++-- 1 file changed, 14 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/1f1e7c76/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsSshMachineLocation.java -- diff --git a/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsSshMachineLocation.java b/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsSshMachineLocation.java index 67af0e7..6d3553b 100644 --- a/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsSshMachineLocation.java +++ b/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsSshMachineLocation.java @@ -221,7 +221,13 @@ public class JcloudsSshMachineLocation extends SshMachineLocation implements Jcl @Override public Optional getOptionalNode() { if (_node == null) { - _node = Optional.fromNullable(getParent().getComputeService().getNodeMetadata(nodeId)); + try { + _node = Optional.fromNullable(getParent().getComputeService().getNodeMetadata(nodeId)); + } catch (Exception e) { + Exceptions.propagateIfFatal(e); + if (LOG.isDebugEnabled()) LOG.debug("Problem getting node-metadata for " + this + ", node id " + nodeId + " (continuing)", e); + _node = Optional.absent(); + } } return _node; } @@ -231,7 +237,13 @@ public class JcloudsSshMachineLocation extends SshMachineLocation implements Jcl if (imageId == null) { _image = Optional.absent(); // can happen with JcloudsLocation.resumeMachine() usage } else { - _image = Optional.fromNullable(getParent().getComputeService().getImage(imageId)); + try { + _image = Optional.fromNullable(getParent().getComputeService().getImage(imageId)); + } catch (Exception e) { + Exceptions.propagateIfFatal(e); + if (LOG.isDebugEnabled()) LOG.debug("Problem getting image for " + this + ", image id " + imageId + " (continuing)", e); + _image = Optional.absent(); + } } } return _image;
[2/2] brooklyn-server git commit: This closes #267
This closes #267 Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/aad12a62 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/aad12a62 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/aad12a62 Branch: refs/heads/master Commit: aad12a62c6f1198b42c2a6296890ec63a4e3ba89 Parents: 8f9d73e 1f1e7c7 Author: Aled Sage Authored: Tue Jul 19 20:00:20 2016 +0100 Committer: Aled Sage Committed: Tue Jul 19 20:00:20 2016 +0100 -- .../location/jclouds/JcloudsSshMachineLocation.java | 16 ++-- 1 file changed, 14 insertions(+), 2 deletions(-) --
[2/5] brooklyn-server git commit: BROOKLYN-264: Revert tests for expunging
BROOKLYN-264: Revert tests for expunging Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/8f3c09fc Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/8f3c09fc Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/8f3c09fc Branch: refs/heads/master Commit: 8f3c09fc6733f89fea16a14e89fc9c0461b6708b Parents: e74bc77 Author: Valentin Aitken Authored: Tue Jul 19 09:16:52 2016 +0300 Committer: Aled Sage Committed: Tue Jul 19 10:11:38 2016 +0100 -- .../ExpungingJcloudsLocationLiveTest.java | 186 +++ 1 file changed, 186 insertions(+) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/8f3c09fc/software/base/src/test/java/org/apache/brooklyn/entity/ExpungingJcloudsLocationLiveTest.java -- diff --git a/software/base/src/test/java/org/apache/brooklyn/entity/ExpungingJcloudsLocationLiveTest.java b/software/base/src/test/java/org/apache/brooklyn/entity/ExpungingJcloudsLocationLiveTest.java new file mode 100644 index 000..658a36f --- /dev/null +++ b/software/base/src/test/java/org/apache/brooklyn/entity/ExpungingJcloudsLocationLiveTest.java @@ -0,0 +1,186 @@ +/* + * 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; + +import com.google.common.base.Predicate; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Iterables; +import org.apache.brooklyn.api.entity.EntitySpec; +import org.apache.brooklyn.core.entity.Attributes; +import org.apache.brooklyn.core.entity.Entities; +import org.apache.brooklyn.core.entity.EntityAsserts; +import org.apache.brooklyn.core.entity.lifecycle.Lifecycle; +import org.apache.brooklyn.core.internal.BrooklynProperties; +import org.apache.brooklyn.core.location.LocationConfigKeys; +import org.apache.brooklyn.core.location.cloud.CloudLocationConfig; +import org.apache.brooklyn.core.mgmt.EntityManagementUtils; +import org.apache.brooklyn.core.test.BrooklynAppLiveTestSupport; +import org.apache.brooklyn.core.test.entity.LocalManagementContextForTests; +import org.apache.brooklyn.core.test.entity.TestApplication; +import org.apache.brooklyn.entity.software.base.EmptySoftwareProcess; +import org.apache.brooklyn.entity.software.base.VanillaSoftwareProcess; +import org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks; +import org.apache.brooklyn.location.jclouds.JcloudsLocation; +import org.apache.brooklyn.util.collections.MutableMap; +import org.jclouds.aws.ec2.compute.AWSEC2ComputeService; +import org.jclouds.compute.domain.ComputeMetadata; +import org.jclouds.compute.domain.NodeMetadata; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +import javax.annotation.Nullable; +import java.util.Map; +import java.util.concurrent.Callable; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; +import java.util.regex.Pattern; + +import static org.apache.brooklyn.test.Asserts.*; + +public class ExpungingJcloudsLocationLiveTest extends BrooklynAppLiveTestSupport { +private static final Logger LOG = LoggerFactory.getLogger(ExpungingJcloudsLocationLiveTest.class); + +protected BrooklynProperties brooklynProperties; + +@BeforeMethod(alwaysRun=true) +@Override +public void setUp() throws Exception { +// Don't let any defaults from brooklyn.properties (except credentials) interfere with test +brooklynProperties = BrooklynProperties.Factory.newDefault(); + +// Also removes scriptHeader (e.g. if doing `. ~/.bashrc` and `. ~/.profile`, then that can cause "stdin: is not a tty") +brooklynProperties.remove("brooklyn.ssh.config.scriptHeader"); + +mgmt = new LocalManagementContextForTests(brooklynProperties); +super.setUp(); +} + +
[5/5] brooklyn-server git commit: This closes #266
This closes #266 Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/af1aec58 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/af1aec58 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/af1aec58 Branch: refs/heads/master Commit: af1aec58a1beda2d1028b6fcbbe8c5c46be2f6a0 Parents: aad12a6 f69e116 Author: Aled Sage Authored: Tue Jul 19 20:01:01 2016 +0100 Committer: Aled Sage Committed: Tue Jul 19 20:01:01 2016 +0100 -- .../apache/brooklyn/core/entity/Attributes.java | 12 - .../core/server/BrooklynServerConfig.java | 5 - .../location/jclouds/JcloudsLocation.java | 5 - .../MachineLifecycleEffectorTasks.java | 151 ++--- .../ExpungingJcloudsLocationLiveTest.java | 186 --- ...eProcessStopsDuringStartJcloudsLiveTest.java | 231 ++ .../SoftwareProcessStopsDuringStartTest.java| 318 +++ 7 files changed, 659 insertions(+), 249 deletions(-) --
[3/5] brooklyn-server git commit: BROOKLYN-264: renames + updates live test
BROOKLYN-264: renames + updates live test Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/e889df53 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/e889df53 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/e889df53 Branch: refs/heads/master Commit: e889df538ca3b6acbfbf3c534412edbd336295bb Parents: 8f3c09f Author: Aled Sage Authored: Tue Jul 19 11:57:15 2016 +0100 Committer: Aled Sage Committed: Tue Jul 19 11:57:15 2016 +0100 -- .../MachineLifecycleEffectorTasks.java | 8 +- .../ExpungingJcloudsLocationLiveTest.java | 186 --- ...eProcessStopsDuringStartJcloudsLiveTest.java | 231 +++ .../SoftwareProcessStopsDuringStartTest.java| 47 4 files changed, 282 insertions(+), 190 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/e889df53/software/base/src/main/java/org/apache/brooklyn/entity/software/base/lifecycle/MachineLifecycleEffectorTasks.java -- diff --git a/software/base/src/main/java/org/apache/brooklyn/entity/software/base/lifecycle/MachineLifecycleEffectorTasks.java b/software/base/src/main/java/org/apache/brooklyn/entity/software/base/lifecycle/MachineLifecycleEffectorTasks.java index 2e11120..75f7a06 100644 --- a/software/base/src/main/java/org/apache/brooklyn/entity/software/base/lifecycle/MachineLifecycleEffectorTasks.java +++ b/software/base/src/main/java/org/apache/brooklyn/entity/software/base/lifecycle/MachineLifecycleEffectorTasks.java @@ -145,15 +145,15 @@ public abstract class MachineLifecycleEffectorTasks { @Beta public static final AttributeSensor PROVISIONING_TASK_STATE = new BasicAttributeSensor( TypeToken.of(ProvisioningTaskState.class), -"provisioning.task.state", -"Internal transient sensor for tracking the provisioning of a machine (to better handle aborting)", +"internal.provisioning.task.state", +"Internal transient sensor (do not use) for tracking the provisioning of a machine (to better handle aborting)", AttributeSensor.SensorPersistenceMode.NONE); @Beta public static final AttributeSensor PROVISIONED_MACHINE = new BasicAttributeSensor( TypeToken.of(MachineLocation.class), -"provisioning.task.machine", -"Internal transient sensor for tracking the machine being provisioned (to better handle aborting)", +"internal.provisioning.task.machine", +"Internal transient sensor (do not use) for tracking the machine being provisioned (to better handle aborting)", AttributeSensor.SensorPersistenceMode.NONE); /** http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/e889df53/software/base/src/test/java/org/apache/brooklyn/entity/ExpungingJcloudsLocationLiveTest.java -- diff --git a/software/base/src/test/java/org/apache/brooklyn/entity/ExpungingJcloudsLocationLiveTest.java b/software/base/src/test/java/org/apache/brooklyn/entity/ExpungingJcloudsLocationLiveTest.java deleted file mode 100644 index 658a36f..000 --- a/software/base/src/test/java/org/apache/brooklyn/entity/ExpungingJcloudsLocationLiveTest.java +++ /dev/null @@ -1,186 +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.entity; - -import com.google.common.base.Predicate; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Iterables; -import org.apache.brooklyn.api.entity.EntitySpec; -import org.apache.brooklyn.core.entity.Attributes; -import org.apache.brooklyn.core.entity.Entities; -import org.apache.brooklyn.core.entity.EntityAsserts; -import org.apache.brooklyn.core.entity.lifecycle.Lifecycle; -import org.apache.brooklyn.core.internal.BrooklynProperties; -import org
[1/5] brooklyn-server git commit: BROOKLYN-264: refactor wait-for-provision
Repository: brooklyn-server Updated Branches: refs/heads/master aad12a62c -> af1aec58a BROOKLYN-264: refactor wait-for-provision We now mark the internal state as provisioning entirely in MachineLifecycleEffectorTasks, and that is also where we wait for it on stop(). This also allows us to test it as a unit test, rather than needing a jclouds live test. Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/e74bc778 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/e74bc778 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/e74bc778 Branch: refs/heads/master Commit: e74bc778cca888716b3d3cfeb27e30b394b8179e Parents: 8f9d73e Author: Aled Sage Authored: Mon Jul 18 21:12:59 2016 +0100 Committer: Aled Sage Committed: Mon Jul 18 21:15:00 2016 +0100 -- .../apache/brooklyn/core/entity/Attributes.java | 12 - .../core/server/BrooklynServerConfig.java | 5 - .../location/jclouds/JcloudsLocation.java | 5 - .../MachineLifecycleEffectorTasks.java | 151 --- .../ExpungingJcloudsLocationLiveTest.java | 186 - .../SoftwareProcessStopsDuringStartTest.java| 271 +++ 6 files changed, 381 insertions(+), 249 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/e74bc778/core/src/main/java/org/apache/brooklyn/core/entity/Attributes.java -- diff --git a/core/src/main/java/org/apache/brooklyn/core/entity/Attributes.java b/core/src/main/java/org/apache/brooklyn/core/entity/Attributes.java index 95d1bcd..06fb7ab 100644 --- a/core/src/main/java/org/apache/brooklyn/core/entity/Attributes.java +++ b/core/src/main/java/org/apache/brooklyn/core/entity/Attributes.java @@ -144,18 +144,6 @@ public interface Attributes { AttributeSensor MAIN_URI = MainUri.MAIN_URI; -AttributeSensor JCLOUDS_PROVISIONING_RUNNING = new BasicAttributeSensor(TypeToken.of(JcloudsProvisioningState.class), "jclouds.provisioning.running", -"Internal sensor. Please do NOT change its value across entities.", AttributeSensor.SensorPersistenceMode.NONE); -/** - * Used only by {@link org.apache.brooklyn.entity.software.base.lifecycle.MachineLifecycleEffectorTasks#doStop} - */ -@Beta -enum JcloudsProvisioningState { -STARTED, -DONE, -NONE -} - // this class is added because the MAIN_URI relies on a static initialization which unfortunately can't be added to an interface. class MainUri { private final static AttributeSensor MAIN_URI = Sensors.newSensor(URI.class, "main.uri", "Main URI for contacting the service/endpoint offered by this entity"); http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/e74bc778/core/src/main/java/org/apache/brooklyn/core/server/BrooklynServerConfig.java -- diff --git a/core/src/main/java/org/apache/brooklyn/core/server/BrooklynServerConfig.java b/core/src/main/java/org/apache/brooklyn/core/server/BrooklynServerConfig.java index 33f1873..84cdfdb 100644 --- a/core/src/main/java/org/apache/brooklyn/core/server/BrooklynServerConfig.java +++ b/core/src/main/java/org/apache/brooklyn/core/server/BrooklynServerConfig.java @@ -31,7 +31,6 @@ import org.apache.brooklyn.core.catalog.internal.CatalogInitialization; import org.apache.brooklyn.core.config.ConfigKeys; import org.apache.brooklyn.util.guava.Maybe; import org.apache.brooklyn.util.os.Os; -import org.apache.brooklyn.util.time.Duration; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -122,10 +121,6 @@ public class BrooklynServerConfig { public static final ConfigKey OSGI_CACHE_CLEAN = ConfigKeys.newBooleanConfigKey("brooklyn.osgi.cache.clean", "Whether to delete the OSGi directory before and after use; if unset, it will delete if the node ID forms part of the cache dir path (which by default it does) to avoid file leaks"); -public static final ConfigKey ENTITIES_STOP_WAIT_PROVISIONING_TIMEOUT = ConfigKeys.newDurationConfigKey("entities.stop.wait.provisioning.timeout", -"When stop is called on the Entity, it doesn't have a machine location instance so it doesn't have anything to ask to stop. To be able to stop the machine it has to wait for provisioning to complete. " + -"This ConfigKey sets the timeout for which the stop task will wait provisioning to complete.", Duration.FIVE_MINUTES); - /** @see BrooklynServerPaths#getMgmtBaseDir(ManagementContext) */ public static String getMgmtBaseDir(ManagementContext mgmt) { return BrooklynServerPaths.getMgmtBaseDir(mgmt); http://git-wip-us.apache.org/repos/asf/brooklyn
[4/5] brooklyn-server git commit: BROOKLYN-264: rename config field to “internal_”
BROOKLYN-264: rename config field to âinternal_â Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/f69e116f Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/f69e116f Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/f69e116f Branch: refs/heads/master Commit: f69e116f8b1ff4edbf4b0f7708f984da6bdb7458 Parents: e889df5 Author: Aled Sage Authored: Tue Jul 19 15:58:17 2016 +0100 Committer: Aled Sage Committed: Tue Jul 19 15:58:17 2016 +0100 -- .../MachineLifecycleEffectorTasks.java | 20 ...eProcessStopsDuringStartJcloudsLiveTest.java | 10 .../SoftwareProcessStopsDuringStartTest.java| 24 ++-- 3 files changed, 27 insertions(+), 27 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/f69e116f/software/base/src/main/java/org/apache/brooklyn/entity/software/base/lifecycle/MachineLifecycleEffectorTasks.java -- diff --git a/software/base/src/main/java/org/apache/brooklyn/entity/software/base/lifecycle/MachineLifecycleEffectorTasks.java b/software/base/src/main/java/org/apache/brooklyn/entity/software/base/lifecycle/MachineLifecycleEffectorTasks.java index 75f7a06..fda9ad6 100644 --- a/software/base/src/main/java/org/apache/brooklyn/entity/software/base/lifecycle/MachineLifecycleEffectorTasks.java +++ b/software/base/src/main/java/org/apache/brooklyn/entity/software/base/lifecycle/MachineLifecycleEffectorTasks.java @@ -143,14 +143,14 @@ public abstract class MachineLifecycleEffectorTasks { Duration.minutes(10)); @Beta -public static final AttributeSensor PROVISIONING_TASK_STATE = new BasicAttributeSensor( +public static final AttributeSensor INTERNAL_PROVISIONING_TASK_STATE = new BasicAttributeSensor( TypeToken.of(ProvisioningTaskState.class), "internal.provisioning.task.state", "Internal transient sensor (do not use) for tracking the provisioning of a machine (to better handle aborting)", AttributeSensor.SensorPersistenceMode.NONE); @Beta -public static final AttributeSensor PROVISIONED_MACHINE = new BasicAttributeSensor( +public static final AttributeSensor INTERNAL_PROVISIONED_MACHINE = new BasicAttributeSensor( TypeToken.of(MachineLocation.class), "internal.provisioning.task.machine", "Internal transient sensor (do not use) for tracking the machine being provisioned (to better handle aborting)", @@ -424,14 +424,14 @@ public abstract class MachineLifecycleEffectorTasks { if (expectedState != null && (expectedState.getState() == Lifecycle.STOPPING || expectedState.getState() == Lifecycle.STOPPED)) { throw new IllegalStateException("Provisioning aborted before even begun for "+entity()+" in "+location+" (presumably by a concurrent call to stop"); } -entity().sensors().set(PROVISIONING_TASK_STATE, ProvisioningTaskState.RUNNING); +entity().sensors().set(INTERNAL_PROVISIONING_TASK_STATE, ProvisioningTaskState.RUNNING); MachineLocation machine; try { machine = Tasks.withBlockingDetails("Provisioning machine in " + location, new ObtainLocationTask(location, flags)); -entity().sensors().set(PROVISIONED_MACHINE, machine); +entity().sensors().set(INTERNAL_PROVISIONED_MACHINE, machine); } finally { -entity().sensors().set(PROVISIONING_TASK_STATE, ProvisioningTaskState.DONE); +entity().sensors().set(INTERNAL_PROVISIONING_TASK_STATE, ProvisioningTaskState.DONE); } if (machine == null) { @@ -781,7 +781,7 @@ public abstract class MachineLifecycleEffectorTasks { // There is some attempt to handle it by ProvisionMachineTask checking if the expectedState // is stopping/stopped. Maybe machine = Machines.findUniqueMachineLocation(entity().getLocations()); -ProvisioningTaskState provisioningState = entity().sensors().get(PROVISIONING_TASK_STATE); +ProvisioningTaskState provisioningState = entity().sensors().get(INTERNAL_PROVISIONING_TASK_STATE); if (machine.isAbsent() && provisioningState == ProvisioningTaskState.RUNNING) { Duration maxWait = entity().config().get(STOP_WAIT_PROVISIONING_TIMEOUT); @@ -790,7 +790,7 @@ public abstract class MachineLifecycleEffectorTasks { .until(new Callable() { @Override public Boolean call() throws Exception { -ProvisioningTaskSta
[1/4] brooklyn-server git commit: Add missing tests
Repository: brooklyn-server Updated Branches: refs/heads/master af1aec58a -> 8d8d5766d Add missing 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/d2c36916 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/d2c36916 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/d2c36916 Branch: refs/heads/master Commit: d2c369166fb2ab0a04793fdf1ccc6e7ddc481102 Parents: c4d5055 Author: Svetoslav Neykov Authored: Thu Jul 14 23:40:25 2016 +0300 Committer: Svetoslav Neykov Committed: Thu Jul 14 23:40:25 2016 +0300 -- .../brooklyn/util/osgi/OsgiUtilsTest.java | 49 .../util/text/VersionComparatorTest.java| 2 + 2 files changed, 51 insertions(+) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/d2c36916/utils/common/src/test/java/org/apache/brooklyn/util/osgi/OsgiUtilsTest.java -- diff --git a/utils/common/src/test/java/org/apache/brooklyn/util/osgi/OsgiUtilsTest.java b/utils/common/src/test/java/org/apache/brooklyn/util/osgi/OsgiUtilsTest.java new file mode 100644 index 000..e41b00a --- /dev/null +++ b/utils/common/src/test/java/org/apache/brooklyn/util/osgi/OsgiUtilsTest.java @@ -0,0 +1,49 @@ +/* + * Copyright 2016 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.util.osgi; + +import static org.testng.Assert.assertEquals; + +import org.testng.annotations.Test; + +public class OsgiUtilsTest { + +@Test +public void testToOsgiVersion() { +assertVersion("0.10.0-20160713.1653", "0.10.0.20160713_1653"); + +assertVersion("2.1.0-SNAPSHOT", "2.1.0.SNAPSHOT"); +assertVersion("2.1-SNAPSHOT", "2.1.0.SNAPSHOT"); +assertVersion("0.1-SNAPSHOT", "0.1.0.SNAPSHOT"); +assertVersion("2-SNAPSHOT", "2.0.0.SNAPSHOT"); +assertVersion("2", "2.0.0"); +assertVersion("2.1", "2.1.0"); +assertVersion("2.1.3", "2.1.3"); +assertVersion("2.1.3.4", "2.1.3.4"); +assertVersion("4aug2000r7-dev", "0.0.0.4aug2000r7-dev"); +assertVersion("1.1-alpha-2", "1.1.0.alpha-2"); +assertVersion("1.0-alpha-16-20070122.203121-13", "1.0.0.alpha-16-20070122_203121-13"); +assertVersion("1.0-20070119.021432-1", "1.0.0.20070119_021432-1"); +assertVersion("1-20070119.021432-1", "1.0.0.20070119_021432-1"); +assertVersion("1.4.1-20070217.082013-7", "1.4.1.20070217_082013-7"); +assertVersion("0.0.0.4aug2000r7-dev", "0.0.0.4aug2000r7-dev"); +assertVersion("4aug2000r7-dev", "0.0.0.4aug2000r7-dev"); +} + +private void assertVersion(String ver, String expected) { +assertEquals(OsgiUtils.toOsgiVersion(ver), expected); +} +} http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/d2c36916/utils/common/src/test/java/org/apache/brooklyn/util/text/VersionComparatorTest.java -- diff --git a/utils/common/src/test/java/org/apache/brooklyn/util/text/VersionComparatorTest.java b/utils/common/src/test/java/org/apache/brooklyn/util/text/VersionComparatorTest.java index 5322817..3a4a71c 100644 --- a/utils/common/src/test/java/org/apache/brooklyn/util/text/VersionComparatorTest.java +++ b/utils/common/src/test/java/org/apache/brooklyn/util/text/VersionComparatorTest.java @@ -88,6 +88,8 @@ public class VersionComparatorTest { "1.2-SNAPSHOT", "1.10-SNAPSHOT", "qualifer", "0", "0.1", "1"); + +assertVersionOrder("0.10.0-SNAPSHOT", "0.10.0.SNAPSHOT", "0.10.0-GA", "0.10.0.GA", "0.10.0"); } private static void assertVersionOrder(String v1, String v2, String ...otherVersions) {
[2/4] brooklyn-server git commit: Bump maximum expected persisted state size
Bump maximum expected persisted state size The test is not deterministic, fails on slower machines. Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/2ee93da4 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/2ee93da4 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/2ee93da4 Branch: refs/heads/master Commit: 2ee93da414a363b6564dc60cd3443d16733133ef Parents: d2c3691 Author: Svetoslav Neykov Authored: Fri Jul 15 10:46:45 2016 +0300 Committer: Svetoslav Neykov Committed: Fri Jul 15 10:46:45 2016 +0300 -- .../base/SoftwareProcessPersisterInMemorySizeIntegrationTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/2ee93da4/software/base/src/test/java/org/apache/brooklyn/entity/software/base/SoftwareProcessPersisterInMemorySizeIntegrationTest.java -- diff --git a/software/base/src/test/java/org/apache/brooklyn/entity/software/base/SoftwareProcessPersisterInMemorySizeIntegrationTest.java b/software/base/src/test/java/org/apache/brooklyn/entity/software/base/SoftwareProcessPersisterInMemorySizeIntegrationTest.java index 10e909d..0d53a08 100644 --- a/software/base/src/test/java/org/apache/brooklyn/entity/software/base/SoftwareProcessPersisterInMemorySizeIntegrationTest.java +++ b/software/base/src/test/java/org/apache/brooklyn/entity/software/base/SoftwareProcessPersisterInMemorySizeIntegrationTest.java @@ -35,7 +35,7 @@ public class SoftwareProcessPersisterInMemorySizeIntegrationTest extends Brookly pass1MaxFiles = 80; pass1MaxKb = 200; pass2MaxFiles = 100; -pass2MaxKb = 150; +pass2MaxKb = 160; pass3MaxKb = 50; }
[3/4] brooklyn-server git commit: Fix tests, don't depend on specific white list being available
Fix tests, don't depend on specific white list being available Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/0d841003 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/0d841003 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/0d841003 Branch: refs/heads/master Commit: 0d84100380e7e032eedafc4485ee598bb6e8d049 Parents: 2ee93da Author: Svetoslav Neykov Authored: Mon Jul 18 18:43:10 2016 +0300 Committer: Svetoslav Neykov Committed: Mon Jul 18 18:44:12 2016 +0300 -- .../core/mgmt/persist/XmlMementoSerializerTest.java | 16 ++-- .../brooklyn/util/core/ClassLoaderUtilsTest.java| 2 ++ 2 files changed, 16 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0d841003/core/src/test/java/org/apache/brooklyn/core/mgmt/persist/XmlMementoSerializerTest.java -- diff --git a/core/src/test/java/org/apache/brooklyn/core/mgmt/persist/XmlMementoSerializerTest.java b/core/src/test/java/org/apache/brooklyn/core/mgmt/persist/XmlMementoSerializerTest.java index 069416e..7adb1fc 100644 --- a/core/src/test/java/org/apache/brooklyn/core/mgmt/persist/XmlMementoSerializerTest.java +++ b/core/src/test/java/org/apache/brooklyn/core/mgmt/persist/XmlMementoSerializerTest.java @@ -64,6 +64,7 @@ import org.apache.brooklyn.test.support.TestResourceUnavailableException; import org.apache.brooklyn.util.collections.MutableList; import org.apache.brooklyn.util.collections.MutableMap; import org.apache.brooklyn.util.collections.MutableSet; +import org.apache.brooklyn.util.core.ClassLoaderUtils; import org.apache.brooklyn.util.core.osgi.Osgis; import org.apache.brooklyn.util.javalang.Reflections; import org.apache.brooklyn.util.net.Networking; @@ -420,8 +421,19 @@ public class XmlMementoSerializerTest { "<"+bundle.getSymbolicName()+":"+classname+">", " myval", ""); -String serializedForm = serializer.toString(obj); -assertEquals(serializedForm.trim(), expectedForm.trim()); +String WHITE_LIST_KEY = "org.apache.brooklyn.classloader.fallback.bundles"; +String origWhiteList = System.getProperty(WHITE_LIST_KEY); +System.setProperty(WHITE_LIST_KEY, "some.none.existend.whitelist:1.0.0"); +try { +String serializedForm = serializer.toString(obj); +assertEquals(serializedForm.trim(), expectedForm.trim()); +} finally { +if (origWhiteList != null) { +System.setProperty(WHITE_LIST_KEY, origWhiteList); +} else { +System.clearProperty(WHITE_LIST_KEY); +} +} } // TODO This doesn't get the bundleName - should we expect it to? Is this because of http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/0d841003/core/src/test/java/org/apache/brooklyn/util/core/ClassLoaderUtilsTest.java -- diff --git a/core/src/test/java/org/apache/brooklyn/util/core/ClassLoaderUtilsTest.java b/core/src/test/java/org/apache/brooklyn/util/core/ClassLoaderUtilsTest.java index 7ede563..165a61e 100644 --- a/core/src/test/java/org/apache/brooklyn/util/core/ClassLoaderUtilsTest.java +++ b/core/src/test/java/org/apache/brooklyn/util/core/ClassLoaderUtilsTest.java @@ -109,6 +109,8 @@ public class ClassLoaderUtilsTest { Class clazz = (Class) bundle.loadClass(classname); Entity entity = createSimpleEntity(bundleUrl, clazz); +System.setProperty(ClassLoaderUtils.WHITE_LIST_KEY, "do.not.match.whitelist:1.0.0"); + ClassLoaderUtils cluMgmt = new ClassLoaderUtils(getClass(), mgmt); ClassLoaderUtils cluClass = new ClassLoaderUtils(clazz); ClassLoaderUtils cluEntity = new ClassLoaderUtils(getClass(), entity);
[4/4] brooklyn-server git commit: This closes #262
This closes #262 Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/8d8d5766 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/8d8d5766 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/8d8d5766 Branch: refs/heads/master Commit: 8d8d5766d0a42155512d1abc8d16c7e08597dba0 Parents: af1aec5 0d84100 Author: Aled Sage Authored: Tue Jul 19 20:03:11 2016 +0100 Committer: Aled Sage Committed: Tue Jul 19 20:03:11 2016 +0100 -- .../mgmt/persist/XmlMementoSerializerTest.java | 16 ++- .../util/core/ClassLoaderUtilsTest.java | 2 + ...essPersisterInMemorySizeIntegrationTest.java | 2 +- .../brooklyn/util/osgi/OsgiUtilsTest.java | 49 .../util/text/VersionComparatorTest.java| 2 + 5 files changed, 68 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/8d8d5766/core/src/test/java/org/apache/brooklyn/util/core/ClassLoaderUtilsTest.java --
[3/5] brooklyn-server git commit: Adds EffectorUtilsTest
Adds EffectorUtilsTest Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/915ffa7f Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/915ffa7f Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/915ffa7f Branch: refs/heads/master Commit: 915ffa7fe957d80720f6f3392a7ecc49b7b68027 Parents: 13ce4cb Author: Aled Sage Authored: Tue Jun 28 21:15:04 2016 +0100 Committer: Aled Sage Committed: Tue Jun 28 21:15:04 2016 +0100 -- .../core/mgmt/internal/EffectorUtilsTest.java | 119 +++ 1 file changed, 119 insertions(+) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/915ffa7f/core/src/test/java/org/apache/brooklyn/core/mgmt/internal/EffectorUtilsTest.java -- diff --git a/core/src/test/java/org/apache/brooklyn/core/mgmt/internal/EffectorUtilsTest.java b/core/src/test/java/org/apache/brooklyn/core/mgmt/internal/EffectorUtilsTest.java new file mode 100644 index 000..449e9ed --- /dev/null +++ b/core/src/test/java/org/apache/brooklyn/core/mgmt/internal/EffectorUtilsTest.java @@ -0,0 +1,119 @@ +/* + * 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.mgmt.internal; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertFalse; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import org.apache.brooklyn.api.effector.Effector; +import org.apache.brooklyn.core.effector.EffectorBody; +import org.apache.brooklyn.core.effector.Effectors; +import org.apache.brooklyn.util.collections.MutableMap; +import org.apache.brooklyn.util.core.config.ConfigBag; +import org.apache.brooklyn.util.guava.Maybe; +import org.testng.annotations.Test; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; + +public class EffectorUtilsTest { + +private Effector effector = Effectors.effector(Void.class, "myEffector") +.parameter(byte.class, "byteParam") +.parameter(char.class, "charParam") +.parameter(short.class, "shortParam") +.parameter(int.class, "intParam") +.parameter(long.class, "longParam") +.parameter(float.class, "floatParam") +.parameter(double.class, "doubleParam") +.parameter(boolean.class, "boolParam") +.parameter(String.class, "stringParam") +.impl(new EffectorBody() { +@Override public Void call(ConfigBag parameters) { +return null; +}}) +.build(); + +private Map argsMap = ImmutableMap.builder() +.put("byteParam", (byte)1) +.put("charParam", (char)'2') +.put("shortParam", (short)3) +.put("intParam", (int)4) +.put("longParam", (long)5) +.put("floatParam", (float)6.0) +.put("doubleParam", (double)7.0) +.put("boolParam", true) +.put("stringParam", "mystring") +.build(); + +private Map argsMapRequiringCoercion = ImmutableMap.builder() +.put("byteParam", "1") +.put("charParam", "2") +.put("shortParam", "3") +.put("intParam", "4") +.put("longParam", "5") +.put("floatParam", "6.0") +.put("doubleParam", "7.0") +.put("boolParam", "true") +.put("stringParam", "mystring") +.build(); + +private Object[] argsArray = new Object[] {(byte)1, (char)'2', (short)3, (int)4, (long)5, (float)6.0, (double)7.0, true, "mystring"}; + +private Object[] expectedArgs = argsArray; + +@Test +public void testPrepareArgsFromMap() throws Exception { +assertEquals(EffectorUtils.prepareArgsForEffector(effector, argsMap), expectedArgs); +assertEquals(EffectorUtils.prepareArgsForEffector(effector, argsMapRequiringCoercion), expectedArgs); +} +
[5/5] brooklyn-server git commit: This closes #223
This closes #223 Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/284f110a Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/284f110a Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/284f110a Branch: refs/heads/master Commit: 284f110a8571a8c96ef73687d2c6baa287ea91ea Parents: 8d8d576 d24e0de Author: Aled Sage Authored: Tue Jul 19 20:04:22 2016 +0100 Committer: Aled Sage Committed: Tue Jul 19 20:04:22 2016 +0100 -- .../core/mgmt/internal/EffectorUtilsTest.java | 119 +++ .../core/internal/ssh/RecordingSshTool.java | 136 ++-- software/base/pom.xml | 7 + .../base/AbstractSoftwareProcessDriver.java | 8 +- .../base/VanillaSoftwareProcessTest.java| 322 +++ .../base/VanillaWindowsProcessTest.java | 161 ++ .../core/internal/winrm/RecordingWinRmTool.java | 107 ++ 7 files changed, 828 insertions(+), 32 deletions(-) --
[4/5] brooklyn-server git commit: Adds VanillaWindowsProcessTest (non-live)
Adds VanillaWindowsProcessTest (non-live) Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/d24e0de1 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/d24e0de1 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/d24e0de1 Branch: refs/heads/master Commit: d24e0de157b0d666e3ad570a1ed7b1c5b13fba7c Parents: 915ffa7 Author: Aled Sage Authored: Tue Jun 28 21:40:51 2016 +0100 Committer: Aled Sage Committed: Tue Jun 28 22:05:37 2016 +0100 -- software/base/pom.xml | 7 + .../base/VanillaWindowsProcessTest.java | 161 +++ .../core/internal/winrm/RecordingWinRmTool.java | 107 3 files changed, 275 insertions(+) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/d24e0de1/software/base/pom.xml -- diff --git a/software/base/pom.xml b/software/base/pom.xml index 04306fc..7e0d4fd 100644 --- a/software/base/pom.xml +++ b/software/base/pom.xml @@ -138,6 +138,13 @@ org.apache.brooklyn +brooklyn-software-winrm +${project.version} +tests +test + + +org.apache.brooklyn brooklyn-locations-jclouds ${project.version} tests http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/d24e0de1/software/base/src/test/java/org/apache/brooklyn/entity/software/base/VanillaWindowsProcessTest.java -- diff --git a/software/base/src/test/java/org/apache/brooklyn/entity/software/base/VanillaWindowsProcessTest.java b/software/base/src/test/java/org/apache/brooklyn/entity/software/base/VanillaWindowsProcessTest.java new file mode 100644 index 000..4523e11 --- /dev/null +++ b/software/base/src/test/java/org/apache/brooklyn/entity/software/base/VanillaWindowsProcessTest.java @@ -0,0 +1,161 @@ +/* + * 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 static org.testng.Assert.assertTrue; +import static org.testng.Assert.fail; + +import java.util.List; + +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.MachineLocation; +import org.apache.brooklyn.core.entity.BrooklynConfigKeys; +import org.apache.brooklyn.core.test.BrooklynAppUnitTestSupport; +import org.apache.brooklyn.location.byon.FixedListMachineProvisioningLocation; +import org.apache.brooklyn.location.winrm.WinRmMachineLocation; +import org.apache.brooklyn.util.core.internal.winrm.RecordingWinRmTool; +import org.apache.brooklyn.util.core.internal.winrm.RecordingWinRmTool.ExecParams; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +import com.google.common.collect.ImmutableList; + +public class VanillaWindowsProcessTest extends BrooklynAppUnitTestSupport { + +@SuppressWarnings("unused") +private static final Logger LOG = LoggerFactory.getLogger(VanillaWindowsProcessTest.class); + +private Location loc; + +@BeforeMethod(alwaysRun=true) +@Override +public void setUp() throws Exception { +super.setUp(); +loc = app.getManagementContext().getLocationManager().createLocation(LocationSpec.create(FixedListMachineProvisioningLocation.class) +.configure(FixedListMachineProvisioningLocation.MACHINE_SPECS, ImmutableList.>of( +LocationSpec.create(WinRmMachineLocation.class) +.configure("address", "1.2.3.4") + .configure(WinRmMachineLocation.WINRM_TOOL_CLASS, RecordingWinRmTool.class.getName(); + +RecordingWinRmTool.clear(); +} + +@Override +public vo
[1/5] brooklyn-server git commit: Don’t call postInstallCommand if skipInstall=true
Repository: brooklyn-server Updated Branches: refs/heads/master 8d8d5766d -> 284f110a8 Donât call postInstallCommand if skipInstall=true Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/bc7e0afe Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/bc7e0afe Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/bc7e0afe Branch: refs/heads/master Commit: bc7e0afe7495036019f9d1897e3961f0da4d6153 Parents: a941963 Author: Aled Sage Authored: Tue Jun 28 21:11:44 2016 +0100 Committer: Aled Sage Committed: Tue Jun 28 21:11:44 2016 +0100 -- .../entity/software/base/AbstractSoftwareProcessDriver.java | 8 1 file changed, 4 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/bc7e0afe/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 f6449b0..aaa7cde 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 @@ -158,11 +158,11 @@ public abstract class AbstractSoftwareProcessDriver implements SoftwareProcessDr waitForConfigKey(BrooklynConfigKeys.INSTALL_LATCH); install(); }}); -} -DynamicTasks.queue("post-install-command", new Runnable() { public void run() { -runPostInstallCommand(); -}}); +DynamicTasks.queue("post-install-command", new Runnable() { public void run() { +runPostInstallCommand(); +}}); +} }}); DynamicTasks.queue("customize", new Runnable() { public void run() {
[2/5] brooklyn-server git commit: Adds VanillaSoftwareProcessTest (as non-integration)
Adds VanillaSoftwareProcessTest (as non-integration) Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/13ce4cb8 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/13ce4cb8 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/13ce4cb8 Branch: refs/heads/master Commit: 13ce4cb8c5767a7a99aa77a09e1f91a9ebdee7a7 Parents: bc7e0af Author: Aled Sage Authored: Tue Jun 28 21:14:37 2016 +0100 Committer: Aled Sage Committed: Tue Jun 28 21:14:37 2016 +0100 -- .../core/internal/ssh/RecordingSshTool.java | 136 ++-- .../base/VanillaSoftwareProcessTest.java| 322 +++ 2 files changed, 430 insertions(+), 28 deletions(-) -- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/13ce4cb8/core/src/test/java/org/apache/brooklyn/util/core/internal/ssh/RecordingSshTool.java -- diff --git a/core/src/test/java/org/apache/brooklyn/util/core/internal/ssh/RecordingSshTool.java b/core/src/test/java/org/apache/brooklyn/util/core/internal/ssh/RecordingSshTool.java index f7faaca..2ac8acf 100644 --- a/core/src/test/java/org/apache/brooklyn/util/core/internal/ssh/RecordingSshTool.java +++ b/core/src/test/java/org/apache/brooklyn/util/core/internal/ssh/RecordingSshTool.java @@ -28,16 +28,53 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; +import javax.annotation.Nullable; + import org.apache.brooklyn.util.exceptions.Exceptions; import org.apache.brooklyn.util.text.Strings; +import com.google.common.base.Objects; +import com.google.common.base.Predicate; +import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import com.google.common.collect.Maps; -/** Mock tool */ +/** + * For stubbing out the {@link SshTool}, so that no real ssh/scp commands are executed. + * Records all the commands that are executed, so that assertions can subsequently be made. + * + * By default, all commands return exit code 0, and no stdout/stderr. + * + * This can be customised for particular commands using {@link #setCustomResponse(String, CustomResponseGenerator)} + * to specify the exit code, stdout and stderr of a matching command. + */ public class RecordingSshTool implements SshTool { +public static class ExecParams { +public final Map props; +public final List commands; +public final Map env; + +public ExecParams(Map props, List commands, Map env) { +this.props = props; +this.commands = commands; +this.env = env; +} + +@Override +public String toString() { +return Objects.toStringHelper(this) +.add("props", props) +.add("commands", commands) +.add("env", env).toString(); +} +} + +public interface CustomResponseGenerator { +public CustomResponse generate(ExecParams execParams); +} + public static class CustomResponse { public final int exitCode; public final String stdout; @@ -53,6 +90,14 @@ public class RecordingSshTool implements SshTool { public String toString() { return "CustomResponse["+exitCode+"; "+stdout+"; "+stderr+"]"; } + +public CustomResponseGenerator toGenerator() { +return new CustomResponseGenerator() { +@Override public CustomResponse generate(ExecParams execParams) { +return CustomResponse.this; +} +}; +} } public static class ExecCmd { @@ -74,9 +119,38 @@ public class RecordingSshTool implements SshTool { } } +public static class ExecCmdPredicates { +public static Predicate containsEnv(final Map expected) { +return new Predicate() { +@Override public boolean apply(@Nullable ExecCmd input) { +if (input == null) return false; +if (input.env == null) return false; +for (Map.Entry entry : expected.entrySet()) { +Object key = entry.getKey(); +if (!(input.env.containsKey(key) && Objects.equal(entry.getValue(), input.env.get(key { +return false; +} +} +return true; +}}; +} +public static Predicate containsCmd(final String expected) { +return new Predicate() { +@Override public boolean apply(@Nullable ExecCmd input) { +if (input == null) re