[
https://issues.apache.org/jira/browse/SLING-6387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15740099#comment-15740099
]
ASF GitHub Bot commented on SLING-6387:
---------------------------------------
Github user asfgit closed the pull request at:
https://github.com/apache/sling/pull/190
> ContentLoader shouldn't commit changes or at least allow to disable auto
> commit
> -------------------------------------------------------------------------------
>
> Key: SLING-6387
> URL: https://issues.apache.org/jira/browse/SLING-6387
> Project: Sling
> Issue Type: Improvement
> Components: Testing
> Affects Versions: Testing Sling Mock 2.1.2
> Reporter: Dirk Rudolph
> Assignee: Stefan Seifert
> Priority: Minor
> Fix For: Testing Sling Mock 1.9.2, Testing Sling Mock 2.2.2
>
>
> The {{ContentLoader}} always, automatically persists changes made to the
> given {{ResoureResolver}}. This makes it hard to use for test on classes
> implementing transactional changes.
> Example: Having high-level APIs that do changes on the {{ResourceResolver}}
> allowing to automatically commiting them (PageManager, AssetManager in AEM as
> implementation on top of sling). But to keep it abstract, lets say I have a
> class {{SpecificBinaryFileSetResource}}, which has a method
> {{addBinaryFile}}. The goal is to implement a mock for that, so I'm using
> {{ContentLoader}} to create a binary file in the {{ResourceResolver}}. This
> will automatically commit the changes. Now lets extend the {{addBinaryFile}}
> to accept a boolean parameter to not automatically commit those changes
> (maybe because I want to make multiple changes rolling them back on error).
> This isn't not supported so far when using ContentLoader.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)