use of org.jboss.tools.openshift.reddeer.condition.core.NamedResourceExist in project jbosstools-openshift by jbosstools.
the class OpenShiftServiceRequirement method createService.
private IService createService(String serviceName, ITemplate template, String projectName, Connection connection) {
LOGGER.debug(NLS.bind("Creating service in project {0} on server {1} using template {2}", new Object[] { projectName, connection.getHost(), template.getName() }));
IProject project = OpenShift3NativeResourceUtils.getProject(projectName, connection);
assertNotNull(project);
CreateApplicationFromTemplateJob job = new CreateApplicationFromTemplateJob(project, template);
job.schedule();
new WaitWhile(new JobIsRunning(new Matcher[] { CoreMatchers.sameInstance(job) }), TimePeriod.LONG);
new WaitUntil(new NamedResourceExist(ResourceKind.SERVICE, serviceName, projectName, connection), TimePeriod.VERY_LONG);
return connection.getResource(ResourceKind.SERVICE, projectName, serviceName);
}
Aggregations