Search in sources :

Example 1 with ServicePodsExist

use of org.jboss.tools.openshift.reddeer.condition.core.ServicePodsExist in project jbosstools-openshift by jbosstools.

the class OpenShiftServiceRequirement method waitForResources.

private void waitForResources(final String serviceName, final String projectName, final IService service) {
    new WaitUntil(new ServicePodsExist(serviceName, projectName, connection), TimePeriod.VERY_LONG);
    new WaitUntil(new ResourceExists(ResourceKind.REPLICATION_CONTROLLER, new BaseMatcher<List<IResource>>() {

        @Override
        public boolean matches(Object item) {
            if (!(item instanceof List)) {
                return false;
            }
            @SuppressWarnings("unchecked") List<IReplicationController> resources = (List<IReplicationController>) item;
            if (resources.isEmpty()) {
                return false;
            }
            return ResourceUtils.getReplicationControllerFor(service, resources) != null;
        }

        @Override
        public void describeTo(Description description) {
        }
    }, projectName, connection), TIMEPERIOD_WAIT_FOR_BUILD);
}
Also used : Description(org.hamcrest.Description) BaseMatcher(org.hamcrest.BaseMatcher) ServicePodsExist(org.jboss.tools.openshift.reddeer.condition.core.ServicePodsExist) List(java.util.List) OpenShiftResourceExists(org.jboss.tools.openshift.reddeer.condition.OpenShiftResourceExists) ResourceExists(org.jboss.tools.openshift.reddeer.condition.core.ResourceExists) WaitUntil(org.eclipse.reddeer.common.wait.WaitUntil) IResource(com.openshift.restclient.model.IResource) IReplicationController(com.openshift.restclient.model.IReplicationController)

Aggregations

IReplicationController (com.openshift.restclient.model.IReplicationController)1 IResource (com.openshift.restclient.model.IResource)1 List (java.util.List)1 WaitUntil (org.eclipse.reddeer.common.wait.WaitUntil)1 BaseMatcher (org.hamcrest.BaseMatcher)1 Description (org.hamcrest.Description)1 OpenShiftResourceExists (org.jboss.tools.openshift.reddeer.condition.OpenShiftResourceExists)1 ResourceExists (org.jboss.tools.openshift.reddeer.condition.core.ResourceExists)1 ServicePodsExist (org.jboss.tools.openshift.reddeer.condition.core.ServicePodsExist)1