Skip to content
Permalink
Browse files
Merge commit '3772c215' into release-5.0-reverted-222
  • Loading branch information
ahgittin committed Sep 4, 2018
2 parents b40c7ed + 3772c21 commit f970695559d6c00809ce53163b5ad2f4c25e9bc5
Showing 16 changed files with 27 additions and 27 deletions.
@@ -3,7 +3,7 @@ services:
- type: org.apache.brooklyn.entity.webapp.ControlledDynamicWebAppCluster
brooklyn.config:
cluster.initial.size: 2
wars.root: http://search.maven.org/remotecontent?filepath=org/apache/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.8.0-incubating/brooklyn-example-hello-world-sql-webapp-0.8.0-incubating.war
wars.root: https://search.maven.org/remotecontent?filepath=org/apache/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.12.0/brooklyn-example-hello-world-sql-webapp-0.12.0.war # BROOKLYN_VERSION
http.port: 8080+
java.sysprops:
brooklyn.example.db.url: $brooklyn:formatString("jdbc:%s%s?user=%s\\&password=%s", component("db").attributeWhenReady("datastore.url"), "visitors", "brooklyn", $brooklyn:external("brooklyn-demo-sample", "hidden-brooklyn-password"))
@@ -7,7 +7,7 @@ services:
$brooklyn:entitySpec:
type: org.apache.brooklyn.entity.webapp.jboss.JBoss7Server
brooklyn.config:
wars.root: http://search.maven.org/remotecontent?filepath=org/apache/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.8.0-incubating/brooklyn-example-hello-world-sql-webapp-0.8.0-incubating.war
wars.root: https://search.maven.org/remotecontent?filepath=org/apache/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.12.0/brooklyn-example-hello-world-sql-webapp-0.12.0.war # BROOKLYN_VERSION
http.port: 8080+
java.sysprops:
brooklyn.example.db.url:
@@ -2,5 +2,5 @@ name: appserver-configured
services:
- type: org.apache.brooklyn.entity.webapp.jboss.JBoss7Server
brooklyn.config:
wars.root: http://search.maven.org/remotecontent?filepath=org/apache/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.8.0-incubating/brooklyn-example-hello-world-sql-webapp-0.8.0-incubating.war
wars.root: https://search.maven.org/remotecontent?filepath=org/apache/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.12.0/brooklyn-example-hello-world-sql-webapp-0.12.0.war # BROOKLYN_VERSION
http.port: 8080
@@ -3,7 +3,7 @@ services:
- type: org.apache.brooklyn.entity.webapp.tomcat.TomcatServer
name: AppServer HelloWorld
brooklyn.config:
wars.root: http://search.maven.org/remotecontent?filepath=org/apache/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.8.0-incubating/brooklyn-example-hello-world-sql-webapp-0.8.0-incubating.war
wars.root: https://search.maven.org/remotecontent?filepath=org/apache/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.12.0/brooklyn-example-hello-world-sql-webapp-0.12.0.war # BROOKLYN_VERSION
http.port: 8080+
java.sysprops:
brooklyn.example.db.url:
@@ -3,7 +3,7 @@ services:
- type: org.apache.brooklyn.entity.webapp.jboss.JBoss7Server
name: AppServer HelloWorld
brooklyn.config:
wars.root: http://search.maven.org/remotecontent?filepath=org/apache/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.8.0-incubating/brooklyn-example-hello-world-sql-webapp-0.8.0-incubating.war
wars.root: https://search.maven.org/remotecontent?filepath=org/apache/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.12.0/brooklyn-example-hello-world-sql-webapp-0.12.0.war # BROOKLYN_VERSION
http.port: 8080+
java.sysprops:
brooklyn.example.db.url:
@@ -7,7 +7,7 @@ services:
$brooklyn:entitySpec:
type: org.apache.brooklyn.entity.webapp.jboss.JBoss7Server
brooklyn.config:
wars.root: http://search.maven.org/remotecontent?filepath=org/apache/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.8.0-incubating/brooklyn-example-hello-world-sql-webapp-0.8.0-incubating.war
wars.root: https://search.maven.org/remotecontent?filepath=org/apache/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.12.0/brooklyn-example-hello-world-sql-webapp-0.12.0.war # BROOKLYN_VERSION
http.port: 8080+
java.sysprops:
brooklyn.example.db.url:
@@ -49,7 +49,7 @@ brooklyn.catalog:
id: tomcat
latch.customize: $brooklyn:entity("es").attributeWhenReady("service.isUp")
brooklyn.config:
wars.root: "http://search.maven.org/remotecontent?filepath=org/apache/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.8.0-incubating/brooklyn-example-hello-world-sql-webapp-0.8.0-incubating.war"
wars.root: https://search.maven.org/remotecontent?filepath=org/apache/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.12.0/brooklyn-example-hello-world-sql-webapp-0.12.0.war # BROOKLYN_VERSION
children.startable.mode: background_late

provisioning.properties:
@@ -5,5 +5,5 @@
effector: deploy
timeout: 5m
params:
url: http://search.maven.org/remotecontent?filepath=org/apache/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.8.0-incubating/brooklyn-example-hello-world-sql-webapp-0.8.0-incubating.war
url: https://search.maven.org/remotecontent?filepath=org/apache/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.12.0/brooklyn-example-hello-world-sql-webapp-0.12.0.war # BROOKLYN_VERSION
targetName: newcontext
@@ -16,7 +16,7 @@
effector: deploy
timeout: 5m
params:
url: http://search.maven.org/remotecontent?filepath=org/apache/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.8.0-incubating/brooklyn-example-hello-world-sql-webapp-0.8.0-incubating.war
url: https://search.maven.org/remotecontent?filepath=org/apache/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.12.0/brooklyn-example-hello-world-sql-webapp-0.12.0.war # BROOKLYN_VERSION
targetName: newcontext
- type: org.apache.brooklyn.test.framework.TestHttpCall
name: Check Deployed Webapp Status Code
@@ -10,7 +10,7 @@ services:
name: My Web
id: webappcluster
brooklyn.config:
wars.root: http://search.maven.org/remotecontent?filepath=org/apache/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.8.0-incubating/brooklyn-example-hello-world-sql-webapp-0.8.0-incubating.war
wars.root: https://search.maven.org/remotecontent?filepath=org/apache/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.12.0/brooklyn-example-hello-world-sql-webapp-0.12.0.war # BROOKLYN_VERSION
java.sysprops:
brooklyn.example.db.url: >
$brooklyn:formatString("jdbc:%s%s?user=%s&password=%s",
@@ -62,7 +62,7 @@ services:
effector: deploy
timeout: 5m
params:
url: http://search.maven.org/remotecontent?filepath=org/apache/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.8.0-incubating/brooklyn-example-hello-world-sql-webapp-0.8.0-incubating.war
url: https://search.maven.org/remotecontent?filepath=org/apache/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.12.0/brooklyn-example-hello-world-sql-webapp-0.12.0.war # BROOKLYN_VERSION
targetName: newcontext
- type: org.apache.brooklyn.test.framework.TestHttpCall
name: Check Deployed Webapp Status Code
@@ -27,16 +27,6 @@ Demonstrates the following sensor assertion:
{% read example_yaml/testcases/sensor-test-snippet.yaml %}
{% endhighlight %}

### HTTP Call Tests
Demonstrates the following HTTP Call assertions against the specified `url`, which in these examples are being built from the `webappcluster` entities `host.address` and `proxy.http.port` sensors (the tester having flexibility in how the test URL is to be constructed):

- asserts the response status code is 200 within 10 minutes of the blueprint being deployed.
- asserts the response body matches the regex `(?s).*Br[o]{2}klyn Deployed.*` within 10 minutes of the blueprint being deployed. Note the presence of the `(?s)` dotall flag to test a multiline response.

{% highlight yaml %}
{% readj example_yaml/testcases/http-test-snippet.yaml %}
{% endhighlight %}

### Effector Test (via TestCase entity)

This `TestEffector` example demonstrates the use of the `TestCase` and `TestSensor` entities to ensure the service has started before invoking an effector using the `TestEffector` entity.
@@ -50,6 +40,16 @@ This `TestEffector` example demonstrates the use of the `TestCase` and `TestSens
{% readj example_yaml/testcases/effector-test-snippet.yaml %}
{% endhighlight %}

### HTTP Call Tests
Demonstrates the following HTTP Call assertions against the specified `url`, which in these examples are being built from the `webappcluster` entities `host.address` and `proxy.http.port` sensors (the tester having flexibility in how the test URL is to be constructed):

- asserts the response status code is 200 within 10 minutes of the blueprint being deployed.
- asserts the response body matches the regex `(?s).*Br[o]{2}klyn Deployed.*` within 10 minutes of the blueprint being deployed. Note the presence of the `(?s)` dotall flag to test a multiline response.

{% highlight yaml %}
{% readj example_yaml/testcases/http-test-snippet.yaml %}
{% endhighlight %}

### Full Example
A sample blueprint containing all the tests described above is available [here](./example_yaml/testcases/getting-started-test-example.yaml).

@@ -10,7 +10,7 @@ services:
name: My Web
id: webappcluster
brooklyn.config:
wars.root: http://search.maven.org/remotecontent?filepath=org/apache/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.8.0-incubating/brooklyn-example-hello-world-sql-webapp-0.8.0-incubating.war
wars.root: https://search.maven.org/remotecontent?filepath=org/apache/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.12.0/brooklyn-example-hello-world-sql-webapp-0.12.0.war # BROOKLYN_VERSION
java.sysprops:
brooklyn.example.db.url: >
$brooklyn:formatString("jdbc:%s%s?user=%s&password=%s",
@@ -7,7 +7,7 @@ services:
- type: org.apache.brooklyn.entity.webapp.ControlledDynamicWebAppCluster
name: My Web
brooklyn.config:
wars.root: http://search.maven.org/remotecontent?filepath=org/apache/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.8.0-incubating/brooklyn-example-hello-world-sql-webapp-0.8.0-incubating.war
wars.root: https://search.maven.org/remotecontent?filepath=org/apache/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.12.0/brooklyn-example-hello-world-sql-webapp-0.12.0.war # BROOKLYN_VERSION
java.sysprops:
brooklyn.example.db.url: >
$brooklyn:formatString("jdbc:%s%s?user=%s&password=%s",
@@ -10,7 +10,7 @@ services:
name: My Web
id: webappcluster
brooklyn.config:
wars.root: http://search.maven.org/remotecontent?filepath=org/apache/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.8.0-incubating/brooklyn-example-hello-world-sql-webapp-0.8.0-incubating.war
wars.root: https://search.maven.org/remotecontent?filepath=org/apache/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.12.0/brooklyn-example-hello-world-sql-webapp-0.12.0.war # BROOKLYN_VERSION
java.sysprops:
brooklyn.example.db.url: >
$brooklyn:formatString("jdbc:%s%s?user=%s&password=%s",
@@ -21,4 +21,4 @@ services:
id: db
brooklyn.config:
creation.script.password: $brooklyn:external("brooklyn-demo-sample", "hidden-brooklyn-password")
datastore.creation.script.url: https://bit.ly/brooklyn-visitors-creation-script
datastore.creation.script.url: https://bit.ly/brooklyn-visitors-creation-script
@@ -7,7 +7,7 @@ services:
- type: org.apache.brooklyn.entity.webapp.ControlledDynamicWebAppCluster
name: My Web
brooklyn.config:
wars.root: http://search.maven.org/remotecontent?filepath=org/apache/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.8.0-incubating/brooklyn-example-hello-world-sql-webapp-0.8.0-incubating.war
wars.root: https://search.maven.org/remotecontent?filepath=org/apache/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.12.0/brooklyn-example-hello-world-sql-webapp-0.12.0.war # BROOKLYN_VERSION
java.sysprops:
brooklyn.example.db.url: >
$brooklyn:formatString("jdbc:%s%s?user=%s&password=%s",
@@ -21,7 +21,7 @@ services:
type: org.apache.brooklyn.entity.webapp.tomcat.TomcatServer
name: Tomcat Server
brooklyn.config:
wars.root: http://search.maven.org/remotecontent?filepath=org/apache/brooklyn/example/brooklyn-example-hello-world-webapp/0.8.0-incubating/brooklyn-example-hello-world-webapp-0.8.0-incubating.war
wars.root: https://search.maven.org/remotecontent?filepath=org/apache/brooklyn/example/brooklyn-example-hello-world-webapp/0.12.0/brooklyn-example-hello-world-webapp-0.12.0.war # BROOKLYN_VERSION

brooklyn.policies:
- type: org.apache.brooklyn.policy.ha.ServiceRestarter

0 comments on commit f970695

Please sign in to comment.