[
https://issues.apache.org/jira/browse/SLING-4500?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14360510#comment-14360510
]
ASF GitHub Bot commented on SLING-4500:
---------------------------------------
GitHub user santiagozky opened a pull request:
https://github.com/apache/sling/pull/72
SLING-4500: make sure that root has a primary type
when using the mock resource resolver, the root node does not have a
primary type. this causes issues on some cases, for example:
Resource root= resourceResolver.getResource("/");
assertFalse(root.isResourceType("app/resourceType"));
will throw a null pointer exception.
I've added jcr:root as the primary type of the root node and a test case
for this.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/santiagozky/sling bug/root-primary-type
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/sling/pull/72.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 #72
----
commit 5eb786449c4389c8ad3d96ea0566443e7acc926c
Author: santiago garcia pimentel <[email protected]>
Date: 2015-03-13T15:21:59Z
make sure that root has a primary type
----
> Missing primary type in the root node, when using the mocked resource resolver
> ------------------------------------------------------------------------------
>
> Key: SLING-4500
> URL: https://issues.apache.org/jira/browse/SLING-4500
> Project: Sling
> Issue Type: Bug
> Components: Testing
> Reporter: santiago garcĂa pimentel
> Priority: Minor
>
> when using the Mocked ResourceResolver
> (org.apache.sling.testing.resourceresolver.MockResourceResolver), the root
> node does not have a primary type, this causes that something like
> Resource root= resourceResolver.getResource("/");
> assertFalse(root.isResourceType("app/resourceType"));
> will throw a NPE, since the node does not have either resourceType or primary
> type.
> Instead, the root node should have a primary type.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)