Search in sources :

Example 1 with ProjectExists

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

the class CleanOpenShiftConnectionRequirement method fulfill.

@Override
public void fulfill() {
    Connection connection = ConnectionUtils.getConnectionOrDefault(cleanConnection.connectionURL());
    assertNotNull("There is no connection with URL " + cleanConnection.connectionURL(), connection);
    List<IResource> projects = connection.getResources(ResourceKind.PROJECT);
    for (IResource project : projects) {
        String projectName = project.getName();
        connection.deleteResource(project);
        new WaitWhile(new ProjectExists(projectName, connection), TimePeriod.LONG);
    }
    connection.refresh();
}
Also used : WaitWhile(org.eclipse.reddeer.common.wait.WaitWhile) ProjectExists(org.jboss.tools.openshift.reddeer.condition.core.ProjectExists) CleanConnection(org.jboss.tools.openshift.reddeer.requirement.CleanOpenShiftConnectionRequirement.CleanConnection) Connection(org.jboss.tools.openshift.core.connection.Connection) IResource(com.openshift.restclient.model.IResource)

Aggregations

IResource (com.openshift.restclient.model.IResource)1 WaitWhile (org.eclipse.reddeer.common.wait.WaitWhile)1 Connection (org.jboss.tools.openshift.core.connection.Connection)1 ProjectExists (org.jboss.tools.openshift.reddeer.condition.core.ProjectExists)1 CleanConnection (org.jboss.tools.openshift.reddeer.requirement.CleanOpenShiftConnectionRequirement.CleanConnection)1