Hello everyone, I didn't create a patch for IT of contentloader module yet because it still doesn't approved from your side. Is this approach works for you? If yes, I would be happy to finish it, otherwise I would be happy to make all required changes.
-Petr 2015-07-03 12:50 GMT+03:00 Petr Shypila <[email protected]>: > Hello Bertrand, > > I have implemented basic implementation of retry-loop mechanism for IT of > BundleContentLoader[1]. It mostly a copy of existing RetryLoop and should > be refactored, but it shows the main idea of my approach. I have added > static boolean to BundleContentLoader[2] indicates when BundleContentLoader > is in idle state. As far as I can understand BundleContentLoader exists in > single instance and every bundle uninstallation doesn't create new thread > for these needs. Otherwise this approach will not work and I have no idea > at this time how we can test it without major code changes. > > I have also created a factory class for retry-loop conditions to avoid > code duplication, but the only thing I care about is required for factory > session object[3] which I set before test starts. > > [1] > https://github.com/PetrShypila/sling-builder/blob/9b807b82f74e00c389613714c625f9997398d7ac/bundles/jcr/contentloader/src/test/java/org/apache/sling/jcr/contentloader/it/RetryLoop.java > > [2] > https://github.com/PetrShypila/sling-builder/blob/9b807b82f74e00c389613714c625f9997398d7ac/bundles/jcr/contentloader/src/main/java/org/apache/sling/jcr/contentloader/internal/BundleContentLoader.java#L57 > > [3] > https://github.com/PetrShypila/sling-builder/blob/9b807b82f74e00c389613714c625f9997398d7ac/bundles/jcr/contentloader/src/test/java/org/apache/sling/jcr/contentloader/it/ConditionFactory.java#L53 > > -Petr > > > 2015-07-02 12:28 GMT+02:00 Bertrand Delacretaz <[email protected]>: > >> Hi Petr, >> >> On Wed, Jul 1, 2015 at 9:40 PM, Petr Shypila <[email protected]> wrote: >> > ...Speaking about a way how to detect when >> > contentloader is idle. As I understand it is possible that after call: >> > uninstallBundle(String symbolicName); >> > and at the moment of checking that item exists(doesn't exists) >> > contentloader could even not start to remove content, so it will be in >> idle >> > state. Make it probably sense to have some kind of flags which will >> show if >> > content was already removed?... >> >> Sorry but I don't understand what you mean by that, best is probably >> for you to write a minimal prototype of how you think you can tackle >> that issue. As I said minor changes to the src/main code might be ok >> if they make testing easier. >> >> -Bertrand >> > >
