You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Stefan Seifert (JIRA)" <ji...@apache.org> on 2017/06/28 12:35:00 UTC

[jira] [Resolved] (SLING-6986) The ResourceResolver mock does not test the resource type hierarchy in isResourceType

     [ https://issues.apache.org/jira/browse/SLING-6986?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stefan Seifert resolved SLING-6986.
-----------------------------------
    Resolution: Fixed

Completed: At revision: 1800153  

thanks for reporting - i've fixed the problem.
the path you proposed was not quite correct - it introduced logic that is not part of the real resource resolver implementation (checking properties like jcr:primaryType), and did not take into account that you may have inheritance chains with multiple resources using sling:resourceSuperType.

the code i've introduced is taken from the reals resource resolver implementation.

> 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)