Package org.apache.sling.testing.tools.http

Examples of org.apache.sling.testing.tools.http.RetryingContentChecker


     *  before other methods that take a symbolicName parameter,
     *  in case installBundle was just called and the actual
     *  installation hasn't happened yet. */
    public void checkBundleInstalled(String symbolicName, int timeoutSeconds) {
        final String path = getBundlePath(symbolicName, ".json");
        new RetryingContentChecker(executor, builder).check(path, 200, timeoutSeconds, 500);
    }
View Full Code Here


       
        try {
            if(!junitServletOk) {
                if(junitServletChecker == null) {
                    junitServletChecker =
                        new RetryingContentChecker(getRequestExecutor(), getRequestBuilder(), getServerUsername(), getServerPassword()) {
                        @Override
                        public void onTimeout() {
                            junitServletCheckFailed = true;
                        }
                    };
View Full Code Here

        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);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.sling.testing.tools.http.RetryingContentChecker

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.