if(servletCheckFailed) {
fail(SLING_JUNIT_SERVLET_PATH + " check failed previously, cannot run tests");
}
if(!servletOk) {
final RetryingContentChecker servletChecker = new RetryingContentChecker(getRequestExecutor(), getRequestBuilder(),
getServerUsername(), getServerPassword())
{
@Override
public void onTimeout() {
servletCheckFailed = true;
}
@Override
protected boolean assertMore(RequestExecutor e) throws Exception {
e.assertContentContains("SlingJUnitServlet");
return true;
}
};
final String path = SLING_JUNIT_SERVLET_PATH;
final int status = 200;
final int timeout = TimeoutsProvider.getInstance().getTimeout(30);
final int intervalMsec = TimeoutsProvider.getInstance().getTimeout(500);
log.info("Checking that {} returns status {}, timeout={} seconds",
new Object[] { path, status, timeout });
servletChecker.check(path, status, timeout, intervalMsec);
servletOk = true;
log.info("{} is ready, returns expected content", path);
}
}