[
https://issues.apache.org/jira/browse/SLING-5508?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15142495#comment-15142495
]
Konrad Windszus commented on SLING-5508:
----------------------------------------
[~rombert] Thanks for your feedback. Actually I picked the names
{{hasChildren}} and {{containsChildren}} and {{containsChildrenInAnyOrder}}
because they are semantically very similar to the following methods being
shipped with Hamcrest:
# {{Matchers.hasItems}}
(http://hamcrest.org/JavaHamcrest/javadoc/1.3/org/hamcrest/Matchers.html#hasItems%28T...%29)
# {{Matchers.contains}}
(http://hamcrest.org/JavaHamcrest/javadoc/1.3/org/hamcrest/Matchers.html#contains%28E...%29)
and
# {{Matchers.containsInAnyOrder}}
(http://hamcrest.org/JavaHamcrest/javadoc/1.3/org/hamcrest/Matchers.html#containsInAnyOrder%28T...%29)
Not that I particularly like the naming from hamcrest (I actually have to look
up the semantics everytime in the javadoc), but in this case consistency is
worth more than clarity IMHO. WDYT?
> Provide additional Hamcrest matchers
> ------------------------------------
>
> Key: SLING-5508
> URL: https://issues.apache.org/jira/browse/SLING-5508
> Project: Sling
> Issue Type: Improvement
> Components: Testing
> Affects Versions: Apache Sling Testing Hamcrest 1.0.0
> Reporter: Konrad Windszus
> Assignee: Konrad Windszus
> Fix For: Apache Sling Testing Hamcrest 1.0.0
>
>
> Currently the Hamcrest matchers provided in SLING-5063 only can match for
> some of the child names. An exact match is missing. Desired would be methods
> like
> # {{ResourceMatchers.containsChildren}}
> # {{ResourceMatchers.containsChildrenInAnyOrder}}
> similar to {{Matcher.contains}} and {{Matchers.containsInAnyOrder}}
> In addition it would be good to have a matcher on just a single resource for
> a given name like {{ResourceMatchers.resourceWithName}} and also a
> combination of the name matcher with the property matcher
> ({{ResourceMatchers.resourceWithNameAndProps}})
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)