[ 
https://issues.apache.org/jira/browse/SLING-6387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15738443#comment-15738443
 ] 

ASF GitHub Bot commented on SLING-6387:
---------------------------------------

GitHub user Buuhuu opened a pull request:

    https://github.com/apache/sling/pull/190

    SLING-6387: support disabling auto commit of ContnetLoader

    This requires the changes made in: https://github.com/apache/sling/pull/189 
otherwise the unit test is failing for jcr-mock repository.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/Buuhuu/sling feature/SLING-6387

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/sling/pull/190.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 #190
    
----
commit 9399405fe5bc571d1520a12b422e08f81de13bde
Author: Dirk Rudolph <[email protected]>
Date:   2016-12-10T19:30:13Z

    SLING-6387: added flag to control commiting changes done with ContentLoader 
overloading all existing public methods

commit 8f88d8c2ecce5cd4a88eb9a18acc3d76ad8f7fa1
Author: Dirk Rudolph <[email protected]>
Date:   2016-12-10T20:16:04Z

    SLING-6388: implement Item.isModified reacting on implementations of 
Node.setProperty and Property.setValue() calls

commit a90378c7d2c8e00ca0178861b19943dcfcc6ca51
Author: Dirk Rudolph <[email protected]>
Date:   2016-12-10T20:18:07Z

    SLING-6388: implemented tracking of session changes for MockSession

commit bf08d4535943ef13dfcb18e228db2fd57f37e0b5
Author: Dirk Rudolph <[email protected]>
Date:   2016-12-10T20:22:48Z

    Merge remote-tracking branch 'origin/feature/SLING-6388' into 
feature/SLING-6387

commit fb5722bfc22c50079d5b5bd7d5438888a753744d
Author: Dirk Rudolph <[email protected]>
Date:   2016-12-10T20:28:01Z

    SLING-6388: updated dependecy to latest jcr-mock to get the unit tests 
running on jcr-mock as well

commit 96c453af2ca24d2c05f0ebe1528e58e66efdc245
Author: Dirk Rudolph <[email protected]>
Date:   2016-12-10T20:28:34Z

    SLING-6387: added liecense to the newly created test classes

commit f80f2aae07dd0430dc574bf9d682dee8f50cf95e
Author: Dirk Rudolph <[email protected]>
Date:   2016-12-10T20:28:59Z

    SLING-6387: increased minor version of loader package

----


> 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
>            Priority: Minor
>
> 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)

Reply via email to