Hi Bertrand,

Thank you for this advice. 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?

-Petr


2015-07-01 8:02 GMT+02:00 Bertrand Delacretaz <[email protected]>:

> Hi Petr,
>
> On Wed, Jul 1, 2015 at 12:52 AM, Petr Shypila <[email protected]> wrote:
> > ...Since now I need a RetryLoop I need a new dependency as well. And it
> should
> > be loaded to Karaf...
>
> We're not using Karaf in those tests, it's pax exam that's starting
> them - but yes if you use the RetryLoop you need to load the
> org.apache.sling.testing.tools bundle.
>
> In your case the bundle is probably not starting due to missing
> dependencies, you would see that from messages like "Error starting
> mvn:org.apache.sling/org.apache.sling.testing.tools/1.0.10" in the
> test log.
>
> But considering that that bundle has several dependencies that are
> unrelated to what we are testing here it's probably better to
> implement your own simple retry mechanism for these tests.
>
> Note that the way you tried to use RetryLoop wouldn't work anyway,
> that class waits for its condition to *become* true, so if you wait
> like this for example
>
> public boolean isTrue() throws Exception {
>   // Node should not be deleted after bundle was uninstalled
>   return session.itemExists(testNodeName + ".json/jcr:content");
> }
>
> If the node is deleted but only after the condition executes the first
> time, your test won't detect that - so you'll need a better mechanism
> to test such things. You might need to detect when the contentloader
> becomes idle after detecting bundle changes, if changes are needed to
> the module code to make that testing easier we can discuss that.
>
> -Bertrand
>

Reply via email to