You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by sj...@apache.org on 2015/12/11 13:39:51 UTC
[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. Added
InfrastructureDeploymentTestCase
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-Miller <gr...@cloudsoftcorp.com>
Authored: Fri Dec 4 19:32:28 2015 +0000
Committer: Graeme-Miller <gr...@cloudsoftcorp.com>
Committed: Mon Dec 7 13:41:39 2015 +0000
----------------------------------------------------------------------
.../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 0000000..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<EntitySpec<SoftwareProcess>> ENTITY_SPEC_TO_DEPLOY = ConfigKeys.newConfigKey(new TypeToken<EntitySpec<SoftwareProcess>>(){}, "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<EntitySpec<StartableApplication>> INFRASTRUCTURE_SPEC = ConfigKeys.newConfigKey(new TypeToken<EntitySpec<StartableApplication>>(){}, "infrastructure.deployment.spec", "Infrastructure to deploy");
+
+
+ /**
+ * The The location to deploy ENTITY_SPEC_TO_DEPLOY.
+ */
+ ConfigKey<String> 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 b/usage/test-framework/src/main/java/org/apache/brooklyn/test/framework/InfrastructureDeploymentTestCaseImpl.java
new file mode 100644
index 0000000..900c0a0
--- /dev/null
+++ b/usage/test-framework/src/main/java/org/apache/brooklyn/test/framework/InfrastructureDeploymentTestCaseImpl.java
@@ -0,0 +1,57 @@
+/*
+ * 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.collect.ImmutableList;
+import org.apache.brooklyn.api.entity.EntitySpec;
+import org.apache.brooklyn.api.location.Location;
+import org.apache.brooklyn.core.annotation.EffectorParam;
+import org.apache.brooklyn.core.entity.StartableApplication;
+import org.apache.brooklyn.core.sensor.Sensors;
+import org.apache.brooklyn.entity.software.base.SoftwareProcess;
+
+import java.util.Collection;
+
+/**
+ * Created by graememiller on 04/12/2015.
+ */
+public class InfrastructureDeploymentTestCaseImpl extends TestCaseImpl implements InfrastructureDeploymentTestCase {
+
+ @Override
+ public void start(@EffectorParam(name = "locations") Collection<? extends Location> locations) {
+ //Create the infrastructure
+ EntitySpec<StartableApplication> infrastructureSpec = config().get(INFRASTRUCTURE_SPEC);
+ StartableApplication infrastructure = this.addChild(infrastructureSpec);
+ infrastructure.start(locations);
+
+ //Get the location
+ String deploymentLocationSensorName = config().get(DEPLOYMENT_LOCATION_SENSOR_NAME);
+ Location locationToDeployTo = infrastructure.sensors().get(Sensors.newSensor(Location.class, deploymentLocationSensorName));
+
+
+ //Start the child entity
+ EntitySpec<SoftwareProcess> entityToDeploySpec = config().get(ENTITY_SPEC_TO_DEPLOY);
+ SoftwareProcess entityToDeploy = this.addChild(entityToDeploySpec);
+ entityToDeploy.start(ImmutableList.of(locationToDeployTo));
+
+
+ //Defer to super class to start children
+ super.start(locations);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/2b40644d/usage/test-framework/src/main/java/org/apache/brooklyn/test/framework/TestCase.java
----------------------------------------------------------------------
diff --git a/usage/test-framework/src/main/java/org/apache/brooklyn/test/framework/TestCase.java b/usage/test-framework/src/main/java/org/apache/brooklyn/test/framework/TestCase.java
index 78fd8d6..34a2e34 100644
--- a/usage/test-framework/src/main/java/org/apache/brooklyn/test/framework/TestCase.java
+++ b/usage/test-framework/src/main/java/org/apache/brooklyn/test/framework/TestCase.java
@@ -18,7 +18,9 @@
*/
package org.apache.brooklyn.test.framework;
+import org.apache.brooklyn.api.entity.Entity;
import org.apache.brooklyn.api.entity.ImplementedBy;
+import org.apache.brooklyn.core.entity.trait.Startable;
/**
* Entity that logically groups other test entities
@@ -26,5 +28,5 @@ import org.apache.brooklyn.api.entity.ImplementedBy;
* @author m4rkmckenna
*/
@ImplementedBy(value = TestCaseImpl.class)
-public interface TestCase extends BaseTest {
+public interface TestCase extends Entity, Startable {
}
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/2b40644d/usage/test-framework/src/main/java/org/apache/brooklyn/test/framework/TestCaseImpl.java
----------------------------------------------------------------------
diff --git a/usage/test-framework/src/main/java/org/apache/brooklyn/test/framework/TestCaseImpl.java b/usage/test-framework/src/main/java/org/apache/brooklyn/test/framework/TestCaseImpl.java
index 71efca3..1508778 100644
--- a/usage/test-framework/src/main/java/org/apache/brooklyn/test/framework/TestCaseImpl.java
+++ b/usage/test-framework/src/main/java/org/apache/brooklyn/test/framework/TestCaseImpl.java
@@ -21,17 +21,23 @@ package org.apache.brooklyn.test.framework;
import com.google.common.collect.Lists;
import org.apache.brooklyn.api.entity.Entity;
import org.apache.brooklyn.api.location.Location;
+import org.apache.brooklyn.core.entity.AbstractEntity;
+import org.apache.brooklyn.core.entity.Attributes;
import org.apache.brooklyn.core.entity.lifecycle.Lifecycle;
import org.apache.brooklyn.core.entity.lifecycle.ServiceStateLogic;
import org.apache.brooklyn.core.entity.trait.Startable;
import org.apache.brooklyn.util.exceptions.Exceptions;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.util.Collection;
/**
* {@inheritDoc}
*/
-public class TestCaseImpl extends AbstractTest implements TestCase {
+public class TestCaseImpl extends AbstractEntity implements TestCase {
+
+ private static final Logger LOG = LoggerFactory.getLogger(TestCaseImpl.class);
/**
* {@inheritDoc}
@@ -40,12 +46,15 @@ public class TestCaseImpl extends AbstractTest implements TestCase {
ServiceStateLogic.setExpectedState(this, Lifecycle.STARTING);
try {
for (final Entity childEntity : getChildren()) {
- if (childEntity instanceof Startable) ((Startable) childEntity).start(locations);
+ Boolean serviceUp = childEntity.sensors().get(SERVICE_UP);
+ if (childEntity instanceof Startable && !Boolean.TRUE.equals(serviceUp)){
+ ((Startable) childEntity).start(locations);
+ }
}
- sensors().set(SERVICE_UP, true);
+ sensors().set(Attributes.SERVICE_UP, true);
ServiceStateLogic.setExpectedState(this, Lifecycle.RUNNING);
} catch (Throwable t) {
- sensors().set(SERVICE_UP, false);
+ sensors().set(Attributes.SERVICE_UP, false);
ServiceStateLogic.setExpectedState(this, Lifecycle.ON_FIRE);
throw Exceptions.propagate(t);
}
@@ -56,7 +65,7 @@ public class TestCaseImpl extends AbstractTest implements TestCase {
*/
public void stop() {
ServiceStateLogic.setExpectedState(this, Lifecycle.STOPPING);
- sensors().set(SERVICE_UP, false);
+ sensors().set(Attributes.SERVICE_UP, false);
try {
for (Entity child : getChildren()) {
if (child instanceof Startable) ((Startable) child).stop();
[04/15] incubator-brooklyn git commit: Add documentation for
assertions and SimpleShellCommandTest.
Posted by sj...@apache.org.
Add documentation for assertions and SimpleShellCommandTest.
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/14e63fc2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/14e63fc2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/14e63fc2
Branch: refs/heads/master
Commit: 14e63fc2d6153bcf50b8f8a8921435d427171a07
Parents: b39ef3a
Author: Geoff Macartney <ge...@cloudsoftcorp.com>
Authored: Wed Dec 9 10:24:04 2015 +0000
Committer: Geoff Macartney <ge...@cloudsoftcorp.com>
Committed: Wed Dec 9 10:25:44 2015 +0000
----------------------------------------------------------------------
.../entities/simpleshellcommandtest-entity.yaml | 27 +++++++
docs/guide/yaml/test/index.md | 1 +
docs/guide/yaml/test/test-entities.md | 77 +++++++++++++++++---
3 files changed, 93 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/14e63fc2/docs/guide/yaml/test/example_yaml/entities/simpleshellcommandtest-entity.yaml
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/example_yaml/entities/simpleshellcommandtest-entity.yaml b/docs/guide/yaml/test/example_yaml/entities/simpleshellcommandtest-entity.yaml
new file mode 100644
index 0000000..c8217eb
--- /dev/null
+++ b/docs/guide/yaml/test/example_yaml/entities/simpleshellcommandtest-entity.yaml
@@ -0,0 +1,27 @@
+name: simpleShellCommandTest
+location: mybyonhost
+services:
+- type: org.apache.brooklyn.test.framework.TestCase
+ name: testcase1
+ targetId: testprocess
+ brooklyn.children:
+ - type: org.apache.brooklyn.entity.software.base.EmptySoftwareProcess
+ id: testprocess
+
+ - type: org.apache.brooklyn.test.framework.SimpleShellCommandTest
+ defaultCommand: hostname
+ assertStatus:
+ equals: 0
+ assertOut:
+ equals: mybyonhost
+ assertErr:
+ isEmpty: true
+
+ - type: org.apache.brooklyn.test.framework.SimpleShellCommandTest
+ downloadUrl: http://localhost:8080/script1.sh
+ assertStatus:
+ equals: 0
+ assertOut:
+ equals: hello world
+ assertErr:
+ isEmpty: true
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/14e63fc2/docs/guide/yaml/test/index.md
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/index.md b/docs/guide/yaml/test/index.md
index 4666b8b..ae7f818 100644
--- a/docs/guide/yaml/test/index.md
+++ b/docs/guide/yaml/test/index.md
@@ -18,6 +18,7 @@ Validation test entities include:
- `TestSensor` - perform assertion on a specified sensor.
- `TestEffector` - invoke effector on specified target entity.
- `TestHttpCall` - perform assertion on response to specified HTTP GET Request.
+- `SimpleShellCommandTest` - test assertions on the result of a shell command on the same node as the target entity.
The following sections provide details on each test entity along with examples of their use.
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/14e63fc2/docs/guide/yaml/test/test-entities.md
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/test-entities.md b/docs/guide/yaml/test/test-entities.md
index 73eb398..ddbf60b 100644
--- a/docs/guide/yaml/test/test-entities.md
+++ b/docs/guide/yaml/test/test-entities.md
@@ -6,6 +6,16 @@ layout: website-normal
{% include fields.md %}
+- [Structural Test Entities](#structural-test-entities)
+ - [TestCase](#testcase)
+ - [ParallelTestCase](#paralleltestcase)
+- [Validation Test Entities](#validation-test-entities)
+ - [TestSensor](#testsensor)
+ - [TestEffector](#testeffector)
+ - [TestHttpCall](#testhttpcall)
+ - [SimpleShellCommandTest](#simpleshellcommandtest)
+- [Assertions](#assertions)
+
## Structural Test Entities
### TestCase
@@ -46,12 +56,7 @@ The `TestSensor` entity performs an assertion on a specified sensors value.
- `targetId` - alternative to the `target` parameter which wraps the DSL component lookup requiring only the `id` be supplied. For example, `tomcat`.
- `sensor` - sensor to evaluate. For example `service.isUp`.
- `timeout` - duration to wait on assertion to return a result. For example `10s`, `10m`, etc
-- `assert` - assertion to perform on the specified sensor value, options include:
- - `equals`,`equalTo`,`isEqualTo` - tests that the sensor value equals the supplied value. For example `true`.
- - `contains` - tests that the sensor value contains the supplied value
- - `matches` - tests that the sensor value matches the supplied [regex pattern](http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html?is-external=true), for example `".*hello.*"`.
- - `isNull` - tests that the sensor value is `null`.
- - `notNull` - tests that the sensor value is NOT `null`.
+- `assert` - assertion to perform on the specified sensor value.
### TestEffector
The `TestEffector` entity invokes the specified effector on a target entity.
@@ -76,10 +81,58 @@ The `TestHttpCall` entity performs a HTTP GET on the specified URL and performs
- `url` - URL to perform GET request on, this can use DSL for example `$brooklyn:component("tomcat").attributeWhenReady("webapp.url")`.
- `timeout` - duration to wait on a HTTP response. For example `10s`, `10m`, etc
- `applyAssertionTo` - The filed to apply the assertion to. For example `status`, `body`
-- `assert` - assertion to perform on the response, options include:
- - `equals`,`equalTo`,`isEqualTo` - tests that the value equals the supplied value. For example `true`.
- - `contains` - tests that the value contains the supplied value
- - `matches` - tests that the value matches the supplied [regex pattern](http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html?is-external=true), for example `".*hello.*"`.
- - `isNull` - tests that the value is `null`.
- - `notNull` - tests that the value is NOT `null`.
+- `assert` - assertion to perform on the response.
+
+### SimpleShellCommandTest
+
+The purpose of a SimpleShellCommandTest is to run a command, on the host of the target entity,
+that is expected to "do something", finishing quickly, and return a result (process exit code), along with its
+standard out and error streams, which can then be tested using assertions.
+If no assertions are explicitly configured, the default is to assert a non-zero exit code.
+
+Either a shell command may be provided in the YAML, or a URL for a script which will be executed.
+{% highlight yaml %}
+{% readj example_yaml/entities/simpleshellcommandtest-entity.yaml %}
+{% endhighlight %}
+
+#### Parameters
+- `command` - The shell command to execute. (This and `downloadUrl` are mutually exclusive.)
+- `downloadUrl` - URL for a script to download and execute. (This and `command` are mutually exclusive.)
+- `scriptDir` - if `downloadUrl` is used. The directory on the target host where downloaded scripts should be copied to.
+- `runDir` - the working directory where the command or script will be executed on the target host.
+- `assertStatus` - Assertions on the exit code of the command or script.
+- `assertOut` - Assertions on the standard output of the command as a String.
+- `assertErr` - Assertions on the standard error of the command as a String.
+
+## Assertions
+
+The following conditions are provided by those test entities above that include assertions
+
+- `isNull` - asserts that the actual value is `null`.
+- `notNull` - asserts that the actual value is NOT `null`.
+- `isEqualTo` - asserts that the actual value equals an expected value.
+- `equalTo` - a synonym for `isEqualTo`
+- `equals` - a synonym for `isEqualTo`
+- `matches` - asserts that the actual value matches a [regex pattern](http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html?is-external=true), for example `".*hello.*"`.
+- `contains` - asserts that the actual value contains the supplied value
+- `isEmpty` - asserts that the actual value is an empty string
+- `notEmpty` - asserts that the actual value is a non empty string
+- `hasTruthValue` - asserts that the actual value has the expected interpretation as a boolean
+
+Assertions may be provided as a simple map:
+
+```yaml
+ assert:
+ contains: 2 users
+ matches: .*[\d]* days.*
+```
+
+If there is the need to make multiple assertions with the same key, the assertions can be specified
+as a list of such maps:
+
+```yaml
+ assert:
+ - contains: 2 users
+ - contains: 2 days
+```
[09/15] incubator-brooklyn git commit: Generate Swagger API
Specification using a maven plugin
Posted by sj...@apache.org.
Generate Swagger API Specification using a maven plugin
- combined with https://github.com/swagger-api/swagger-codegen, it can generate rest bindings for multiple languages
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/812c5bdb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/812c5bdb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/812c5bdb
Branch: refs/heads/master
Commit: 812c5bdbc4d1aeb51d563e74187123932d3a594a
Parents: d58d503
Author: Andrea Turli <an...@gmail.com>
Authored: Thu Dec 10 15:53:32 2015 +0100
Committer: Andrea Turli <an...@gmail.com>
Committed: Fri Dec 11 12:38:53 2015 +0100
----------------------------------------------------------------------
usage/rest-api/pom.xml | 46 +++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 44 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/812c5bdb/usage/rest-api/pom.xml
----------------------------------------------------------------------
diff --git a/usage/rest-api/pom.xml b/usage/rest-api/pom.xml
index bc54587..81306e5 100644
--- a/usage/rest-api/pom.xml
+++ b/usage/rest-api/pom.xml
@@ -7,9 +7,9 @@
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
@@ -98,4 +98,46 @@
</dependency>
</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.github.kongchen</groupId>
+ <artifactId>swagger-maven-plugin</artifactId>
+ <version>3.1.0</version>
+ <configuration>
+ <apiSources>
+ <apiSource>
+ <springmvc>false</springmvc>
+ <locations>org.apache.brooklyn.rest.api</locations>
+ <schemes>http,https</schemes>
+ <info>
+ <title>Swagger API Specification for Brooklyn REST server</title>
+ <version>v1</version>
+ <description>
+ Swagger API Specification for Brooklyn REST server
+ </description>
+ <termsOfService>
+ http://www.github.com/apache/incubator-brooklyn
+ </termsOfService>
+ <license>
+ <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
+ <name>Apache 2.0</name>
+ </license>
+ </info>
+ <swaggerDirectory>${project.build.directory}/generated/swagger-api-spec</swaggerDirectory>
+ </apiSource>
+ </apiSources>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>compile</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
</project>
[13/15] incubator-brooklyn git commit: This closes #1091
Posted by sj...@apache.org.
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 Corbett <sa...@cloudsoftcorp.com>
Authored: Fri Dec 11 12:38:27 2015 +0000
Committer: Sam Corbett <sa...@cloudsoftcorp.com>
Committed: Fri Dec 11 12:38:27 2015 +0000
----------------------------------------------------------------------
.../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(-)
----------------------------------------------------------------------
[15/15] incubator-brooklyn git commit: This closes #1098
Posted by sj...@apache.org.
This closes #1098
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/4ed9e97a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/4ed9e97a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/4ed9e97a
Branch: refs/heads/master
Commit: 4ed9e97a8f143e80e05f757e63397321ae69227b
Parents: 0a856de 3e63987
Author: Sam Corbett <sa...@cloudsoftcorp.com>
Authored: Fri Dec 11 12:39:37 2015 +0000
Committer: Sam Corbett <sa...@cloudsoftcorp.com>
Committed: Fri Dec 11 12:39:37 2015 +0000
----------------------------------------------------------------------
.../brooklyn/entity/database/mysql/MySqlNode.java | 2 +-
.../brooklyn/entity/database/mysql/MySqlNodeImpl.java | 4 ++--
.../entity/database/mysql/MySqlSshDriver.java | 14 ++++++++++----
3 files changed, 13 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
[05/15] incubator-brooklyn git commit: Derive artefact and directory
names from download URL.
Posted by sj...@apache.org.
Derive artefact and directory names from download URL.
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/6fcc0e62
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/6fcc0e62
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/6fcc0e62
Branch: refs/heads/master
Commit: 6fcc0e623208a803abb01124384f4b1e91c2b34a
Parents: 89440c3
Author: Alasdair Hodge <gi...@alasdairhodge.co.uk>
Authored: Wed Dec 9 11:22:04 2015 +0000
Committer: Alasdair Hodge <gi...@alasdairhodge.co.uk>
Committed: Wed Dec 9 12:57:53 2015 +0000
----------------------------------------------------------------------
.../brooklyn/entity/database/mysql/MySqlSshDriver.java | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/6fcc0e62/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 2d14726..7b38cbd 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,14 +111,15 @@ public class MySqlSshDriver extends AbstractSoftwareProcessSshDriver implements
return "mymysql.cnf";
}
- public String getInstallFilename() {
- return String.format("mysql-%s-%s.tar.gz", getVersion(), getOsTag());
+ public String getDefaultUnpackedDirectoryName() {
+ return Strings.removeAllFromEnd(resolver.getFilename(), ".tar.gz");
}
@Override
public void preInstall() {
- resolver = Entities.newDownloader(this, ImmutableMap.of("filename", getInstallFilename()));
- setExpandedInstallDir(Os.mergePaths(getInstallDir(), resolver.getUnpackedDirectoryName(format("mysql-%s-%s", getVersion(), getOsTag()))));
+ resolver = Entities.newDownloader(this);
+ String unpackedDirectoryName = resolver.getUnpackedDirectoryName(getDefaultUnpackedDirectoryName());
+ setExpandedInstallDir(Os.mergePaths(getInstallDir(), unpackedDirectoryName));
}
@Override
[02/15] incubator-brooklyn git commit: Redis install - make sure all
build dependencies are installed
Posted by sj...@apache.org.
Redis install - make sure all build dependencies are installed
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/3f34c4ad
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/3f34c4ad
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/3f34c4ad
Branch: refs/heads/master
Commit: 3f34c4adfa2d307498531262019653e8b852a049
Parents: 27d7b78
Author: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Authored: Tue Dec 8 11:28:20 2015 +0200
Committer: Svetoslav Neykov <sv...@cloudsoftcorp.com>
Committed: Tue Dec 8 11:28:20 2015 +0200
----------------------------------------------------------------------
.../brooklyn/entity/nosql/redis/RedisStoreSshDriver.java | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/3f34c4ad/software/nosql/src/main/java/org/apache/brooklyn/entity/nosql/redis/RedisStoreSshDriver.java
----------------------------------------------------------------------
diff --git a/software/nosql/src/main/java/org/apache/brooklyn/entity/nosql/redis/RedisStoreSshDriver.java b/software/nosql/src/main/java/org/apache/brooklyn/entity/nosql/redis/RedisStoreSshDriver.java
index 4aa2b8e..81ebfe3 100644
--- a/software/nosql/src/main/java/org/apache/brooklyn/entity/nosql/redis/RedisStoreSshDriver.java
+++ b/software/nosql/src/main/java/org/apache/brooklyn/entity/nosql/redis/RedisStoreSshDriver.java
@@ -21,9 +21,8 @@ package org.apache.brooklyn.entity.nosql.redis;
import static java.lang.String.format;
import java.util.List;
+import java.util.Map;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.apache.brooklyn.api.location.Location;
import org.apache.brooklyn.core.entity.Entities;
import org.apache.brooklyn.entity.software.base.AbstractSoftwareProcessSshDriver;
@@ -31,8 +30,11 @@ import org.apache.brooklyn.location.ssh.SshMachineLocation;
import org.apache.brooklyn.util.collections.MutableMap;
import org.apache.brooklyn.util.os.Os;
import org.apache.brooklyn.util.ssh.BashCommands;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
/**
* Start a {@link RedisStore} in a {@link Location} accessible over ssh.
@@ -66,6 +68,9 @@ public class RedisStoreSshDriver extends AbstractSoftwareProcessSshDriver implem
"yum", "make",
"apt", "make",
"port", null);
+ //Headers still might be missing on some systems (especially if gcc & make are pre-installed)
+ Map<String, String> installBuildEssentialPackageFlags = ImmutableMap.of(
+ "apt", "build-essential");
List<String> commands = ImmutableList.<String>builder()
.addAll(BashCommands.commandsToDownloadUrlsAs(urls, saveAs))
@@ -73,6 +78,7 @@ public class RedisStoreSshDriver extends AbstractSoftwareProcessSshDriver implem
.add(BashCommands.INSTALL_CURL)
.add(BashCommands.installPackage(installGccPackageFlags, "redis-prerequisites-gcc"))
.add(BashCommands.installPackage(installMakePackageFlags, "redis-prerequisites-make"))
+ .add(BashCommands.installPackage(installBuildEssentialPackageFlags, null))
.add("tar xzfv " + saveAs)
.add(format("cd redis-%s", getVersion()))
.add("pushd deps")
[14/15] incubator-brooklyn git commit: This closes #1097
Posted by sj...@apache.org.
This closes #1097
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/0a856ded
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/0a856ded
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/0a856ded
Branch: refs/heads/master
Commit: 0a856dedb17d704b2b4a614edfa53b191682f0af
Parents: a218cd9 333eeeb
Author: Sam Corbett <sa...@cloudsoftcorp.com>
Authored: Fri Dec 11 12:38:59 2015 +0000
Committer: Sam Corbett <sa...@cloudsoftcorp.com>
Committed: Fri Dec 11 12:38:59 2015 +0000
----------------------------------------------------------------------
.../yaml/test/example_yaml/entities/script1.sh | 2 +
.../entities/simpleshellcommandtest-entity.yaml | 24 +++++++
docs/guide/yaml/test/index.md | 1 +
docs/guide/yaml/test/test-entities.md | 68 ++++++++++++++++----
4 files changed, 83 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
[07/15] incubator-brooklyn git commit: Atomic sensor test-and-set.
Posted by sj...@apache.org.
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 Hodge <gi...@alasdairhodge.co.uk>
Authored: Wed Dec 9 11:22:47 2015 +0000
Committer: Alasdair Hodge <gi...@alasdairhodge.co.uk>
Committed: Wed Dec 9 12:57:54 2015 +0000
----------------------------------------------------------------------
.../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);
[11/15] incubator-brooklyn git commit: This closes #1092
Posted by sj...@apache.org.
This closes #1092
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/7dfe9595
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/7dfe9595
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/7dfe9595
Branch: refs/heads/master
Commit: 7dfe9595c959fd892ba99d13f204b6b69fdfeed5
Parents: c03827e 3f34c4a
Author: Sam Corbett <sa...@cloudsoftcorp.com>
Authored: Fri Dec 11 12:37:15 2015 +0000
Committer: Sam Corbett <sa...@cloudsoftcorp.com>
Committed: Fri Dec 11 12:37:15 2015 +0000
----------------------------------------------------------------------
.../brooklyn/entity/nosql/redis/RedisStoreSshDriver.java | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
[12/15] incubator-brooklyn git commit: This closes #1095
Posted by sj...@apache.org.
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 Corbett <sa...@cloudsoftcorp.com>
Authored: Fri Dec 11 12:37:48 2015 +0000
Committer: Sam Corbett <sa...@cloudsoftcorp.com>
Committed: Fri Dec 11 12:37:48 2015 +0000
----------------------------------------------------------------------
docs/website/download/index.md | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
[10/15] incubator-brooklyn git commit: This closes #1100
Posted by sj...@apache.org.
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 Corbett <sa...@cloudsoftcorp.com>
Authored: Fri Dec 11 12:33:54 2015 +0000
Committer: Sam Corbett <sa...@cloudsoftcorp.com>
Committed: Fri Dec 11 12:33:54 2015 +0000
----------------------------------------------------------------------
usage/rest-api/pom.xml | 46 +++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 44 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
[03/15] incubator-brooklyn git commit: removed incubator from mirror
download urls
Posted by sj...@apache.org.
removed incubator from mirror download urls
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/ecb89769
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/ecb89769
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/ecb89769
Branch: refs/heads/master
Commit: ecb89769b6c714fcce3bfeff36cf3eb387de7443
Parents: b39ef3a
Author: John McCabe <jo...@johnmccabe.net>
Authored: Wed Dec 9 10:12:00 2015 +0000
Committer: John McCabe <jo...@johnmccabe.net>
Committed: Wed Dec 9 10:12:00 2015 +0000
----------------------------------------------------------------------
docs/website/download/index.md | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/ecb89769/docs/website/download/index.md
----------------------------------------------------------------------
diff --git a/docs/website/download/index.md b/docs/website/download/index.md
index 0b9c7d9..077e068 100644
--- a/docs/website/download/index.md
+++ b/docs/website/download/index.md
@@ -25,8 +25,8 @@ A pre-built package that contains Apache Brooklyn and all of its dependencies in
**Choose your preferred file format to see the list of mirrors where you can download this file.**
<div class="text-center">
- <a class="btn btn-default" href="https://www.apache.org/dyn/closer.lua/incubator/brooklyn/apache-brooklyn-{{ site.brooklyn-stable-version }}/apache-brooklyn-{{ site.brooklyn-stable-version }}-bin.tar.gz" role="button">Tarball</a>
- <a class="btn btn-default" href="https://www.apache.org/dyn/closer.lua/incubator/brooklyn/apache-brooklyn-{{ site.brooklyn-stable-version }}/apache-brooklyn-{{ site.brooklyn-stable-version }}-bin.zip" role="button">Zip</a>
+ <a class="btn btn-default" href="https://www.apache.org/dyn/closer.lua/brooklyn/apache-brooklyn-{{ site.brooklyn-stable-version }}/apache-brooklyn-{{ site.brooklyn-stable-version }}-bin.tar.gz" role="button">Tarball</a>
+ <a class="btn btn-default" href="https://www.apache.org/dyn/closer.lua/brooklyn/apache-brooklyn-{{ site.brooklyn-stable-version }}/apache-brooklyn-{{ site.brooklyn-stable-version }}-bin.zip" role="button">Zip</a>
<br /><small>These are not direct download links, sorry</small>
</div>
</div>
@@ -49,8 +49,8 @@ contribute code changes to Apache Brooklyn, we recommend you get the source code
**Choose your preferred file format to see the list of mirrors where you can download this file.**
<div class="text-center">
- <a class="btn btn-default" href="https://www.apache.org/dyn/closer.lua/incubator/brooklyn/apache-brooklyn-{{ site.brooklyn-stable-version }}/apache-brooklyn-{{ site.brooklyn-stable-version }}-src.tar.gz" role="button">Tarball</a>
- <a class="btn btn-default" href="https://www.apache.org/dyn/closer.lua/incubator/brooklyn/apache-brooklyn-{{ site.brooklyn-stable-version }}/apache-brooklyn-{{ site.brooklyn-stable-version }}-src.zip" role="button">Zip</a>
+ <a class="btn btn-default" href="https://www.apache.org/dyn/closer.lua/brooklyn/apache-brooklyn-{{ site.brooklyn-stable-version }}/apache-brooklyn-{{ site.brooklyn-stable-version }}-src.tar.gz" role="button">Tarball</a>
+ <a class="btn btn-default" href="https://www.apache.org/dyn/closer.lua/brooklyn/apache-brooklyn-{{ site.brooklyn-stable-version }}/apache-brooklyn-{{ site.brooklyn-stable-version }}-src.zip" role="button">Zip</a>
<br /><small>These are not direct download links, sorry</small>
</div>
</div>
[08/15] incubator-brooklyn git commit: Add documentation for
assertions and SimpleShellCommandTest.
Posted by sj...@apache.org.
Add documentation for assertions and SimpleShellCommandTest.
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/333eeeb1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/333eeeb1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/333eeeb1
Branch: refs/heads/master
Commit: 333eeeb15d6b4712542da64ad1adcc30f25a7e8e
Parents: 14e63fc
Author: Geoff Macartney <ge...@cloudsoftcorp.com>
Authored: Wed Dec 9 14:39:38 2015 +0000
Committer: Geoff Macartney <ge...@cloudsoftcorp.com>
Committed: Wed Dec 9 14:39:38 2015 +0000
----------------------------------------------------------------------
.../yaml/test/example_yaml/entities/script1.sh | 2 ++
.../entities/simpleshellcommandtest-entity.yaml | 13 +++++--------
docs/guide/yaml/test/test-entities.md | 19 +++++--------------
3 files changed, 12 insertions(+), 22 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/333eeeb1/docs/guide/yaml/test/example_yaml/entities/script1.sh
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/example_yaml/entities/script1.sh b/docs/guide/yaml/test/example_yaml/entities/script1.sh
new file mode 100644
index 0000000..2a98304
--- /dev/null
+++ b/docs/guide/yaml/test/example_yaml/entities/script1.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+echo hello world
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/333eeeb1/docs/guide/yaml/test/example_yaml/entities/simpleshellcommandtest-entity.yaml
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/example_yaml/entities/simpleshellcommandtest-entity.yaml b/docs/guide/yaml/test/example_yaml/entities/simpleshellcommandtest-entity.yaml
index c8217eb..3e14aa5 100644
--- a/docs/guide/yaml/test/example_yaml/entities/simpleshellcommandtest-entity.yaml
+++ b/docs/guide/yaml/test/example_yaml/entities/simpleshellcommandtest-entity.yaml
@@ -1,24 +1,21 @@
-name: simpleShellCommandTest
-location: mybyonhost
-services:
- type: org.apache.brooklyn.test.framework.TestCase
name: testcase1
targetId: testprocess
brooklyn.children:
- - type: org.apache.brooklyn.entity.software.base.EmptySoftwareProcess
+ - type: org.apache.brooklyn.entity.webapp.tomcat.TomcatServer
id: testprocess
- type: org.apache.brooklyn.test.framework.SimpleShellCommandTest
- defaultCommand: hostname
+ command: ps -ef
assertStatus:
equals: 0
- assertOut:
- equals: mybyonhost
+ assertOut:
+ contains: tomcat
assertErr:
isEmpty: true
- type: org.apache.brooklyn.test.framework.SimpleShellCommandTest
- downloadUrl: http://localhost:8080/script1.sh
+ downloadUrl: https://raw.githubusercontent.com/apache/incubator-brooklyn/master/docs/guide/yaml/test/entities/script1.sh
assertStatus:
equals: 0
assertOut:
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/333eeeb1/docs/guide/yaml/test/test-entities.md
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/test-entities.md b/docs/guide/yaml/test/test-entities.md
index ddbf60b..f8eb087 100644
--- a/docs/guide/yaml/test/test-entities.md
+++ b/docs/guide/yaml/test/test-entities.md
@@ -6,15 +6,6 @@ layout: website-normal
{% include fields.md %}
-- [Structural Test Entities](#structural-test-entities)
- - [TestCase](#testcase)
- - [ParallelTestCase](#paralleltestcase)
-- [Validation Test Entities](#validation-test-entities)
- - [TestSensor](#testsensor)
- - [TestEffector](#testeffector)
- - [TestHttpCall](#testhttpcall)
- - [SimpleShellCommandTest](#simpleshellcommandtest)
-- [Assertions](#assertions)
## Structural Test Entities
@@ -56,7 +47,7 @@ The `TestSensor` entity performs an assertion on a specified sensors value.
- `targetId` - alternative to the `target` parameter which wraps the DSL component lookup requiring only the `id` be supplied. For example, `tomcat`.
- `sensor` - sensor to evaluate. For example `service.isUp`.
- `timeout` - duration to wait on assertion to return a result. For example `10s`, `10m`, etc
-- `assert` - assertion to perform on the specified sensor value.
+- `assert` - assertion to perform on the specified sensor value. See section on assertions below.
### TestEffector
The `TestEffector` entity invokes the specified effector on a target entity.
@@ -81,12 +72,12 @@ The `TestHttpCall` entity performs a HTTP GET on the specified URL and performs
- `url` - URL to perform GET request on, this can use DSL for example `$brooklyn:component("tomcat").attributeWhenReady("webapp.url")`.
- `timeout` - duration to wait on a HTTP response. For example `10s`, `10m`, etc
- `applyAssertionTo` - The filed to apply the assertion to. For example `status`, `body`
-- `assert` - assertion to perform on the response.
+- `assert` - assertion to perform on the response. See section on assertions below.
### SimpleShellCommandTest
-The purpose of a SimpleShellCommandTest is to run a command, on the host of the target entity,
-that is expected to "do something", finishing quickly, and return a result (process exit code), along with its
+The SimpleShellCommandTest runs a command on the host of the target entity.
+The script is expected not to run indefinitely, but to return a result (process exit code), along with its
standard out and error streams, which can then be tested using assertions.
If no assertions are explicitly configured, the default is to assert a non-zero exit code.
@@ -101,7 +92,7 @@ Either a shell command may be provided in the YAML, or a URL for a script which
- `downloadUrl` - URL for a script to download and execute. (This and `command` are mutually exclusive.)
- `scriptDir` - if `downloadUrl` is used. The directory on the target host where downloaded scripts should be copied to.
- `runDir` - the working directory where the command or script will be executed on the target host.
-- `assertStatus` - Assertions on the exit code of the command or script.
+- `assertStatus` - Assertions on the exit code of the command or script. See section on assertions below.
- `assertOut` - Assertions on the standard output of the command as a String.
- `assertErr` - Assertions on the standard error of the command as a String.
[06/15] incubator-brooklyn git commit: Derive correct URL path for
specified version.
Posted by sj...@apache.org.
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 Hodge <gi...@alasdairhodge.co.uk>
Authored: Wed Dec 9 12:57:11 2015 +0000
Committer: Alasdair Hodge <gi...@alasdairhodge.co.uk>
Committed: Wed Dec 9 12:57:54 2015 +0000
----------------------------------------------------------------------
.../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<String> 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");
}