use of org.eclipse.reddeer.common.wait.WaitUntil in project jbosstools-openshift by jbosstools.
the class OpenShift3NativeProjectUtils method createProject.
public static IProject createProject(String name, String displayName, String description, Connection connection) {
assertTrue(StringUtils.isNotBlank(name));
assertNotNull(displayName);
assertNotNull(description);
assertNotNull(connection);
IProjectRequest request = connection.getResourceFactory().stub(ResourceKind.PROJECT_REQUEST, name);
request.setDisplayName(StringUtils.isEmpty(displayName) ? name : displayName);
request.setDescription(StringUtils.isEmpty(description) ? name : description);
CreateProjectWaitCondition createProjectWaitCondition = new CreateProjectWaitCondition(connection, request);
new WaitUntil(createProjectWaitCondition, TimePeriod.VERY_LONG);
IProject createdProject = createProjectWaitCondition.getProject();
/**
* WORKAROUND: explorer wont get notified of the the new project and
* therefore wont display it unless a manual refresh is done on the
* connection. https://issues.jboss.org/browse/JBIDE-23513 remove
* this wait once WatchManager is watching projects and notifies the
* ui.
*
* @see WatchManager#KINDS
*/
new WaitUntil(new OpenShiftProjectExists(createdProject.getDisplayName(), connection));
return createdProject;
}
use of org.eclipse.reddeer.common.wait.WaitUntil in project jbosstools-openshift by jbosstools.
the class Service method createServerAdapter.
/**
* Creates server adapter for this service with default values.
*/
public void createServerAdapter() {
select();
new ContextMenuItem(OpenShiftLabel.ContextMenu.NEW_ADAPTER_FROM_EXPLORER).select();
new DefaultShell(OpenShiftLabel.Shell.SERVER_ADAPTER_SETTINGS);
new FinishButton().click();
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.SERVER_ADAPTER_SETTINGS));
new WaitUntil(new JobIsKilled("Refreshing server adapter list"), TimePeriod.LONG, false);
new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
}
use of org.eclipse.reddeer.common.wait.WaitUntil in project jbosstools-openshift by jbosstools.
the class AbstractOpenShiftConnection method remove.
/**
* Removes connection from OpenShift explorer view.
*/
public void remove() {
item.select();
new ContextMenuItem(OpenShiftLabel.ContextMenu.DELETE_CONNECTION).select();
new WaitUntil(new ShellIsAvailable(OpenShiftLabel.Shell.REMOVE_CONNECTION));
new DefaultShell(OpenShiftLabel.Shell.REMOVE_CONNECTION);
new OkButton().click();
new WaitWhile(new ShellIsAvailable(OpenShiftLabel.Shell.REMOVE_CONNECTION));
new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
}
use of org.eclipse.reddeer.common.wait.WaitUntil in project jbosstools-openshift by jbosstools.
the class PortForwardingTest method testPortForwardingButtonsAccessibility.
@Test
public void testPortForwardingButtonsAccessibility() {
openPortForwardingDialog();
PushButton startAllButton = new PushButton(OpenShiftLabel.Button.START_ALL);
PushButton stopAllButton = new PushButton(OpenShiftLabel.Button.STOP_ALL);
OkButton okButton = new OkButton();
assertTrue("Button Start All should be enabled at this point.", startAllButton.isEnabled());
assertFalse("Button Stop All should be disabled at this point.", stopAllButton.isEnabled());
startAllButton.click();
new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
new WaitUntil(new ControlIsEnabled(okButton));
try {
new WaitWhile(new ControlIsEnabled(startAllButton), TimePeriod.getCustom(5));
} catch (WaitTimeoutExpiredException ex) {
fail("Button Start All should be disabled at this point.");
}
new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
new WaitWhile(new ControlIsEnabled(okButton), false);
stopAllButton = new PushButton(OpenShiftLabel.Button.STOP_ALL);
assertTrue("Button Stop All should be enabled at this point.", stopAllButton.isEnabled());
stopAllButton.click();
new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
new DefaultShell(OpenShiftLabel.Shell.APPLICATION_PORT_FORWARDING);
new WaitUntil(new ControlIsEnabled(okButton));
try {
new WaitUntil(new ControlIsEnabled(startAllButton), TimePeriod.getCustom(5));
} catch (WaitTimeoutExpiredException ex) {
fail("Button Start All should be enabled at this point.");
}
assertFalse("Button Stop All should be disabled at this point.", stopAllButton.isEnabled());
}
use of org.eclipse.reddeer.common.wait.WaitUntil in project jbosstools-openshift by jbosstools.
the class ScalingTest method scaleTo0ShouldWarn.
@Test
public void scaleTo0ShouldWarn() {
int pods = requiredService.getReplicationController().getCurrentReplicaCount();
new WaitUntil(new PodsAreDeployed(project, OpenShiftResources.NODEJS_APP_REPLICATION_CONTROLLER, pods), TimePeriod.LONG);
OpenShiftResource replicationController = project.getOpenShiftResource(Resource.DEPLOYMENT, OpenShiftResources.NODEJS_APP_REPLICATION_CONTROLLER);
replicationController.select();
scaleTo(0);
new DefaultShell(OpenShiftLabel.Shell.STOP_ALL_DEPLOYMENTS).setFocus();
new YesButton().click();
assertPodAmountDesiredEqualsCurrent(0, project);
}
Aggregations