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

[jira] [Commented] (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:comment-tabpanel&focusedCommentId=16065724#comment-16065724 ] 

ASF GitHub Bot commented on SLING-6986:
---------------------------------------

GitHub user ramboz opened a pull request:

    https://github.com/apache/sling/pull/245

    SLING-6986 - The ResourceResolver mock does not test the resource type hierarchy in isResourceType

    Create a simple improvement, where we check:
    - the `sling:resourceType` property on the resource
    - then fallback to the `sling:resourceSuperType` property
    - then fallback to the `jcr:primaryType` property
    
    Also adding a unit test for it.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/ramboz/sling SLING-6986

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/sling/pull/245.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #245
    
----
commit daaa3791647314645d6c535cd23eadb961a74387
Author: Julien Ramboz <ra...@adobe.com>
Date:   2017-06-28T00:30:35Z

    SLING-6986 - The ResourceResolver mock does not test the resource type hierarchy in isResourceType

----


> 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
>            Priority: Minor
>
> 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)