You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2015/11/23 19:53:50 UTC

[1/5] incubator-brooklyn git commit: yaml testing docs

Repository: incubator-brooklyn
Updated Branches:
  refs/heads/master 35d75537c -> 4ebe7379b


yaml testing docs


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/cc25df3f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/cc25df3f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/cc25df3f

Branch: refs/heads/master
Commit: cc25df3fa92a7b4d50cae72e44afb61e50ff0cd1
Parents: ca89ed4
Author: John McCabe <jo...@johnmccabe.net>
Authored: Fri Nov 13 16:45:30 2015 +0000
Committer: John McCabe <jo...@johnmccabe.net>
Committed: Fri Nov 13 16:45:30 2015 +0000

----------------------------------------------------------------------
 docs/guide/yaml/index.md                        |  1 +
 .../example_yaml/paralleltestcase-entity.yaml   |  2 +
 .../example_yaml/paralleltestcase-example.yaml  | 46 +++++++++++++
 ...simple-tomcat-app-effector-test-snippet.yaml | 19 ++++++
 .../simple-tomcat-app-http-test-snippet.yaml    | 11 +++
 .../simple-tomcat-app-sensor-test.yaml          | 24 +++++++
 .../test/example_yaml/simple-tomcat-app.yaml    | 15 ++++
 .../yaml/test/example_yaml/testcase-entity.yaml |  2 +
 .../test/example_yaml/testeffector-entity.yaml  |  7 ++
 .../test/example_yaml/testhttpcall-entity.yaml  |  5 ++
 .../test/example_yaml/testsensor-entity.yaml    |  6 ++
 docs/guide/yaml/test/index.md                   | 24 +++++++
 docs/guide/yaml/test/test-entities.md           | 72 ++++++++++++++++++++
 docs/guide/yaml/test/usage-examples.md          | 57 ++++++++++++++++
 14 files changed, 291 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/cc25df3f/docs/guide/yaml/index.md
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/index.md b/docs/guide/yaml/index.md
index 55acfee..b0303cb 100644
--- a/docs/guide/yaml/index.md
+++ b/docs/guide/yaml/index.md
@@ -11,6 +11,7 @@ children:
 - custom-entities.md
 - winrm/
 - chef/
+- test/
 - { path: yaml-reference.md, title: YAML Blueprint Reference }
 - { link: 'https://github.com/brooklyncentral/blueprint-library', title: 'GitHub Blueprint Library' }
 ---

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/cc25df3f/docs/guide/yaml/test/example_yaml/paralleltestcase-entity.yaml
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/example_yaml/paralleltestcase-entity.yaml b/docs/guide/yaml/test/example_yaml/paralleltestcase-entity.yaml
new file mode 100644
index 0000000..1dca082
--- /dev/null
+++ b/docs/guide/yaml/test/example_yaml/paralleltestcase-entity.yaml
@@ -0,0 +1,2 @@
+- type: org.apache.brooklyn.test.framework.ParallelTestCase
+  brooklyn.children:
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/cc25df3f/docs/guide/yaml/test/example_yaml/paralleltestcase-example.yaml
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/example_yaml/paralleltestcase-example.yaml b/docs/guide/yaml/test/example_yaml/paralleltestcase-example.yaml
new file mode 100644
index 0000000..c7f0f5b
--- /dev/null
+++ b/docs/guide/yaml/test/example_yaml/paralleltestcase-example.yaml
@@ -0,0 +1,46 @@
+brooklyn.catalog:
+  id: parallel-test
+  version: 1.0
+  itemType: template
+  iconUrl: http://tomcat.apache.org/images/tomcat.png
+  name: Parallel Tomcat and DB Example Test
+  license: Apache-2.0
+  item:
+    brooklyn.config:
+      simple.confg: someValue
+    services:
+    - type: org.apache.brooklyn.test.framework.TestCase
+      name: Parallel Testcase
+      brooklyn.children:
+      - type: org.apache.brooklyn.test.framework.TestCase
+        name: Parallel Testcase
+        brooklyn.children:
+        - type: org.apache.brooklyn.entity.webapp.ControlledDynamicWebAppCluster
+          name: My Web
+          id: webappcluster
+          brooklyn.config:
+            wars.root: http://search.maven.org/remotecontent?filepath=io/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.6.0/brooklyn-example-hello-world-sql-webapp-0.6.0.war
+            java.sysprops:
+              brooklyn.example.db.url: >
+                $brooklyn:formatString("jdbc:%s%s?user=%s&password=%s",
+                component("db").attributeWhenReady("datastore.url"),
+                "visitors", "brooklyn", "br00k11n")
+        - type: org.apache.brooklyn.entity.database.mysql.MySqlNode
+          id: db
+          name: My DB
+          brooklyn.config:
+            creationScriptUrl: https://bit.ly/brooklyn-visitors-creation-script
+      - type: org.apache.brooklyn.test.framework.TestSensor
+        name: Test WebApp Cluster service.isUp
+        targetId: webappcluster
+        sensor: service.isUp
+        timeout: 10m
+        assert:
+          equals: true
+      - type: org.apache.brooklyn.test.framework.TestSensor
+        name: Test DB service.isUp
+        targetId: db
+        sensor: service.isUp
+        timeout: 10m
+        assert:
+          equals: true
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/cc25df3f/docs/guide/yaml/test/example_yaml/simple-tomcat-app-effector-test-snippet.yaml
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/example_yaml/simple-tomcat-app-effector-test-snippet.yaml b/docs/guide/yaml/test/example_yaml/simple-tomcat-app-effector-test-snippet.yaml
new file mode 100644
index 0000000..a9ab85d
--- /dev/null
+++ b/docs/guide/yaml/test/example_yaml/simple-tomcat-app-effector-test-snippet.yaml
@@ -0,0 +1,19 @@
+- type: org.apache.brooklyn.test.framework.TestEffector
+  name: Deploy WAR in /newcontext
+  targetId: tomcat
+  effector: deploy
+  timeout:
+  params:
+    url: https://tomcat.apache.org/tomcat-6.0-doc/appdev/sample/sample.war
+    targetName: newcontext
+- type: org.apache.brooklyn.test.framework.TestHttpCall
+  name: /newcontext Status Code 200
+  url: $brooklyn:formatString("%s/newcontext/", component("tomcat").attributeWhenReady("webapp.url"))
+  timeout: 5m
+  assert:
+    status: 200
+
+
+
+
+

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/cc25df3f/docs/guide/yaml/test/example_yaml/simple-tomcat-app-http-test-snippet.yaml
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/example_yaml/simple-tomcat-app-http-test-snippet.yaml b/docs/guide/yaml/test/example_yaml/simple-tomcat-app-http-test-snippet.yaml
new file mode 100644
index 0000000..e967908
--- /dev/null
+++ b/docs/guide/yaml/test/example_yaml/simple-tomcat-app-http-test-snippet.yaml
@@ -0,0 +1,11 @@
+- type: org.apache.brooklyn.test.framework.TestHttpCall
+  name: Status Code 200
+  url: $brooklyn:component("tomcat").attributeWhenReady("webapp.url")
+  timeout: 60s
+  assert:
+    status: 200
+- type: org.apache.brooklyn.test.framework.TestHttpCall
+  name: Regex match
+  url: $brooklyn:component("tomcat").attributeWhenReady("webapp.url")
+  assert:
+    regex: "(?s).*Br[o]{2}klyn Deployed.*"
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/cc25df3f/docs/guide/yaml/test/example_yaml/simple-tomcat-app-sensor-test.yaml
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/example_yaml/simple-tomcat-app-sensor-test.yaml b/docs/guide/yaml/test/example_yaml/simple-tomcat-app-sensor-test.yaml
new file mode 100644
index 0000000..3e96ac3
--- /dev/null
+++ b/docs/guide/yaml/test/example_yaml/simple-tomcat-app-sensor-test.yaml
@@ -0,0 +1,24 @@
+brooklyn.catalog:
+  id: simple-tomcat-app-sensor-test
+  version: 1.0
+  itemType: template
+  iconUrl: http://tomcat.apache.org/images/tomcat.png
+  name: Simple Tomcat Application Sensor Test
+  license: Apache-2.0
+  item:
+    brooklyn.config:
+      simple.confg: someValue
+    services:
+    - type: org.apache.brooklyn.test.framework.TestCase
+      name: Simple Tomcat Sensor Test
+      brooklyn.children:
+      - type: simple-tomcat-app
+        name: Deploy Tomcat App
+        id: tomcat
+      - type: org.apache.brooklyn.test.framework.TestSensor
+        name: Test service.isUp
+        targetId: tomcat
+        sensor: service.isUp
+        timeout: 10m
+        assert:
+          equals: true
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/cc25df3f/docs/guide/yaml/test/example_yaml/simple-tomcat-app.yaml
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/example_yaml/simple-tomcat-app.yaml b/docs/guide/yaml/test/example_yaml/simple-tomcat-app.yaml
new file mode 100644
index 0000000..7207478
--- /dev/null
+++ b/docs/guide/yaml/test/example_yaml/simple-tomcat-app.yaml
@@ -0,0 +1,15 @@
+brooklyn.catalog:
+  id: simple-tomcat-app
+  version: 1.0
+  itemType: template
+  iconUrl: http://tomcat.apache.org/images/tomcat.png
+  name: Simple Tomcat Application
+  license: Apache-2.0
+  item:
+    brooklyn.config:
+      simple.confg: someValue
+    services:
+    - type: org.apache.brooklyn.entity.webapp.tomcat.TomcatServer
+      id: tomcat
+      name: Tomcat
+      war: https://tomcat.apache.org/tomcat-6.0-doc/appdev/sample/sample.war
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/cc25df3f/docs/guide/yaml/test/example_yaml/testcase-entity.yaml
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/example_yaml/testcase-entity.yaml b/docs/guide/yaml/test/example_yaml/testcase-entity.yaml
new file mode 100644
index 0000000..c8a8bd8
--- /dev/null
+++ b/docs/guide/yaml/test/example_yaml/testcase-entity.yaml
@@ -0,0 +1,2 @@
+- type: org.apache.brooklyn.test.framework.TestCase
+  brooklyn.children:
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/cc25df3f/docs/guide/yaml/test/example_yaml/testeffector-entity.yaml
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/example_yaml/testeffector-entity.yaml b/docs/guide/yaml/test/example_yaml/testeffector-entity.yaml
new file mode 100644
index 0000000..9ce74fa
--- /dev/null
+++ b/docs/guide/yaml/test/example_yaml/testeffector-entity.yaml
@@ -0,0 +1,7 @@
+- type: org.apache.brooklyn.test.framework.TestEffector
+  name: Deploy WAR in /newcontext
+  target: $brooklyn:component("tomcat")
+  effector: deploy
+  params:
+    url: http://search.maven.org/remotecontent?filepath=io/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.6.0/brooklyn-example-hello-world-sql-webapp-0.6.0.war
+    targetName: newcontext
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/cc25df3f/docs/guide/yaml/test/example_yaml/testhttpcall-entity.yaml
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/example_yaml/testhttpcall-entity.yaml b/docs/guide/yaml/test/example_yaml/testhttpcall-entity.yaml
new file mode 100644
index 0000000..39742c1
--- /dev/null
+++ b/docs/guide/yaml/test/example_yaml/testhttpcall-entity.yaml
@@ -0,0 +1,5 @@
+  - type: org.apache.brooklyn.test.framework.TestHttpCall
+    name: /newcontext Status Code 404
+    url: $brooklyn:formatString("%s/newcontext/", component("tomcat").attributeWhenReady("webapp.url"))
+    assert:
+      status: 404
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/cc25df3f/docs/guide/yaml/test/example_yaml/testsensor-entity.yaml
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/example_yaml/testsensor-entity.yaml b/docs/guide/yaml/test/example_yaml/testsensor-entity.yaml
new file mode 100644
index 0000000..00c3ff4
--- /dev/null
+++ b/docs/guide/yaml/test/example_yaml/testsensor-entity.yaml
@@ -0,0 +1,6 @@
+- type: org.apache.brooklyn.test.framework.TestSensor
+  target: $brooklyn:component("tomcat")
+  sensor: service.isUp
+  timeout: 10m
+  assert:
+    equals: true
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/cc25df3f/docs/guide/yaml/test/index.md
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/index.md b/docs/guide/yaml/test/index.md
new file mode 100644
index 0000000..804b055
--- /dev/null
+++ b/docs/guide/yaml/test/index.md
@@ -0,0 +1,24 @@
+---
+title: Testing YAML Blueprints
+layout: website-normal
+children:
+- test-entities.md
+- usage-examples.md
+---
+
+Brooklyn provides a selection of basic test entities which can be used to validate Blueprints via YAML. These are divided into two groups structural, which effect the order in which child entities are started, and validation, which are used to confirm the application is deployed as intended:
+
+Structural test entities include:
+
+- `TestCase`  - starts child entities sequentially.
+- `ParallelTestCase` - starts child entities in parallel.
+
+Validation test entities include:
+
+- `TestSensor` - perform assertion on a specified sensor.
+- `TestEffector` - invoke effector on specified target entity.
+- `TestHttpCall` - perform assertions on response to specified HTTP GET Request.
+
+The following sections provide details on each test entity along with examples of their use.
+
+{% include list-children.html %}

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/cc25df3f/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
new file mode 100644
index 0000000..6ab454f
--- /dev/null
+++ b/docs/guide/yaml/test/test-entities.md
@@ -0,0 +1,72 @@
+---
+title: Blueprint Test Entities
+title_in_menu: Test Entities
+layout: website-normal
+---
+
+{% include fields.md %}
+
+## Structural Test Entities
+
+### TestCase
+The `TestCase` entity acts as a container for a list child entities which are started *sequentially*.
+{% highlight yaml %}
+{% readj example_yaml/testcase-entity.yaml %}
+{% endhighlight %}
+The ability to sequentially run entities is used to allow applications to fully deploy before attempting to start any test entities.
+
+If your application blueprint consists of multiple services then you will also require the `ParallelTestCase` entity.
+
+### ParallelTestCase
+The `ParallelTestCase` entity acts as a container for a list of child entities which are started in *parallel*.
+{% highlight yaml %}
+{% readj example_yaml/paralleltestcase-entity.yaml %}
+{% endhighlight %}
+This entity is used when your application blueprint consists of multiple services that run in parallel.
+
+
+## Validation Test Entities
+
+### TestSensor
+The `TestSensor` entity performs an assertion on a specified sensor.
+{% highlight yaml %}
+{% readj example_yaml/testsensor-entity.yaml %}
+{% endhighlight %}
+
+#### Parameters
+- `target` - entity whose sensor will be tested, specified via DSL. For example, `$brooklyn:component("tomcat")`. See also the `targetId` parameter.
+- `targetId` - alternative to the `target` parameter which wraps the DSL component lookup. For example, `tomcat`.
+- `sensor` - sensor to evaluate. For example `service.isUp`.
+- `timeout` - time to wait for assertion to return a result.
+- `assert` - assertion to perform on the specified sensor, options include
+  - `equals` - tests that the sensor equals the supplied value. For example `true`.
+  - `regex` - 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`.
+
+### TestEffector
+The `TestEffector` entity invokes the specified effector on a target entity.
+{% highlight yaml %}
+{% readj example_yaml/testeffector-entity.yaml %}
+{% endhighlight %}
+
+#### Parameters
+- `target` - entity whose effector will be invoked, specified via DSL. For example, `$brooklyn:component("tomcat")`. See also the `targetId` parameter.
+- `targetId` - alternative to the `target` parameter which wraps the DSL component lookup. For example, `tomcat`.
+- `timeout` - time to wait for the effector task to complete.
+- `effector` - effector to invoke, for example `deploy`.
+- `params` - parameters to pass to the effector, these will depend on the entity and effector being tested. The example above shows the `url` and `targetName` parameters being passed to Tomcats `deploy` effector.
+
+### TestHttpCall
+The `TestHttpCall` entity performs a HTTP GET on the specified URL and performs an assertion on the response.
+{% highlight yaml %}
+{% readj example_yaml/testhttpcall-entity.yaml %}
+{% endhighlight %}
+
+#### Parameters
+- `url` - URL to perform GET request on, for example `$brooklyn:component("tomcat").attributeWhenReady("webapp.url")``.
+- `timeout` - time to wait for a HTTP response. For example `10s`, `10m`, etc
+- `assertions` - perform one of the following assertions.
+  - `status` - response must match the specified status code. The example above shows an assertions on a `404` response.
+  - `bodyContains` - response body must contain the supplied string, for example `"hello world"`.
+  - `regex` - response body must match the supplied [regex pattern](http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html?is-external=true), for example `".*hello.*"`
+

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/cc25df3f/docs/guide/yaml/test/usage-examples.md
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/usage-examples.md b/docs/guide/yaml/test/usage-examples.md
new file mode 100644
index 0000000..38bdcb2
--- /dev/null
+++ b/docs/guide/yaml/test/usage-examples.md
@@ -0,0 +1,57 @@
+---
+title: Example Blueprint Tests
+title_in_menu: Example Tests
+layout: website-normal
+---
+
+{% include fields.md %}
+
+## Introduction
+This section provides example tests carried out on the following `simple-tomcat-app` web application catalog item:
+
+{% highlight yaml %}
+{% readj example_yaml/simple-tomcat-app.yaml %}
+{% endhighlight %}
+
+### Sensor Test Example
+
+This test catalog carries out the following test actions:
+
+- deploys the `sample-tomcat-app`
+- tests that the `service.isUp` sensor is `true` within 10 minutes of the `sample-tomcat-app` deployment completing.
+
+{% highlight yaml %}
+{% read example_yaml/simple-tomcat-app-sensor-test.yaml %}
+{% endhighlight %}
+
+### HTTP Call Test Example
+
+The following yaml snippet extends the sensor test above with a selection of HTTP Call tests:
+
+- application url returns a HTTP status code 200 within 60 seconds.
+- response body matches the regex `(?s).*Br[o]{2}klyn Deployed.*`. Note the presence of the `(?s)` dotall flag to test a multiline response.
+
+{% highlight yaml %}
+{% readj example_yaml/simple-tomcat-app-http-test-snippet.yaml %}
+{% endhighlight %}
+
+### Effector Test Example
+
+Extending the preceeding examples yet again, the following yaml snippet invokes the Tomcat entities `deploy` effector to deploy a new war file whose endpoint is subsequently tested:
+
+- `deploy` effector invoked to deploy war to a `newcontext`
+- `/newcontext` url returns a HTTP status code 200 within 5 minutes.
+
+{% highlight yaml %}
+{% readj example_yaml/simple-tomcat-app-effector-test-snippet.yaml %}
+{% endhighlight %}
+
+## Parallel Test example
+
+The preceeding examples had a single application entity which lends itself to running sequentially within a `TestCase` entity, if a Blueprint consists of multiple services then it is necessary to structure the test with multiple services starting under the `ParallelTestCase` entity.
+
+The following example tests the example multi-service application from the [Getting Started]({{ site.path.guide }}/start/blueprints.html#entitlements) section.
+
+{% highlight yaml %}
+{% readj example_yaml/paralleltestcase-example.yaml %}
+{% endhighlight %}
\ No newline at end of file


[5/5] incubator-brooklyn git commit: This closes #1031

Posted by he...@apache.org.
This closes #1031


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/4ebe7379
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/4ebe7379
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/4ebe7379

Branch: refs/heads/master
Commit: 4ebe7379b7ad2a461e2b61dfaa95aa6d8c2a0587
Parents: 35d7553 3eee2f7
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Mon Nov 23 18:53:31 2015 +0000
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Mon Nov 23 18:53:31 2015 +0000

----------------------------------------------------------------------
 docs/guide/start/_my-web-cluster.yaml           |   5 +-
 docs/guide/yaml/index.md                        |   1 +
 .../entities/paralleltestcase-entity.yaml       |   6 ++
 .../example_yaml/entities/testcase-entity.yaml  |   6 ++
 .../entities/testeffector-entity.yaml           |   8 ++
 .../entities/testhttpcall-entity.yaml           |   7 ++
 .../entities/testsensor-entity.yaml             |   7 ++
 .../testcases/effector-test-snippet.yaml        |  28 ++++++
 .../testcases/getting-started-test-example.yaml |  71 ++++++++++++++++
 .../testcases/http-test-snippet.yaml            |  20 +++++
 .../testcases/sensor-test-snippet.yaml          |   7 ++
 .../getting-started-blueprint-test-large.png    | Bin 0 -> 156553 bytes
 .../images/getting-started-blueprint-test.png   | Bin 0 -> 84906 bytes
 docs/guide/yaml/test/index.md                   |  24 ++++++
 docs/guide/yaml/test/test-entities.md           |  85 +++++++++++++++++++
 docs/guide/yaml/test/usage-examples.md          |  58 +++++++++++++
 16 files changed, 330 insertions(+), 3 deletions(-)
----------------------------------------------------------------------



[3/5] incubator-brooklyn git commit: Switched to running tests in parallel. Added `id` params to the getting started section yaml so that we can use it as the basis of an example test. Updated example yaml (and refactored dirs), adding timeouts where app

Posted by he...@apache.org.
Switched to running tests in parallel.
Added `id` params to the getting started section yaml so that we can use it as the basis of an example test.
Updated example yaml (and refactored dirs), adding timeouts where appropriate and using more consistent test entity names.
No longer wrapping tests in a catalog.


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/d559ddc4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/d559ddc4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/d559ddc4

Branch: refs/heads/master
Commit: d559ddc4946cf0ae3136abc4e68c5befdc5861c2
Parents: bd347a4
Author: John McCabe <jo...@johnmccabe.net>
Authored: Thu Nov 19 00:27:37 2015 +0000
Committer: John McCabe <jo...@johnmccabe.net>
Committed: Thu Nov 19 00:27:37 2015 +0000

----------------------------------------------------------------------
 docs/guide/start/_my-web-cluster.yaml           |   5 +-
 .../entities/paralleltestcase-entity.yaml       |   6 ++
 .../example_yaml/entities/testcase-entity.yaml  |   6 ++
 .../entities/testeffector-entity.yaml           |   8 +++
 .../entities/testhttpcall-entity.yaml           |   6 ++
 .../entities/testsensor-entity.yaml             |   7 ++
 .../example_yaml/paralleltestcase-entity.yaml   |   2 -
 .../example_yaml/paralleltestcase-example.yaml  |  46 -------------
 ...simple-tomcat-app-effector-test-snippet.yaml |  19 ------
 .../simple-tomcat-app-http-test-snippet.yaml    |  11 ---
 .../simple-tomcat-app-sensor-test.yaml          |  24 -------
 .../test/example_yaml/simple-tomcat-app.yaml    |  15 ----
 .../yaml/test/example_yaml/testcase-entity.yaml |   2 -
 .../testcases/effector-test-snippet.yaml        |  27 ++++++++
 .../testcases/getting-started-test-example.yaml |  68 +++++++++++++++++++
 .../testcases/http-test-snippet.yaml            |  18 +++++
 .../testcases/sensor-test-snippet.yaml          |   7 ++
 .../test/example_yaml/testeffector-entity.yaml  |   7 --
 .../test/example_yaml/testhttpcall-entity.yaml  |   5 --
 .../test/example_yaml/testsensor-entity.yaml    |   6 --
 .../getting-started-blueprint-test-large.png    | Bin 0 -> 156553 bytes
 .../images/getting-started-blueprint-test.png   | Bin 0 -> 84906 bytes
 docs/guide/yaml/test/index.md                   |   4 +-
 docs/guide/yaml/test/test-entities.md           |  48 +++++++------
 docs/guide/yaml/test/usage-examples.md          |  51 +++++++-------
 25 files changed, 211 insertions(+), 187 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d559ddc4/docs/guide/start/_my-web-cluster.yaml
----------------------------------------------------------------------
diff --git a/docs/guide/start/_my-web-cluster.yaml b/docs/guide/start/_my-web-cluster.yaml
index 29a4538..a3295b9 100644
--- a/docs/guide/start/_my-web-cluster.yaml
+++ b/docs/guide/start/_my-web-cluster.yaml
@@ -6,9 +6,9 @@ location:
     credential: s3cr3tsq1rr3ls3cr3tsq1rr3ls3cr3tsq1rr3l
 
 services:
-
 - type: org.apache.brooklyn.entity.webapp.ControlledDynamicWebAppCluster
   name: My Web
+  id: webappcluster
   brooklyn.config:
     wars.root: http://search.maven.org/remotecontent?filepath=io/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.6.0/brooklyn-example-hello-world-sql-webapp-0.6.0.war
     java.sysprops:
@@ -16,9 +16,8 @@ services:
         $brooklyn:formatString("jdbc:%s%s?user=%s&password=%s",
         component("db").attributeWhenReady("datastore.url"),
         "visitors", "brooklyn", "br00k11n")
-
 - type: org.apache.brooklyn.entity.database.mysql.MySqlNode
-  id: db
   name: My DB
+  id: db
   brooklyn.config:
     creationScriptUrl: https://bit.ly/brooklyn-visitors-creation-script
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d559ddc4/docs/guide/yaml/test/example_yaml/entities/paralleltestcase-entity.yaml
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/example_yaml/entities/paralleltestcase-entity.yaml b/docs/guide/yaml/test/example_yaml/entities/paralleltestcase-entity.yaml
new file mode 100644
index 0000000..ccd0c0b
--- /dev/null
+++ b/docs/guide/yaml/test/example_yaml/entities/paralleltestcase-entity.yaml
@@ -0,0 +1,6 @@
+- type: org.apache.brooklyn.test.framework.ParallelTestCase
+  brooklyn.children:
+  - type: org.apache.brooklyn.entity.database.mysql.MySqlNode
+    ...
+  - type: org.apache.brooklyn.entity.webapp.ControlledDynamicWebAppCluster
+    ...
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d559ddc4/docs/guide/yaml/test/example_yaml/entities/testcase-entity.yaml
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/example_yaml/entities/testcase-entity.yaml b/docs/guide/yaml/test/example_yaml/entities/testcase-entity.yaml
new file mode 100644
index 0000000..0e1aa00
--- /dev/null
+++ b/docs/guide/yaml/test/example_yaml/entities/testcase-entity.yaml
@@ -0,0 +1,6 @@
+- type: org.apache.brooklyn.test.framework.TestCase
+  brooklyn.children:
+  - type: org.apache.brooklyn.entity.database.mysql.MySqlNode
+    ...
+  - type: org.apache.brooklyn.test.framework.TestSensor
+    ...
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d559ddc4/docs/guide/yaml/test/example_yaml/entities/testeffector-entity.yaml
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/example_yaml/entities/testeffector-entity.yaml b/docs/guide/yaml/test/example_yaml/entities/testeffector-entity.yaml
new file mode 100644
index 0000000..d86fe54
--- /dev/null
+++ b/docs/guide/yaml/test/example_yaml/entities/testeffector-entity.yaml
@@ -0,0 +1,8 @@
+- type: org.apache.brooklyn.test.framework.TestEffector
+  name: Invoke Deploy Effector
+  target: $brooklyn:component("tomcat")
+  effector: deploy
+  timeout: 5m
+  params:
+    url: http://search.maven.org/remotecontent?filepath=io/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.6.0/brooklyn-example-hello-world-sql-webapp-0.6.0.war
+    targetName: newcontext
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d559ddc4/docs/guide/yaml/test/example_yaml/entities/testhttpcall-entity.yaml
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/example_yaml/entities/testhttpcall-entity.yaml b/docs/guide/yaml/test/example_yaml/entities/testhttpcall-entity.yaml
new file mode 100644
index 0000000..540b03f
--- /dev/null
+++ b/docs/guide/yaml/test/example_yaml/entities/testhttpcall-entity.yaml
@@ -0,0 +1,6 @@
+- type: org.apache.brooklyn.test.framework.TestHttpCall
+  name: Check HTTP Response Status Code
+  url: $brooklyn:component("tomcat").attributeWhenReady("webapp.url")
+  timeout: 60s
+  assert:
+    status: 200
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d559ddc4/docs/guide/yaml/test/example_yaml/entities/testsensor-entity.yaml
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/example_yaml/entities/testsensor-entity.yaml b/docs/guide/yaml/test/example_yaml/entities/testsensor-entity.yaml
new file mode 100644
index 0000000..dbee27a
--- /dev/null
+++ b/docs/guide/yaml/test/example_yaml/entities/testsensor-entity.yaml
@@ -0,0 +1,7 @@
+- type: org.apache.brooklyn.test.framework.TestSensor
+  name: Check tomcat isUp
+  target: $brooklyn:component("tomcat")
+  sensor: service.isUp
+  timeout: 10m
+  assert:
+    equals: true
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d559ddc4/docs/guide/yaml/test/example_yaml/paralleltestcase-entity.yaml
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/example_yaml/paralleltestcase-entity.yaml b/docs/guide/yaml/test/example_yaml/paralleltestcase-entity.yaml
deleted file mode 100644
index 1dca082..0000000
--- a/docs/guide/yaml/test/example_yaml/paralleltestcase-entity.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
-- type: org.apache.brooklyn.test.framework.ParallelTestCase
-  brooklyn.children:
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d559ddc4/docs/guide/yaml/test/example_yaml/paralleltestcase-example.yaml
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/example_yaml/paralleltestcase-example.yaml b/docs/guide/yaml/test/example_yaml/paralleltestcase-example.yaml
deleted file mode 100644
index c7f0f5b..0000000
--- a/docs/guide/yaml/test/example_yaml/paralleltestcase-example.yaml
+++ /dev/null
@@ -1,46 +0,0 @@
-brooklyn.catalog:
-  id: parallel-test
-  version: 1.0
-  itemType: template
-  iconUrl: http://tomcat.apache.org/images/tomcat.png
-  name: Parallel Tomcat and DB Example Test
-  license: Apache-2.0
-  item:
-    brooklyn.config:
-      simple.confg: someValue
-    services:
-    - type: org.apache.brooklyn.test.framework.TestCase
-      name: Parallel Testcase
-      brooklyn.children:
-      - type: org.apache.brooklyn.test.framework.TestCase
-        name: Parallel Testcase
-        brooklyn.children:
-        - type: org.apache.brooklyn.entity.webapp.ControlledDynamicWebAppCluster
-          name: My Web
-          id: webappcluster
-          brooklyn.config:
-            wars.root: http://search.maven.org/remotecontent?filepath=io/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.6.0/brooklyn-example-hello-world-sql-webapp-0.6.0.war
-            java.sysprops:
-              brooklyn.example.db.url: >
-                $brooklyn:formatString("jdbc:%s%s?user=%s&password=%s",
-                component("db").attributeWhenReady("datastore.url"),
-                "visitors", "brooklyn", "br00k11n")
-        - type: org.apache.brooklyn.entity.database.mysql.MySqlNode
-          id: db
-          name: My DB
-          brooklyn.config:
-            creationScriptUrl: https://bit.ly/brooklyn-visitors-creation-script
-      - type: org.apache.brooklyn.test.framework.TestSensor
-        name: Test WebApp Cluster service.isUp
-        targetId: webappcluster
-        sensor: service.isUp
-        timeout: 10m
-        assert:
-          equals: true
-      - type: org.apache.brooklyn.test.framework.TestSensor
-        name: Test DB service.isUp
-        targetId: db
-        sensor: service.isUp
-        timeout: 10m
-        assert:
-          equals: true
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d559ddc4/docs/guide/yaml/test/example_yaml/simple-tomcat-app-effector-test-snippet.yaml
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/example_yaml/simple-tomcat-app-effector-test-snippet.yaml b/docs/guide/yaml/test/example_yaml/simple-tomcat-app-effector-test-snippet.yaml
deleted file mode 100644
index a9ab85d..0000000
--- a/docs/guide/yaml/test/example_yaml/simple-tomcat-app-effector-test-snippet.yaml
+++ /dev/null
@@ -1,19 +0,0 @@
-- type: org.apache.brooklyn.test.framework.TestEffector
-  name: Deploy WAR in /newcontext
-  targetId: tomcat
-  effector: deploy
-  timeout:
-  params:
-    url: https://tomcat.apache.org/tomcat-6.0-doc/appdev/sample/sample.war
-    targetName: newcontext
-- type: org.apache.brooklyn.test.framework.TestHttpCall
-  name: /newcontext Status Code 200
-  url: $brooklyn:formatString("%s/newcontext/", component("tomcat").attributeWhenReady("webapp.url"))
-  timeout: 5m
-  assert:
-    status: 200
-
-
-
-
-

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d559ddc4/docs/guide/yaml/test/example_yaml/simple-tomcat-app-http-test-snippet.yaml
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/example_yaml/simple-tomcat-app-http-test-snippet.yaml b/docs/guide/yaml/test/example_yaml/simple-tomcat-app-http-test-snippet.yaml
deleted file mode 100644
index e967908..0000000
--- a/docs/guide/yaml/test/example_yaml/simple-tomcat-app-http-test-snippet.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
-- type: org.apache.brooklyn.test.framework.TestHttpCall
-  name: Status Code 200
-  url: $brooklyn:component("tomcat").attributeWhenReady("webapp.url")
-  timeout: 60s
-  assert:
-    status: 200
-- type: org.apache.brooklyn.test.framework.TestHttpCall
-  name: Regex match
-  url: $brooklyn:component("tomcat").attributeWhenReady("webapp.url")
-  assert:
-    regex: "(?s).*Br[o]{2}klyn Deployed.*"
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d559ddc4/docs/guide/yaml/test/example_yaml/simple-tomcat-app-sensor-test.yaml
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/example_yaml/simple-tomcat-app-sensor-test.yaml b/docs/guide/yaml/test/example_yaml/simple-tomcat-app-sensor-test.yaml
deleted file mode 100644
index 3e96ac3..0000000
--- a/docs/guide/yaml/test/example_yaml/simple-tomcat-app-sensor-test.yaml
+++ /dev/null
@@ -1,24 +0,0 @@
-brooklyn.catalog:
-  id: simple-tomcat-app-sensor-test
-  version: 1.0
-  itemType: template
-  iconUrl: http://tomcat.apache.org/images/tomcat.png
-  name: Simple Tomcat Application Sensor Test
-  license: Apache-2.0
-  item:
-    brooklyn.config:
-      simple.confg: someValue
-    services:
-    - type: org.apache.brooklyn.test.framework.TestCase
-      name: Simple Tomcat Sensor Test
-      brooklyn.children:
-      - type: simple-tomcat-app
-        name: Deploy Tomcat App
-        id: tomcat
-      - type: org.apache.brooklyn.test.framework.TestSensor
-        name: Test service.isUp
-        targetId: tomcat
-        sensor: service.isUp
-        timeout: 10m
-        assert:
-          equals: true
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d559ddc4/docs/guide/yaml/test/example_yaml/simple-tomcat-app.yaml
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/example_yaml/simple-tomcat-app.yaml b/docs/guide/yaml/test/example_yaml/simple-tomcat-app.yaml
deleted file mode 100644
index 7207478..0000000
--- a/docs/guide/yaml/test/example_yaml/simple-tomcat-app.yaml
+++ /dev/null
@@ -1,15 +0,0 @@
-brooklyn.catalog:
-  id: simple-tomcat-app
-  version: 1.0
-  itemType: template
-  iconUrl: http://tomcat.apache.org/images/tomcat.png
-  name: Simple Tomcat Application
-  license: Apache-2.0
-  item:
-    brooklyn.config:
-      simple.confg: someValue
-    services:
-    - type: org.apache.brooklyn.entity.webapp.tomcat.TomcatServer
-      id: tomcat
-      name: Tomcat
-      war: https://tomcat.apache.org/tomcat-6.0-doc/appdev/sample/sample.war
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d559ddc4/docs/guide/yaml/test/example_yaml/testcase-entity.yaml
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/example_yaml/testcase-entity.yaml b/docs/guide/yaml/test/example_yaml/testcase-entity.yaml
deleted file mode 100644
index c8a8bd8..0000000
--- a/docs/guide/yaml/test/example_yaml/testcase-entity.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
-- type: org.apache.brooklyn.test.framework.TestCase
-  brooklyn.children:
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d559ddc4/docs/guide/yaml/test/example_yaml/testcases/effector-test-snippet.yaml
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/example_yaml/testcases/effector-test-snippet.yaml b/docs/guide/yaml/test/example_yaml/testcases/effector-test-snippet.yaml
new file mode 100644
index 0000000..b19ff05
--- /dev/null
+++ b/docs/guide/yaml/test/example_yaml/testcases/effector-test-snippet.yaml
@@ -0,0 +1,27 @@
+- type: org.apache.brooklyn.test.framework.TestCase
+  name: Check Deploy Effector
+  brooklyn.children:
+  - type: org.apache.brooklyn.test.framework.TestSensor
+    name: Check webappcluster isUp
+    targetId: webappcluster
+    sensor: service.isUp
+    timeout: 10m
+    assert:
+      equals: true
+  - type: org.apache.brooklyn.test.framework.TestEffector
+    name: Invoke Deploy Effector
+    targetId: webappcluster
+    effector: deploy
+    timeout: 5m
+    params:
+      url: http://search.maven.org/remotecontent?filepath=io/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.6.0/brooklyn-example-hello-world-sql-webapp-0.6.0.war
+      targetName: newcontext
+  - type: org.apache.brooklyn.test.framework.TestHttpCall
+    name: Check Deployed Webapp Status Code
+    timeout: 5m
+    url: >
+      $brooklyn:formatString("http://%s:%s/newcontext/",
+      $brooklyn:component("webappcluster").attributeWhenReady("host.address"),
+      $brooklyn:component("webappcluster").attributeWhenReady("proxy.http.port"))
+    assert:
+      status: 200
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d559ddc4/docs/guide/yaml/test/example_yaml/testcases/getting-started-test-example.yaml
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/example_yaml/testcases/getting-started-test-example.yaml b/docs/guide/yaml/test/example_yaml/testcases/getting-started-test-example.yaml
new file mode 100644
index 0000000..9735ca9
--- /dev/null
+++ b/docs/guide/yaml/test/example_yaml/testcases/getting-started-test-example.yaml
@@ -0,0 +1,68 @@
+name: Getting Started Blueprint Test
+
+location:
+  jclouds:aws-ec2:
+    identity: ABCDEFGHIJKLMNOPQRST
+    credential: s3cr3tsq1rr3ls3cr3tsq1rr3ls3cr3tsq1rr3l
+
+services:
+- type: org.apache.brooklyn.entity.webapp.ControlledDynamicWebAppCluster
+  name: My Web
+  id: webappcluster
+  brooklyn.config:
+    wars.root: http://search.maven.org/remotecontent?filepath=io/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.6.0/brooklyn-example-hello-world-sql-webapp-0.6.0.war
+    java.sysprops:
+      brooklyn.example.db.url: >
+        $brooklyn:formatString("jdbc:%s%s?user=%s&password=%s",
+        component("db").attributeWhenReady("datastore.url"),
+        "visitors", "brooklyn", "br00k11n")
+- type: org.apache.brooklyn.entity.database.mysql.MySqlNode
+  id: db
+  name: My DB
+  brooklyn.config:
+    creationScriptUrl: https://bit.ly/brooklyn-visitors-creation-script
+- type: org.apache.brooklyn.test.framework.TestHttpCall
+  name: Check HTTP Response Status Code
+  url: >
+    $brooklyn:formatString("http://%s:%s",
+    $brooklyn:component("webappcluster").attributeWhenReady("host.address"),
+    $brooklyn:component("webappcluster").attributeWhenReady("proxy.http.port"))
+  timeout: 10m
+  assert:
+    status: 200
+- type: org.apache.brooklyn.test.framework.TestHttpCall
+  name: Check HTTP Response Body
+  url: >
+    $brooklyn:formatString("http://%s:%s",
+    $brooklyn:component("webappcluster").attributeWhenReady("host.address"),
+    $brooklyn:component("webappcluster").attributeWhenReady("proxy.http.port"))
+  timeout: 10m
+  assert:
+    regex: "(?s).*Br[o]{2}klyn Deployed.*"
+- type: org.apache.brooklyn.test.framework.TestCase
+  name: Check Deploy Effector
+  brooklyn.children:
+  - type: org.apache.brooklyn.test.framework.TestSensor
+    name: Check webappcluster isUp
+    targetId: webappcluster
+    sensor: service.isUp
+    timeout: 10m
+    assert:
+      equals: true
+  - type: org.apache.brooklyn.test.framework.TestEffector
+    name: Invoke Deploy Effector
+    targetId: webappcluster
+    effector: deploy
+    timeout: 5m
+    params:
+      url: http://search.maven.org/remotecontent?filepath=io/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.6.0/brooklyn-example-hello-world-sql-webapp-0.6.0.war
+      targetName: newcontext
+  - type: org.apache.brooklyn.test.framework.TestHttpCall
+    name: Check Deployed Webapp Status Code
+    timeout: 5m
+    url: >
+      $brooklyn:formatString("http://%s:%s/newcontext/",
+      $brooklyn:component("webappcluster").attributeWhenReady("host.address"),
+      $brooklyn:component("webappcluster").attributeWhenReady("proxy.http.port"))
+    assert:
+      status: 200
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d559ddc4/docs/guide/yaml/test/example_yaml/testcases/http-test-snippet.yaml
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/example_yaml/testcases/http-test-snippet.yaml b/docs/guide/yaml/test/example_yaml/testcases/http-test-snippet.yaml
new file mode 100644
index 0000000..9a52319
--- /dev/null
+++ b/docs/guide/yaml/test/example_yaml/testcases/http-test-snippet.yaml
@@ -0,0 +1,18 @@
+- type: org.apache.brooklyn.test.framework.TestHttpCall
+  name: Check HTTP Response Status Code
+  url: >
+    $brooklyn:formatString("http://%s:%s/newcontext/",
+    $brooklyn:component("webappcluster").attributeWhenReady("host.address"),
+    $brooklyn:component("webappcluster").attributeWhenReady("proxy.http.port"))
+  timeout: 10m
+  assert:
+    status: 200
+- type: org.apache.brooklyn.test.framework.TestHttpCall
+  name: Check HTTP Response Body
+  url: >
+    $brooklyn:formatString("http://%s:%s/newcontext/",
+    $brooklyn:component("webappcluster").attributeWhenReady("host.address"),
+    $brooklyn:component("webappcluster").attributeWhenReady("proxy.http.port"))
+  timeout: 10m
+  assert:
+    regex: "(?s).*Br[o]{2}klyn Deployed.*"
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d559ddc4/docs/guide/yaml/test/example_yaml/testcases/sensor-test-snippet.yaml
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/example_yaml/testcases/sensor-test-snippet.yaml b/docs/guide/yaml/test/example_yaml/testcases/sensor-test-snippet.yaml
new file mode 100644
index 0000000..2db4074
--- /dev/null
+++ b/docs/guide/yaml/test/example_yaml/testcases/sensor-test-snippet.yaml
@@ -0,0 +1,7 @@
+- type: org.apache.brooklyn.test.framework.TestSensor
+  name: Check webappcluster isUp
+  targetId: webappcluster
+  sensor: service.isUp
+  timeout: 10m
+  assert:
+    equals: true
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d559ddc4/docs/guide/yaml/test/example_yaml/testeffector-entity.yaml
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/example_yaml/testeffector-entity.yaml b/docs/guide/yaml/test/example_yaml/testeffector-entity.yaml
deleted file mode 100644
index 9ce74fa..0000000
--- a/docs/guide/yaml/test/example_yaml/testeffector-entity.yaml
+++ /dev/null
@@ -1,7 +0,0 @@
-- type: org.apache.brooklyn.test.framework.TestEffector
-  name: Deploy WAR in /newcontext
-  target: $brooklyn:component("tomcat")
-  effector: deploy
-  params:
-    url: http://search.maven.org/remotecontent?filepath=io/brooklyn/example/brooklyn-example-hello-world-sql-webapp/0.6.0/brooklyn-example-hello-world-sql-webapp-0.6.0.war
-    targetName: newcontext
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d559ddc4/docs/guide/yaml/test/example_yaml/testhttpcall-entity.yaml
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/example_yaml/testhttpcall-entity.yaml b/docs/guide/yaml/test/example_yaml/testhttpcall-entity.yaml
deleted file mode 100644
index 39742c1..0000000
--- a/docs/guide/yaml/test/example_yaml/testhttpcall-entity.yaml
+++ /dev/null
@@ -1,5 +0,0 @@
-  - type: org.apache.brooklyn.test.framework.TestHttpCall
-    name: /newcontext Status Code 404
-    url: $brooklyn:formatString("%s/newcontext/", component("tomcat").attributeWhenReady("webapp.url"))
-    assert:
-      status: 404
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d559ddc4/docs/guide/yaml/test/example_yaml/testsensor-entity.yaml
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/example_yaml/testsensor-entity.yaml b/docs/guide/yaml/test/example_yaml/testsensor-entity.yaml
deleted file mode 100644
index 00c3ff4..0000000
--- a/docs/guide/yaml/test/example_yaml/testsensor-entity.yaml
+++ /dev/null
@@ -1,6 +0,0 @@
-- type: org.apache.brooklyn.test.framework.TestSensor
-  target: $brooklyn:component("tomcat")
-  sensor: service.isUp
-  timeout: 10m
-  assert:
-    equals: true
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d559ddc4/docs/guide/yaml/test/images/getting-started-blueprint-test-large.png
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/images/getting-started-blueprint-test-large.png b/docs/guide/yaml/test/images/getting-started-blueprint-test-large.png
new file mode 100644
index 0000000..655e4f0
Binary files /dev/null and b/docs/guide/yaml/test/images/getting-started-blueprint-test-large.png differ

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d559ddc4/docs/guide/yaml/test/images/getting-started-blueprint-test.png
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/images/getting-started-blueprint-test.png b/docs/guide/yaml/test/images/getting-started-blueprint-test.png
new file mode 100644
index 0000000..09d23e8
Binary files /dev/null and b/docs/guide/yaml/test/images/getting-started-blueprint-test.png differ

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d559ddc4/docs/guide/yaml/test/index.md
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/index.md b/docs/guide/yaml/test/index.md
index 7df5c06..4666b8b 100644
--- a/docs/guide/yaml/test/index.md
+++ b/docs/guide/yaml/test/index.md
@@ -6,7 +6,7 @@ children:
 - usage-examples.md
 ---
 
-Brooklyn provides a selection of basic test entities which can be used to validate Blueprints via YAML. These are divided into two groups, structural, which effect the order in which child entities are started, and validation, which are used to confirm the application is deployed as intended:
+Brooklyn provides a selection of basic test entities which can be used to validate Blueprints via YAML. These are divided into two groups; structural, which effect the order in which child entities are started; and validation, which are used to confirm the application is deployed as intended.
 
 Structural test entities include:
 
@@ -17,7 +17,7 @@ Validation test entities include:
 
 - `TestSensor` - perform assertion on a specified sensor.
 - `TestEffector` - invoke effector on specified target entity.
-- `TestHttpCall` - perform assertions on response to specified HTTP GET Request.
+- `TestHttpCall` - perform assertion on response to specified HTTP GET Request.
 
 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/d559ddc4/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 6ab454f..6e992e4 100644
--- a/docs/guide/yaml/test/test-entities.md
+++ b/docs/guide/yaml/test/test-entities.md
@@ -9,64 +9,72 @@ layout: website-normal
 ## Structural Test Entities
 
 ### TestCase
-The `TestCase` entity acts as a container for a list child entities which are started *sequentially*.
+The `TestCase` entity acts as a container for a list of child entities which are started *sequentially*.
+
 {% highlight yaml %}
-{% readj example_yaml/testcase-entity.yaml %}
+{% readj example_yaml/entities/testcase-entity.yaml %}
 {% endhighlight %}
-The ability to sequentially run entities is used to allow applications to fully deploy before attempting to start any test entities.
 
-If your application blueprint consists of multiple services then you will also require the `ParallelTestCase` entity.
+This can be used to enforce a strict ordering, for example ensuring a sensor has a certain value before attempting to invoke an effector.
+
+Timeouts on child entities should be set relative to the completion of the preceding entity.
+
+The `ParallelTestCase` entity can be added as a child to run a subset of entities in parallel as a single step.
 
 ### ParallelTestCase
 The `ParallelTestCase` entity acts as a container for a list of child entities which are started in *parallel*.
+
 {% highlight yaml %}
-{% readj example_yaml/paralleltestcase-entity.yaml %}
+{% readj example_yaml/entities/paralleltestcase-entity.yaml %}
 {% endhighlight %}
-This entity is used when your application blueprint consists of multiple services that run in parallel.
 
+This can be used to run a subset of entities in parallel as a single step when nested under a `TestCase` entity.
+
+Timeouts on child entities should be set relative to the start of the `ParallelTestCase`.
 
 ## Validation Test Entities
 
 ### TestSensor
-The `TestSensor` entity performs an assertion on a specified sensor.
+The `TestSensor` entity performs an assertion on a specified sensors value.
+
 {% highlight yaml %}
-{% readj example_yaml/testsensor-entity.yaml %}
+{% readj example_yaml/entities/testsensor-entity.yaml %}
 {% endhighlight %}
 
 #### Parameters
 - `target` - entity whose sensor will be tested, specified via DSL. For example, `$brooklyn:component("tomcat")`. See also the `targetId` parameter.
-- `targetId` - alternative to the `target` parameter which wraps the DSL component lookup. For example, `tomcat`.
+- `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` - time to wait for assertion to return a result.
-- `assert` - assertion to perform on the specified sensor, options include
-  - `equals` - tests that the sensor equals the supplied value. For example `true`.
+- `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` - tests that the sensor value equals the supplied value. For example `true`.
   - `regex` - 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`.
 
 ### TestEffector
 The `TestEffector` entity invokes the specified effector on a target entity.
 {% highlight yaml %}
-{% readj example_yaml/testeffector-entity.yaml %}
+{% readj example_yaml/entities/testeffector-entity.yaml %}
 {% endhighlight %}
 
 #### Parameters
 - `target` - entity whose effector will be invoked, specified via DSL. For example, `$brooklyn:component("tomcat")`. See also the `targetId` parameter.
-- `targetId` - alternative to the `target` parameter which wraps the DSL component lookup. For example, `tomcat`.
-- `timeout` - time to wait for the effector task to complete.
+- `targetId` - alternative to the `target` parameter which wraps the DSL component lookup requiring only the `id` be supplied. For example, `tomcat`.
+- `timeout` - duration to wait on the effector task to complete. For example `10s`, `10m`, etc
 - `effector` - effector to invoke, for example `deploy`.
 - `params` - parameters to pass to the effector, these will depend on the entity and effector being tested. The example above shows the `url` and `targetName` parameters being passed to Tomcats `deploy` effector.
 
 ### TestHttpCall
 The `TestHttpCall` entity performs a HTTP GET on the specified URL and performs an assertion on the response.
 {% highlight yaml %}
-{% readj example_yaml/testhttpcall-entity.yaml %}
+{% readj example_yaml/entities/testhttpcall-entity.yaml %}
 {% endhighlight %}
 
 #### Parameters
-- `url` - URL to perform GET request on, for example `$brooklyn:component("tomcat").attributeWhenReady("webapp.url")``.
-- `timeout` - time to wait for a HTTP response. For example `10s`, `10m`, etc
-- `assertions` - perform one of the following assertions.
-  - `status` - response must match the specified status code. The example above shows an assertions on a `404` response.
+- `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
+- `assert` - assertion to perform on the response, options include:
+  - `status` - response must match the specified status code, for example `200`.
   - `bodyContains` - response body must contain the supplied string, for example `"hello world"`.
   - `regex` - response body must match the supplied [regex pattern](http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html?is-external=true), for example `".*hello.*"`
 

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d559ddc4/docs/guide/yaml/test/usage-examples.md
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/usage-examples.md b/docs/guide/yaml/test/usage-examples.md
index 38bdcb2..086d1fb 100644
--- a/docs/guide/yaml/test/usage-examples.md
+++ b/docs/guide/yaml/test/usage-examples.md
@@ -7,51 +7,52 @@ layout: website-normal
 {% include fields.md %}
 
 ## Introduction
-This section provides example tests carried out on the following `simple-tomcat-app` web application catalog item:
+This section describes some simple tests based on the [Getting Started](../../start/blueprints.html#launching-from-a-blueprint) example blueprint:
 
 {% highlight yaml %}
-{% readj example_yaml/simple-tomcat-app.yaml %}
+{% readj ../../start/_my-web-cluster.yaml %}
 {% endhighlight %}
 
-### Sensor Test Example
+The following sections contain yaml snippets that be appended to the list of services in the blueprint above, a complete blueprint is also provided [below](#full-example).
 
-This test catalog carries out the following test actions:
+Note that unless otherwise specified the following tests are executed in parallel with the deployment of the application services, all `timeout` values are set accordingly.
 
-- deploys the `sample-tomcat-app`
-- tests that the `service.isUp` sensor is `true` within 10 minutes of the `sample-tomcat-app` deployment completing.
+### Sensor Test
+
+Demonstrates the following sensor assertion:
+
+- asserts that the `webappcluster` entity `service.isUp` sensor is `true` within 10 minutes of blueprint being deployed.
 
 {% highlight yaml %}
-{% read example_yaml/simple-tomcat-app-sensor-test.yaml %}
+{% read example_yaml/testcases/sensor-test-snippet.yaml %}
 {% endhighlight %}
 
-### HTTP Call Test Example
-
-The following yaml snippet extends the sensor test above with a selection of HTTP Call tests:
+### 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):
 
-- application url returns a HTTP status code 200 within 60 seconds.
-- response body matches the regex `(?s).*Br[o]{2}klyn Deployed.*`. Note the presence of the `(?s)` dotall flag to test a multiline response.
+- 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/simple-tomcat-app-http-test-snippet.yaml %}
+{% readj example_yaml/testcases/http-test-snippet.yaml %}
 {% endhighlight %}
 
-### Effector Test Example
+### Effector Test (via TestCase entity)
 
-Extending the preceeding examples yet again, the following yaml snippet invokes the Tomcat entities `deploy` effector to deploy a new war file whose endpoint is subsequently tested:
+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.
 
-- `deploy` effector invoked to deploy war to a `newcontext`
-- `/newcontext` url returns a HTTP status code 200 within 5 minutes.
+- `TestCase` entity starts its children sequentially
+  - asserts that the `webappcluster` entity `service.isUp` sensor is `true` within 10 minutes of the parent `TestCase` entity starting. Blocks start of the next child until it obtains a result (or times out).
+  - `deploy` effector invoked to deploy war to a `newcontext` with a 5 minute timeout to allow completion of the deploy task.
+  - asserts `/newcontext` url returns a HTTP status code 200 within 5 minutes of the effector being invoked (Note that this timeout is relative to the preceding test entity as they are being sequentially run as children of a `TestCase` entity).
 
 {% highlight yaml %}
-{% readj example_yaml/simple-tomcat-app-effector-test-snippet.yaml %}
+{% readj example_yaml/testcases/effector-test-snippet.yaml %}
 {% endhighlight %}
 
-## Parallel Test example
+### Full Example
+A sample blueprint containing all the tests described above is available [here](./example_yaml/testcases/getting-started-test-example.yaml).
 
-The preceeding examples had a single application entity which lends itself to running sequentially within a `TestCase` entity, if a Blueprint consists of multiple services then it is necessary to structure the test with multiple services starting under the `ParallelTestCase` entity.
+This blueprint will deploy the [Getting Started](../../start/blueprints.html#launching-from-a-blueprint) application and run all of the test entities, which if successful should appear in the web console as follows.
 
-The following example tests the example multi-service application from the [Getting Started]({{ site.path.guide }}/start/blueprints.html#entitlements) section.
-
-{% highlight yaml %}
-{% readj example_yaml/paralleltestcase-example.yaml %}
-{% endhighlight %}
\ No newline at end of file
+[![Successful Getting Started App deployment and Test execution.](images/getting-started-blueprint-test.png)](images/getting-started-blueprint-test-large.png)



[2/5] incubator-brooklyn git commit: typo

Posted by he...@apache.org.
typo


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/bd347a4b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/bd347a4b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/bd347a4b

Branch: refs/heads/master
Commit: bd347a4b2b4c59a186c2bc724162e1314d44bc38
Parents: cc25df3
Author: John McCabe <jo...@johnmccabe.net>
Authored: Fri Nov 13 17:06:32 2015 +0000
Committer: John McCabe <jo...@johnmccabe.net>
Committed: Fri Nov 13 17:06:32 2015 +0000

----------------------------------------------------------------------
 docs/guide/yaml/test/index.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/bd347a4b/docs/guide/yaml/test/index.md
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/index.md b/docs/guide/yaml/test/index.md
index 804b055..7df5c06 100644
--- a/docs/guide/yaml/test/index.md
+++ b/docs/guide/yaml/test/index.md
@@ -6,7 +6,7 @@ children:
 - usage-examples.md
 ---
 
-Brooklyn provides a selection of basic test entities which can be used to validate Blueprints via YAML. These are divided into two groups structural, which effect the order in which child entities are started, and validation, which are used to confirm the application is deployed as intended:
+Brooklyn provides a selection of basic test entities which can be used to validate Blueprints via YAML. These are divided into two groups, structural, which effect the order in which child entities are started, and validation, which are used to confirm the application is deployed as intended:
 
 Structural test entities include:
 


[4/5] incubator-brooklyn git commit: Updates to Test[Sensor, HttpCall] due to assertion changes in #1049

Posted by he...@apache.org.
Updates to Test[Sensor,HttpCall] due to assertion changes in #1049


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/3eee2f76
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/3eee2f76
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/3eee2f76

Branch: refs/heads/master
Commit: 3eee2f76e4ca2db040b5e27dc61341a1fc4f8b1e
Parents: d559ddc
Author: Mark McKenna <m4...@gmail.com>
Authored: Mon Nov 23 12:32:09 2015 +0000
Committer: Mark McKenna <m4...@gmail.com>
Committed: Mon Nov 23 12:32:09 2015 +0000

----------------------------------------------------------------------
 .../example_yaml/entities/testhttpcall-entity.yaml   |  3 ++-
 .../example_yaml/entities/testsensor-entity.yaml     |  2 +-
 .../testcases/effector-test-snippet.yaml             |  5 +++--
 .../testcases/getting-started-test-example.yaml      | 11 +++++++----
 .../example_yaml/testcases/http-test-snippet.yaml    |  6 ++++--
 .../example_yaml/testcases/sensor-test-snippet.yaml  |  2 +-
 docs/guide/yaml/test/test-entities.md                | 15 ++++++++++-----
 7 files changed, 28 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/3eee2f76/docs/guide/yaml/test/example_yaml/entities/testhttpcall-entity.yaml
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/example_yaml/entities/testhttpcall-entity.yaml b/docs/guide/yaml/test/example_yaml/entities/testhttpcall-entity.yaml
index 540b03f..bdb3347 100644
--- a/docs/guide/yaml/test/example_yaml/entities/testhttpcall-entity.yaml
+++ b/docs/guide/yaml/test/example_yaml/entities/testhttpcall-entity.yaml
@@ -2,5 +2,6 @@
   name: Check HTTP Response Status Code
   url: $brooklyn:component("tomcat").attributeWhenReady("webapp.url")
   timeout: 60s
+  applyAssertionTo: status
   assert:
-    status: 200
\ No newline at end of file
+  - isEqualTo: 200
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/3eee2f76/docs/guide/yaml/test/example_yaml/entities/testsensor-entity.yaml
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/example_yaml/entities/testsensor-entity.yaml b/docs/guide/yaml/test/example_yaml/entities/testsensor-entity.yaml
index dbee27a..e781d0d 100644
--- a/docs/guide/yaml/test/example_yaml/entities/testsensor-entity.yaml
+++ b/docs/guide/yaml/test/example_yaml/entities/testsensor-entity.yaml
@@ -4,4 +4,4 @@
   sensor: service.isUp
   timeout: 10m
   assert:
-    equals: true
\ No newline at end of file
+  - equals: true
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/3eee2f76/docs/guide/yaml/test/example_yaml/testcases/effector-test-snippet.yaml
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/example_yaml/testcases/effector-test-snippet.yaml b/docs/guide/yaml/test/example_yaml/testcases/effector-test-snippet.yaml
index b19ff05..469b54b 100644
--- a/docs/guide/yaml/test/example_yaml/testcases/effector-test-snippet.yaml
+++ b/docs/guide/yaml/test/example_yaml/testcases/effector-test-snippet.yaml
@@ -7,7 +7,7 @@
     sensor: service.isUp
     timeout: 10m
     assert:
-      equals: true
+    - equals: true
   - type: org.apache.brooklyn.test.framework.TestEffector
     name: Invoke Deploy Effector
     targetId: webappcluster
@@ -23,5 +23,6 @@
       $brooklyn:formatString("http://%s:%s/newcontext/",
       $brooklyn:component("webappcluster").attributeWhenReady("host.address"),
       $brooklyn:component("webappcluster").attributeWhenReady("proxy.http.port"))
+    applyAssertionTo: status
     assert:
-      status: 200
\ No newline at end of file
+    - isEqualTo: 200
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/3eee2f76/docs/guide/yaml/test/example_yaml/testcases/getting-started-test-example.yaml
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/example_yaml/testcases/getting-started-test-example.yaml b/docs/guide/yaml/test/example_yaml/testcases/getting-started-test-example.yaml
index 9735ca9..25296e6 100644
--- a/docs/guide/yaml/test/example_yaml/testcases/getting-started-test-example.yaml
+++ b/docs/guide/yaml/test/example_yaml/testcases/getting-started-test-example.yaml
@@ -28,8 +28,9 @@ services:
     $brooklyn:component("webappcluster").attributeWhenReady("host.address"),
     $brooklyn:component("webappcluster").attributeWhenReady("proxy.http.port"))
   timeout: 10m
+  applyAssertionTo: status
   assert:
-    status: 200
+  - isEqualTo: 200
 - type: org.apache.brooklyn.test.framework.TestHttpCall
   name: Check HTTP Response Body
   url: >
@@ -37,8 +38,9 @@ services:
     $brooklyn:component("webappcluster").attributeWhenReady("host.address"),
     $brooklyn:component("webappcluster").attributeWhenReady("proxy.http.port"))
   timeout: 10m
+  applyAssertionTo: body
   assert:
-    regex: "(?s).*Br[o]{2}klyn Deployed.*"
+  - matches: "(?s).*Br[o]{2}klyn Deployed.*"
 - type: org.apache.brooklyn.test.framework.TestCase
   name: Check Deploy Effector
   brooklyn.children:
@@ -48,7 +50,7 @@ services:
     sensor: service.isUp
     timeout: 10m
     assert:
-      equals: true
+    - equals: true
   - type: org.apache.brooklyn.test.framework.TestEffector
     name: Invoke Deploy Effector
     targetId: webappcluster
@@ -64,5 +66,6 @@ services:
       $brooklyn:formatString("http://%s:%s/newcontext/",
       $brooklyn:component("webappcluster").attributeWhenReady("host.address"),
       $brooklyn:component("webappcluster").attributeWhenReady("proxy.http.port"))
+    applyAssertionTo: status
     assert:
-      status: 200
\ No newline at end of file
+    - isEqualTo: 200
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/3eee2f76/docs/guide/yaml/test/example_yaml/testcases/http-test-snippet.yaml
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/example_yaml/testcases/http-test-snippet.yaml b/docs/guide/yaml/test/example_yaml/testcases/http-test-snippet.yaml
index 9a52319..0a7a953 100644
--- a/docs/guide/yaml/test/example_yaml/testcases/http-test-snippet.yaml
+++ b/docs/guide/yaml/test/example_yaml/testcases/http-test-snippet.yaml
@@ -5,8 +5,9 @@
     $brooklyn:component("webappcluster").attributeWhenReady("host.address"),
     $brooklyn:component("webappcluster").attributeWhenReady("proxy.http.port"))
   timeout: 10m
+  applyAssertionTo: status
   assert:
-    status: 200
+  - equals: 200
 - type: org.apache.brooklyn.test.framework.TestHttpCall
   name: Check HTTP Response Body
   url: >
@@ -14,5 +15,6 @@
     $brooklyn:component("webappcluster").attributeWhenReady("host.address"),
     $brooklyn:component("webappcluster").attributeWhenReady("proxy.http.port"))
   timeout: 10m
+  applyAssertionTo: body
   assert:
-    regex: "(?s).*Br[o]{2}klyn Deployed.*"
\ No newline at end of file
+  - matches: "(?s).*Br[o]{2}klyn Deployed.*"
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/3eee2f76/docs/guide/yaml/test/example_yaml/testcases/sensor-test-snippet.yaml
----------------------------------------------------------------------
diff --git a/docs/guide/yaml/test/example_yaml/testcases/sensor-test-snippet.yaml b/docs/guide/yaml/test/example_yaml/testcases/sensor-test-snippet.yaml
index 2db4074..da58cd1 100644
--- a/docs/guide/yaml/test/example_yaml/testcases/sensor-test-snippet.yaml
+++ b/docs/guide/yaml/test/example_yaml/testcases/sensor-test-snippet.yaml
@@ -4,4 +4,4 @@
   sensor: service.isUp
   timeout: 10m
   assert:
-    equals: true
\ No newline at end of file
+  - equals: true
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/3eee2f76/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 6e992e4..73eb398 100644
--- a/docs/guide/yaml/test/test-entities.md
+++ b/docs/guide/yaml/test/test-entities.md
@@ -47,9 +47,11 @@ The `TestSensor` entity performs an assertion on a specified sensors value.
 - `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` - tests that the sensor value equals the supplied value. For example `true`.
-  - `regex` - 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.*"`.
+  - `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`.
 
 ### TestEffector
 The `TestEffector` entity invokes the specified effector on a target entity.
@@ -73,8 +75,11 @@ The `TestHttpCall` entity performs a HTTP GET on the specified URL and performs
 #### Parameters
 - `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:
-  - `status` - response must match the specified status code, for example `200`.
-  - `bodyContains` - response body must contain the supplied string, for example `"hello world"`.
-  - `regex` - response body must match the supplied [regex pattern](http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html?is-external=true), for example `".*hello.*"`
+  - `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`.