Repository: brooklyn-docs Updated Branches: refs/heads/master 57746af03 -> 8c15d3207
Improve test-entities matcher docs, for regex See discussion in https://github.com/apache/brooklyn-server/pull/589 Project: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/commit/62a86ce1 Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/tree/62a86ce1 Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-docs/diff/62a86ce1 Branch: refs/heads/master Commit: 62a86ce178bfc14fc6a4c6df19134c252b743115 Parents: 57746af Author: Aled Sage <[email protected]> Authored: Mon Apr 10 16:11:21 2017 +0100 Committer: Aled Sage <[email protected]> Committed: Mon Apr 10 16:31:48 2017 +0100 ---------------------------------------------------------------------- guide/yaml/test/test-entities.md | 7 +++++++ 1 file changed, 7 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/brooklyn-docs/blob/62a86ce1/guide/yaml/test/test-entities.md ---------------------------------------------------------------------- diff --git a/guide/yaml/test/test-entities.md b/guide/yaml/test/test-entities.md index 4187c35..37604a1 100644 --- a/guide/yaml/test/test-entities.md +++ b/guide/yaml/test/test-entities.md @@ -165,6 +165,13 @@ The following conditions are provided by those test entities above that include - `equals` - a synonym for `isEqualTo` - `notEqual` - asserts that the actual value does not equal the expected value. - `matches` - asserts that the actual value matches a [regex pattern](http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html?is-external=true), for example `".*hello.*"`. + Note that regular expressions follow the Java defaults, e.g. for [line terminators](http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html#lt). + One can use `"(?m)"` for multi-line mode (so that `^` and `$` also match just after/before line terminators, + rather than just the start/end of the entire input sequence). The dotall mode, set with `"(?s)"`, can also + be useful (so that `.` matches any character, including line terminators). +- `containsMatch` - asserts that the value contains a string that matches a regex. It follow the behaviour of + the [Matcher.find() method](http://docs.oracle.com/javase/7/docs/api/java/util/regex/Matcher.html#find()). + This can be useful for simplifying matching in multi-line input. - `contains` - asserts that the actual value contains the supplied value - `isEmpty` - asserts that the actual value is an empty string - `notEmpty` - asserts that the actual value is a non empty string
