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 2022/08/22 12:35:00 UTC
[jira] [Resolved] (SLING-11548) sling-mock: Introduce RESOURCEPROVIDER_MOCK resource resolver type
[ https://issues.apache.org/jira/browse/SLING-11548?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Stefan Seifert resolved SLING-11548.
------------------------------------
Resolution: Fixed
https://github.com/apache/sling-org-apache-sling-testing-sling-mock/commit/0bc35f0540a67a5e31eaca2fb29c3428118f929a
> sling-mock: Introduce RESOURCEPROVIDER_MOCK resource resolver type
> ------------------------------------------------------------------
>
> Key: SLING-11548
> URL: https://issues.apache.org/jira/browse/SLING-11548
> Project: Sling
> Issue Type: New Feature
> Components: Testing
> Reporter: Stefan Seifert
> Assignee: Stefan Seifert
> Priority: Major
> Fix For: Testing Sling Mock 3.4.0
>
> Time Spent: 1h 10m
> Remaining Estimate: 0h
>
> based on the new MockResourceProvider implemention in resourceresolver-mock (SLING-11455) we introduce a new resource resolver type {{RESOURCEPROVIDER_MOCK}} that's uses the ResourceProvider implementation instead of the MockResourceResolver.
> with this change we remove the additional wrapper layers for MockResourceResolverFactory and MockResourceResolver in sling-mock there were introduced for SLING-5922/SLING-10753 and caused various trouble because the wrapper layer was too simplicisty (examples for problems: SLING-10937, SLING-11252, [WTES-74|https://wcm-io.atlassian.net/browse/WTES-74])
> benefits of {{RESOURCEPROVIDER_MOCK}} compared to {{{}RESOURCERESOLVER_MOCK{}}}:
> * it used the "real" sling resource resolver implementation with full support for combinding multiple ResourceProvider
> * fully supports loading folders of JSON or FileVault XML content as described in SLING-5922/SLING-10753.
> this feature is no longer supported with {{RESOURCERESOLVER_MOCK}} and the error message indicated to switch to {{RESOURCEPROVIDER_MOCK}} for those tests that make use of this feature.
> * overall the resourceresolver behaves "closer" to the real resourceresolver than using MockResourceResolver alone
> drawbacks:
> * the test execution has more overhead initializing the sling resourceresolver implementation with a lot of magic happening behinde the scenes
> that's why we introduced a new resource resolver type, and did not just change the implementation of {{{}RESOURCERESOLVER_MOCK{}}}, and {{RESOURCERESOLVER_MOCK}} is still the default mode as it still serves well for the majority of typical use cases
--
This message was sent by Atlassian Jira
(v8.20.10#820010)