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 <[email protected]>
Authored: Thu Nov 19 00:27:37 2015 +0000
Committer: John McCabe <[email protected]>
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)


Reply via email to