Package org.apache.sling.testing.tools.retry

Examples of org.apache.sling.testing.tools.retry.RetryLoop


        if (!instance.isHeartbeatRunning()) {
          // if the heartbeat is not running, this instance is considered dead
          // hence we're not doing any assert here (as the count is only
          // valid if heartbeat/checkView is running and that would void the test)
        } else {
                    new RetryLoop(new ConditionImplementation(instance, aliveCntFinal), INSTANCE_VIEW_WAIT_TIME_MILLIS,
                            INSTANCE_VIEW_POLL_INTERVAL_MILLIS);
        }
      }

      // start/stop heartbeats accordingly
View Full Code Here


                    .assertStatus(expectedStatus);
                return assertMore(executor);
            }
               
        };
        new RetryLoop(c, timeoutSeconds, intervalBetweenrequestsMsec) {
            @Override
            protected void onTimeout() {
                RetryingContentChecker.this.onTimeout();
            }
        };
View Full Code Here

        if (testContainer == null) {
            ServerConfiguration sc = new ServerConfiguration();
            ExamSystem system = DefaultExamSystem.create(sc.config());
            testContainer = PaxExamRuntime.createContainer(system);
            testContainer.start();
            new RetryLoop(new RetryLoop.Condition() {
                public String getDescription() {
                    return "Check if MDCTestServlet is up";
                }

                public boolean isTrue() throws Exception {
View Full Code Here

            props.put("list", list);
            props.put("map", map);

            final String jobId = jobManager.addJob(TOPIC, props).getId();

            new RetryLoop(Conditions.collectionIsNotEmptyCondition(finishedEvents,
                    "Waiting for finishedEvents to have at least one element"), 5, 50);

            // no jobs queued, none processed and no available
            new RetryLoop(new RetryLoop.Condition() {

                @Override
                public String getDescription() {
                    return "Waiting for job to be processed. Conditions: queuedJobs=" + jobManager.getStatistics().getNumberOfQueuedJobs() +
                            ", jobsCount=" + processedJobsCount + ", findJobs=" +
View Full Code Here

            props.put("dao", dao);

            final String id = jobManager.addJob(TOPIC + "/failed", props).getId();

            // wait until the conditions are met
            new RetryLoop(new RetryLoop.Condition() {

                @Override
                public boolean isTrue() throws Exception {
                    return failedJobsCount.get() == 0
                            && finishedEvents.size() == 0
View Full Code Here

                        final String content = H.getContent(unstructuredNode.nodeUrl + ".html", HttpTest.CONTENT_TYPE_HTML);
                        return content.contains(expected);
                    }
                };
               
                new RetryLoop(c, CHECK_CONTENT_TIMEOUT_SECONDS, CHECK_CONTENT_INTERVAL_MSEC);
            }
        } finally {
            if(toDelete != null) {
                H.getTestClient().delete(toDelete);
            }
View Full Code Here

        final String fullTextSearchParameter = "Excepteur";
        final String queryUrl = WEBDAV_BASE_URL + "/content.query.json?queryType=xpath&statement="
                + URLEncoder.encode("/jcr:root/" + folderName
                + "//*[jcr:contains(.,'" + fullTextSearchParameter+ "')]", "UTF-8");

        new RetryLoop(new Condition() {

            public boolean isTrue() throws Exception {
                String result = getContent(queryUrl, CONTENT_TYPE_JSON);

                JSONArray results = new JSONArray(result);
View Full Code Here

            public boolean isTrue() throws Exception {
                return getEventsCount(b, topic) > previousCount;
            }
        };
        new RetryLoop(c, timeoutSeconds, 500);
    }
View Full Code Here

TOP

Related Classes of org.apache.sling.testing.tools.retry.RetryLoop

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.