use of org.eclipse.reddeer.common.wait.WaitWhile in project jbosstools-openshift by jbosstools.
the class OpenShiftServiceRequirement method cleanUp.
@Override
public void cleanUp() {
if (serviceSpec.cleanup()) {
String projectName = TestUtils.getValueOrDefault(serviceSpec.project(), DatastoreOS3.TEST_PROJECT);
final IProject project = OpenShift3NativeResourceUtils.getProject(projectName, connection);
IProjectTemplateProcessing capability = project.getCapability(IProjectTemplateProcessing.class);
ITemplate processed = capability.process(template);
for (IResource resource : processed.getObjects()) {
IResource res = connection.getResource(resource.getKind(), projectName, resource.getName());
try {
connection.deleteResource(res);
} catch (OpenShiftException ex) {
LOGGER.error("Unable to remove " + res.getKind() + " named " + res.getName());
LOGGER.error(StackTraceUtils.stackTraceToString(ex));
}
}
cleanResources(connection, ResourceKind.BUILD, project, template);
cleanResources(connection, ResourceKind.REPLICATION_CONTROLLER, project, template);
cleanResources(connection, ResourceKind.POD, project, template);
new WaitWhile(new AbstractWaitCondition() {
@Override
public boolean test() {
for (IResource resource : project.getResources(ResourceKind.POD)) {
if (resource.getName().startsWith(template.getName())) {
return true;
}
}
return false;
}
@Override
public String description() {
return "at least one application pod is running";
}
}, TimePeriod.LONG);
new OpenShiftExplorerView().getOpenShift3Connection(connection).refresh();
}
}
use of org.eclipse.reddeer.common.wait.WaitWhile in project jbosstools-openshift by jbosstools.
the class CDKLaunchConfigurationTest method setupServerWizardPage.
@Override
protected void setupServerWizardPage(NewMenuWizard dialog) {
NewServerWizardPage page = new NewServerWizardPage(dialog);
page.selectType(SERVER_TYPE_GROUP, CDK32_SERVER_NAME);
page.setName(getServerAdapter());
dialog.next();
NewCDK32ServerWizardPage containerPage = new NewCDK32ServerWizardPage();
containerPage.setCredentials(USERNAME, PASSWORD);
log.info("Setting hypervisor to: " + hypervisor);
containerPage.setHypervisor(hypervisor);
log.info("Setting binary to " + CDK32_MINISHIFT);
containerPage.setMinishiftBinary(CDK32_MINISHIFT);
// here comes possibility to set profile while creating server adapter
log.info("Setting profile to: ");
containerPage.setMinishiftProfile("");
new WaitWhile(new SystemJobIsRunning(getJobMatcher(MINISHIFT_VALIDATION_JOB)), TimePeriod.MEDIUM, false);
}
use of org.eclipse.reddeer.common.wait.WaitWhile in project jbosstools-openshift by jbosstools.
the class CDKTestUtils method openNewServerWizardDialog.
public static NewCDKServerWizard openNewServerWizardDialog() {
// $NON-NLS-1$
log.info("Adding new Container Development Environment server adapter");
// call new server dialog from servers view
CDKServersView view = new CDKServersView();
view.open();
NewCDKServerWizard dialog = view.newCDKServer();
new WaitWhile(new JobIsRunning(), TimePeriod.MEDIUM, false);
return dialog;
}
use of org.eclipse.reddeer.common.wait.WaitWhile in project jbosstools-openshift by jbosstools.
the class CDKServerWizardAbstractTest method assertSameMessage.
protected void assertSameMessage(final NewMenuWizard dialog, final String message) {
new WaitWhile(new SystemJobIsRunning(getJobMatcher(MINISHIFT_VALIDATION_JOB)), TimePeriod.DEFAULT, false);
String description = dialog.getMessage();
assertTrue("Expected page description should contain text: " + message + " but has: " + description, description.contains(message));
}
use of org.eclipse.reddeer.common.wait.WaitWhile in project jbosstools-openshift by jbosstools.
the class CDKServerWizardAbstractTest method assertServerType.
protected void assertServerType(final String serverType) {
NewCDKServerWizard wizard = (NewCDKServerWizard) CDKTestUtils.openNewServerWizardDialog();
try {
TreeItem item = new DefaultTreeItem(new String[] { SERVER_TYPE_GROUP }).getItem(serverType);
item.select();
assertTrue(item.getText().equalsIgnoreCase(serverType));
new WaitWhile(new JobIsRunning(), TimePeriod.MEDIUM, false);
} catch (CoreLayerException coreExp) {
log.error(coreExp.getMessage());
fail("Server type " + serverType + " was not found in New Server Wizard");
}
assertEquals(new LabeledText("Server's host name:").getText(), "localhost");
assertEquals(new LabeledText("Server name:").getText(), getServerAdapter());
new WaitUntil(new ControlIsEnabled(new NextButton()), TimePeriod.MEDIUM, false);
assertTrue("Dialog button Next is not enabled!", wizard.isNextEnabled());
try {
new WaitWhile(new JobIsRunning(), TimePeriod.MEDIUM, false);
new CancelButton().click();
} catch (WaitTimeoutExpiredException exc) {
exc.printStackTrace();
log.error("Dialog could not be canceled because there were unfinished jobs running after timeout" + "\n\rTrying to cancel dialog manually");
new DefaultShell("New Server").close();
}
}
Aggregations