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