[
https://issues.apache.org/jira/browse/SLING-6986?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16067118#comment-16067118
]
Stefan Seifert commented on SLING-6986:
---------------------------------------
according to the link:
resource type = The value of the sling:resourceType property *or* the primary
node type *if the property is not set*
that means the jcr:primaryType is only a fallback if a resource has no resource
type set, they can be never both be true.
this behavior should already work, because the MockResource.getResourceType of
resourceresolver-mock method already does a fallback to jcr:primaryType if the
resource type is not set.
> The ResourceResolver mock does not test the resource type hierarchy in
> isResourceType
> -------------------------------------------------------------------------------------
>
> Key: SLING-6986
> URL: https://issues.apache.org/jira/browse/SLING-6986
> Project: Sling
> Issue Type: Bug
> Components: Testing
> Affects Versions: Testing ResourceResolver Mock 1.1.18
> Reporter: Julien Ramboz
> Assignee: Stefan Seifert
> Priority: Minor
> Fix For: Testing ResourceResolver Mock 1.1.20
>
>
> The mock resource resolver is only plainly checking the resource type on the
> resource, and not following the type hierarchy.
> So assuming we have a resource of the form:
> myResource
> - jcr:primaryType="unstructured"
> - sling:resourceType="foo/bar"
> mockResourceResolver.isResourceType(myResource, "foo/bar") => true
> mockResourceResolver.isResourceType(myResource, "nt:unstructured") => false
> Without implementing the whole type hierarchy, we could at least improve this
> by checking:
> - the "sling:resourceType"
> - the "sling:resourceSuperType"
> - the "jcr:primaryType"
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)