use of org.eclipse.reddeer.common.wait.WaitWhile in project jbosstools-openshift by jbosstools.
the class DebuggingEAPAppTest method cleanAndBuildWorkspace.
private static void cleanAndBuildWorkspace() {
new ShellMenuItem("Project", "Clean...").select();
new DefaultShell("Clean");
new PushButton("Clean").click();
new WaitWhile(new JobIsRunning());
}
use of org.eclipse.reddeer.common.wait.WaitWhile in project jbosstools-openshift by jbosstools.
the class CDKServer method operateServerState.
@Override
protected void operateServerState(String menuItem, final ServerState resultState) {
ServerState actualState = this.getLabel().getState();
MultipleWaitConditionHandler waitConditions = new MultipleWaitConditionHandler(waitConditionMatrix, " one of given wait condition is fulfilled");
TimePeriod timeout = TimePeriod.VERY_LONG;
if (menuItem == "Restart") {
timeout = TimePeriod.getCustom(480);
}
log.debug("Operate server's state from: + '" + actualState + "' to '" + menuItem + "'");
select();
new ContextMenuItem(menuItem).select();
// waiting until servers's state has changed from initial state into something else,
// ie. stopped -> starting or started -> stopping
new WaitWhile(new ServerHasState(this, actualState), TimePeriod.DEFAULT);
// we might expect that after the state is changed it should not go back into initial state
// or that problem dialog appears
// later on, we might get "Multiple problems have occurred" dialog
waitForProblemDialog(waitConditions, menuItem, TimePeriod.DEFAULT);
checkInitialStateChange(actualState);
// decide if we wait for SSL acceptance dialog
if ((actualState == ServerState.STOPPING || actualState == ServerState.STOPPED) && !getCertificatedAccepted()) {
new WaitUntil(waitConditions, TimePeriod.getCustom(1020));
}
new WaitUntil(new ServerHasState(this, resultState), timeout);
waitForProblemDialog(waitConditions, menuItem, TimePeriod.DEFAULT);
new WaitWhile(new SystemJobIsRunning(new JobMatcher("Inspecting CDK environment")), TimePeriod.DEFAULT);
log.debug("Operate server's state finished, the result server's state is: '" + getLabel().getState() + "'");
}
use of org.eclipse.reddeer.common.wait.WaitWhile in project jbosstools-openshift by jbosstools.
the class CDKServerEditorAbstractTest method checkEditorStateAfterSave.
protected void checkEditorStateAfterSave(String location, boolean canSave) {
LabeledText label = ((CDKPart) editor).getMinishiftBinaryLabel();
label.setText(location);
new WaitUntil(new SystemJobIsRunning(getJobMatcher(MINISHIFT_VALIDATION_JOB)), TimePeriod.SHORT, false);
new WaitWhile(new SystemJobIsRunning(getJobMatcher(MINISHIFT_VALIDATION_JOB)), TimePeriod.DEFAULT, false);
if (canSave) {
verifyEditorCanSave();
} else {
verifyEditorCannotSave();
}
}
use of org.eclipse.reddeer.common.wait.WaitWhile in project jbosstools-openshift by jbosstools.
the class CDKServerAdapterAbstractTest method collectConsoleOutput.
/**
* Prints out console output via logger and returns console content
*
* @param log reference to logger
* @param onFail if true then error log method is used, debug otherwise
* @return returns console output
*/
public String collectConsoleOutput(Logger log, boolean onFail) {
String consoleOutput = "Console is empty...";
ConsoleView view = new ConsoleView();
view.open();
if (view.getConsoleText() != null) {
new WaitWhile(new ConsoleHasNoChange(), TimePeriod.DEFAULT, false);
consoleOutput = view.getConsoleLabel() + "\n\r" + view.getConsoleText();
if (onFail) {
log.info("Loggin console, called from test failure");
log.error(consoleOutput);
} else {
log.info("Logging console for debugging purposes");
log.debug(consoleOutput);
}
}
return consoleOutput;
}
use of org.eclipse.reddeer.common.wait.WaitWhile in project jbosstools-openshift by jbosstools.
the class OpenNewApplicationWizardWithNoProjectTest method deleteTmpProject.
@After
public void deleteTmpProject() {
OpenShift3Connection connection = new OpenShiftExplorerView().getOpenShift3Connection(connectionReq.getConnection());
connection.refresh();
new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
if (connection.projectExists(projectName)) {
connection.getProject(projectName).delete();
}
// Delete connection too
new OpenShiftExplorerView().getOpenShift3Connection(connectionReq.getConnection()).remove();
}
Aggregations