Update the tests documentation to explicitly say that the target can be omitted if wrapped into a TestCase that already defines the target
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/commit/505c36c1 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/tree/505c36c1 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/diff/505c36c1 Branch: refs/heads/0.9.0 Commit: 505c36c122cf20391ef3b60a3f1f1e14ac5e0598 Parents: ec9aced Author: Thomas Bouron <[email protected]> Authored: Fri May 6 10:23:09 2016 +0100 Committer: Alex Heneveld <[email protected]> Committed: Fri May 13 12:58:54 2016 +0100 ---------------------------------------------------------------------- guide/yaml/test/test-entities.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/505c36c1/guide/yaml/test/test-entities.md ---------------------------------------------------------------------- diff --git a/guide/yaml/test/test-entities.md b/guide/yaml/test/test-entities.md index a81a3d6..b8b3f2b 100644 --- a/guide/yaml/test/test-entities.md +++ b/guide/yaml/test/test-entities.md @@ -75,6 +75,10 @@ The `TestSensor` entity performs an assertion on a specified sensors value. - `timeout` - duration to wait on assertion to return a result. For example `10s`, `10m`, etc - `assert` - assertion to perform on the specified sensor value. See section on assertions below. +<div class="alert alert-info"> + <strong>Tip:</strong> If the <code>TestSensor</code> is wrapped within a <code>TestCase</code>, <code>ParallelTestCase</code> or <code>LoopOverGroupMembersTestCase</code> that set the target, <strong>you don't need to specify the target</strong>, unless you want to test another entity. +</div> + ### TestEffector The `TestEffector` entity invokes the specified effector on a target entity. If the result of the effector is a String, it will then perform assertions on the result. {% highlight yaml %} @@ -89,6 +93,10 @@ The `TestEffector` entity invokes the specified effector on a target entity. If - `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. - `assert` - assertion to perform on the returned result. See section on assertions below. +<div class="alert alert-info"> + <strong>Tip:</strong> If the <code>TestEffector</code> is wrapped within a <code>TestCase</code>, <code>ParallelTestCase</code> or <code>LoopOverGroupMembersTestCase</code> that set the target, <strong>you don't need to specify the target</strong>, unless you want to test another entity. +</div> + ### TestHttpCall The `TestHttpCall` entity performs a HTTP GET on the specified URL and performs an assertion on the response. {% highlight yaml %} @@ -101,8 +109,11 @@ The `TestHttpCall` entity performs a HTTP GET on the specified URL and performs - `applyAssertionTo` - The filed to apply the assertion to. For example `status`, `body` - `assert` - assertion to perform on the response. See section on assertions below. -### SimpleShellCommandTest +<div class="alert alert-info"> + <strong>Tip:</strong> If the <code>TestHttpCall</code> is wrapped within a <code>TestCase</code>, <code>ParallelTestCase</code> or <code>LoopOverGroupMembersTestCase</code> that set the target, <strong>you don't need to specify the target</strong>, unless you want to test another entity. +</div> +### SimpleShellCommandTest The SimpleShellCommandTest runs a command on the host of the target entity. The script is expected not to run indefinitely, but to return a result (process exit code), along with its standard out and error streams, which can then be tested using assertions. @@ -123,6 +134,10 @@ Either a shell command may be provided in the YAML, or a URL for a script which - `assertOut` - Assertions on the standard output of the command as a String. - `assertErr` - Assertions on the standard error of the command as a String. +<div class="alert alert-info"> + <strong>Tip:</strong> If the <code>SimpleShellCommandTest</code> is wrapped within a <code>TestCase</code>, <code>ParallelTestCase</code> or <code>LoopOverGroupMembersTestCase</code> that set the target, <strong>you don't need to specify the target</strong>, unless you want to test another entity. +</div> + ## Assertions The following conditions are provided by those test entities above that include assertions
