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 2016/12/19 11:59:58 UTC

[jira] [Closed] (SLING-6387) ContentLoader shouldn't commit changes or at least allow to disable auto commit

     [ https://issues.apache.org/jira/browse/SLING-6387?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stefan Seifert closed SLING-6387.
---------------------------------

> 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)