[
https://issues.apache.org/jira/browse/SLING-4773?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14574142#comment-14574142
]
Konrad Windszus commented on SLING-4773:
----------------------------------------
Actually it works if I use the {{resourceResolver}} being returned by the
{{SlingContext}} object (that one does have the necessary sling namespace).
Unfortunately I cannot use that in Sling Validation because I need access to
the {{ResourceResolver}} which is not exposed via the {{SlingContext}}.
Therefore I would propose the following 2 enhancements:
# expose the {{ResourceResolverFactory}} via the {{SlingContext}}
# by default register the Sling namespace for the JcrMock (since it will always
be used in a Sling context I guess), so that this works even with
MockSling.newResourceResolverFactory(ResourceResolverType.JCR_MOCK)
> SlingMocks always returns the value of property jcr:primaryType for
> Resource.getResourceType()
> ----------------------------------------------------------------------------------------------
>
> Key: SLING-4773
> URL: https://issues.apache.org/jira/browse/SLING-4773
> Project: Sling
> Issue Type: Bug
> Components: Testing
> Affects Versions: Testing Sling Mock 1.3.0
> Reporter: Konrad Windszus
> Attachments: SLING-4773-testcase-v1.diff
>
>
> Even if a resource was created with {{sling:resourceType}} being set to some
> value calling {{Resource.getResourceType()}} will always return the value of
> its "jcr:primaryType" property, even if the "sling:resourceType" property is
> being set.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)