in src/main/java/org/apache/sling/testing/clients/SlingClient.java [250:273]
public void waitUntilExists(final String path, final long waitMillis, int retryCount)
throws TestingValidationException, InterruptedException {
AbstractPoller poller = new AbstractPoller(waitMillis, retryCount) {
boolean found = false;
public boolean call() {
try {
found = exists(path);
} catch (ClientException e) {
// maybe log
found = false;
}
return true;
}
public boolean condition() {
return found;
}
};
boolean found = poller.callUntilCondition();
if (!found) {
throw new TestingValidationException("path " + path + " does not exist after " + retryCount + " retries");
}
}