Dirk Rudolph created SLING-6387:
-----------------------------------
Summary: 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
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)