use of org.eclipse.reddeer.common.wait.WaitWhile in project jbosstools-openshift by jbosstools.
the class OpenShiftUtils method deleteAllProjects.
public static void deleteAllProjects(Connection connection) {
OpenShiftExplorerView explorer = new OpenShiftExplorerView();
explorer.getOpenShift3Connection(connection).refresh();
new WaitWhile(new JobIsRunning());
List<OpenShiftProject> projects = explorer.getOpenShift3Connection(connection).getAllProjects();
for (OpenShiftProject project : projects) {
if (project != null) {
String projectName = project.getName();
try {
project.delete();
new WaitWhile(new OpenShiftProjectExists(projectName, connection), TimePeriod.LONG);
} catch (CoreLayerException ex) {
// project does not exist - project has been deleted but view has not been
// refreshed
explorer.getOpenShift3Connection(connection).refresh();
}
}
}
}
use of org.eclipse.reddeer.common.wait.WaitWhile in project jbosstools-openshift by jbosstools.
the class OpenShiftUtils method updateMavenProject.
public static void updateMavenProject(String projectName) {
new ProjectExplorer().getProject(projectName);
new ContextMenuItem("Maven", "Update Project...").select();
new DefaultShell("Update Maven Project");
new PushButton("Select All").click();
new PushButton("OK").click();
new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG);
}
use of org.eclipse.reddeer.common.wait.WaitWhile in project jbosstools-openshift by jbosstools.
the class ConnectionWizardHandlingTest method testLinkToRetrieveToken.
@Test
@Ignore("Link has been changed to Styled text. Test need to be corrected")
public void testLinkToRetrieveToken() {
new LabeledCombo(OpenShiftLabel.TextLabels.SERVER_TYPE).setSelection(OpenShiftLabel.Others.OPENSHIFT3);
new LabeledCombo(OpenShiftLabel.TextLabels.PROTOCOL).setSelection(AuthenticationMethod.OAUTH.toString());
try {
new DefaultStyledText("Enter a token or retrieve a new one.");
// pass
} catch (RedDeerException ex) {
fail("Link to retrieve token for a connection is not available.");
}
new LabeledCombo(OpenShiftLabel.TextLabels.SERVER).setText("https://nonexisting.server.com");
WidgetHandler.getInstance().sendClickNotifications(new DefaultStyledText("Enter a token or retrieve a new one.").getSWTWidget());
// There can be problem occured dialog, or it is only in log
try {
new DefaultShell("Problem Occurred");
new OkButton().click();
new WaitWhile(new ShellIsAvailable("Problem Occurred"));
new DefaultShell("");
// pass
} catch (RedDeerException ex) {
// pass
}
try {
new InternalBrowser();
fail("Browser with token should not opened for nonexisting server.");
} catch (RedDeerException ex) {
// pass
}
new LabeledCombo(OpenShiftLabel.TextLabels.SERVER).setText(DatastoreOS3.SERVER);
WidgetHandler.getInstance().sendClickNotifications(new DefaultStyledText("Enter a token or retrieve a new one.").getSWTWidget());
try {
new ShellWithButton("", "Close");
new PushButton("Close").click();
AbstractWait.sleep(TimePeriod.SHORT);
} catch (RedDeerException ex) {
fail("Browser with token was not opened.");
}
}
use of org.eclipse.reddeer.common.wait.WaitWhile in project jbosstools-openshift by jbosstools.
the class ConnectionWizardHandlingTest method closeNewConnectionShell.
@After
public void closeNewConnectionShell() {
new CancelButton().click();
new WaitWhile(new ShellIsAvailable(""));
}
use of org.eclipse.reddeer.common.wait.WaitWhile in project jbosstools-openshift by jbosstools.
the class OpenShiftProjectRequirement method cleanUp.
@Override
public void cleanUp() {
if (projectSpec.cleanup()) {
Connection connection = ConnectionUtils.getConnectionOrDefault(projectSpec.connectionURL());
connection.deleteResource(project);
new WaitWhile(new OpenShiftProjectExists(project.getName(), connection));
}
}
Aggregations